How To: Hack Your Firefox User Agent to Spoof Your OS and Browser

Hack Your Firefox User Agent to Spoof Your OS and Browser

There are a lot of things on your computer that can reveal information about you when you are surfing the Internet. If you are like me, then you will do anything to maintain your privacy and prevent those little leaks of information from happening. Here's a list of a few of the "threats" that can reveal information about you:

  • Undeleted cookies
  • User Agent
  • OS fingerprint
  • IP address
  • Username (if they pertain to your real name)

For the next few days at Null Byte, we are going to mitigate as many of the Internet's anonymity issues as we can through some safe practices, browser plugins, hacks and more! Today we are going to hack our Internet browser's user agent to appear on websites as a different operating system and browser.

Requirements

A user agent is something used by JavaScript for a multitude of reasons. Here are just a few of the things that it can be used for:

What Is a User Agent Used For?

  • Running different versions of a page, based on browser and compatibility with said browser.
  • Seeing which OS you have to stream media.
  • Web logs. Someone can use a user agent to identify a hacker via matching logs.
  • Browser-specific applications compatibility checking.
  • Marketing sites can use your agent to tailor ads towards you.

Hack Your User Agent

Now, let's actually hack out our agent. I want to have our agent display us as a microwave oven. This ought to throw off the pesky feds after I "r00ted their b0x3n" (just kidding).

  1. Open up Firefox, and in a new tab type:

about:config
In that new tab, click "I'll be careful, I promise!" to proceed.

  1. Type in the search bar on top:

agent

  1. Then find the string value that corresponds to your computer's information. If should look something like this:

Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0

  1. Right-click this value and modify it to display whatever you would like. Here's a silly picture of mine after checking it on Who is Hosting This's User Agent tool.

Funny, isn't it?

Follow me on Twitter and jump in the IRC for more of the latest and greatest Null Byte action.

Just updated your iPhone to iOS 18? You'll find a ton of hot new features for some of your most-used Apple apps. Dive in and see for yourself:

9 Comments

LOL: "I want to have our agent display us as a microwave oven. " Never thought of hacking into FF and changing the user agent. Nice article!

Can anything bad come of this? For example interfere with Windows or Firefox updates

No it just has to do with the http headers that are sent during the request.

It doesn't seem to work with the latest Firefox (8.0). I went into the about config and typed "agent" but nothing relevant came up.

I'm using Fire Fox Beta 9 and everything appears to be working fine - everything is now named Microwave

In FF 7.0.1/8.0 the only string value (after using the "agent" filter) is for the language option, all others are boolean. So, where to look?
Also, is there any way to stop/adjust displayed info about installed extensions?

you need the torbutton extension!

Look forward to the 'not null' user agent being banned on my Web site. There are far too many intrusions on my site to permit silly games like this.

Please. You are going to filter things based on a user-inputable-string? Good luck with that.

Changing your useragent is along the same lines as changing the badge on a car from "Ford" to "Honda". It has about the same impact as well :P.

Share Your Thoughts

  • Hot
  • Latest