Categories
User agent spoofing – what is it?

User agent spoofing – what is it?

User agent spoofing is defined as the replacement of the user agent string sent by your browser as an HTTP header with a string that contains another character. The users can change their user agent with the help of several extensions and plugins that are provided by each browser. Thus, if your original user agent looked like this:

Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36

Your spoofed user agent will appear like this:

Mozilla/5.0 (Windows NT 6.1; WOW64) Gecko/20090722 Chrome/38.0.2125.104 (X) Safari 6 Orca/1.2 build 2

Let’s understand this concept with an example.

Example of user agent spoofing

Imagine I use the user agent of Samsung Galaxy S4, which is:

Mozilla/5.0 (Linux; Android 4.2.2; nl-nl; SAMSUNG GT-I9505 Build/JDQ39) AppleWebKit/535.19 (KHTML, like Gecko) Version/1.0 Chrome/18.0.1025.308 Mobile Safari/535.19

Then, I substitute the bits from the user agent of HTC Vision, and I get:

Mozilla/5.0 (Linux; U; Android 2.3.5; en-us; HTC Vision Build/GRI40) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1

In the end, the hybrid user agent I get is:

Mozilla/5.0 (Linux; U; Android 2.3.5; en-us; HTC Vision Build/GRI40) AppleWebKit/533.1 (X; 543) Version/4.0 Mobile Safari/533.1

The above user agent is still known as an android smartphone.

As you can see, the mixing of the user agents is quite usual, where I have added a few additional characters. However, there’s another case in which the user agents consist of a random character mix.

Now, in this case, what would happen if that random mix of characters did not correspond to any real strings of the user agent? For instance, we have:

aRjP&^%$erF

These user agents are known as Desktop/Emulator type devices, which means that they will supply the desktop version of the website. The users who use such a type of character mix want to show the world that their user agents must be treated as generic devices, which don’t have any particular characteristics.

What is the impact of user agent spoofing?

User agent spoofing plays a key role in simplifying testing for several devices, and it proves to be quite beneficial for projects and websites. If you want to see how your website will appear on a certain device, all you have to do is renew your user agent.

The customers may give up viewing the content in the perfect composition and format when they choose to spoof their user agent. The spoofed user agent may cover the device as that of a different one in which case it becomes difficult for the customers to view the content in the best format. However, if the spoofed user agent resembles the original type of the device, the customers will then be able to view the content of the website in the perfect composition and format.

It is never a good idea to force your customers to view a certain version of your site because it might be annoying for them. However, if you wish them to see different versions of your website, we suggest you provide links to those versions. If they want, they can check them out themselves.

Was this article helpful?

Support us to keep up the good work and to provide you even better content. Your donations will be used to help students get access to quality content for free and pay our contributors’ salaries, who work hard to create this website content! Thank you for all your support!

Reaction to comment: Cancel reply

What do you think about this article?

Your email address will not be published. Required fields are marked.