User Agent Strings

D

DevynCJohnson

Guest
In computing, a user agent is a piece of software acting on behalf of the user. For instance, when using Thunderbird to retrieve and manage the user's emails, Thunderbird is the user-agent. User-agents exist on the client-side of the network transaction. The server know about the client because the user agent sends information such as a "user agent string". Some web-surfers may have noticed that websites seem to auto-detect which operating system the user/client is using. This is due to information in the user agent string (also called the "user agent header"). The user agent string contains various pieces of information and it can be manipulated.

user-agent-string.png


If computer users go to http://whatsmyuseragent.com/, they will see their user agent string on the webpage. For instance, I see "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:34.0) Gecko/20100101 Firefox/34.0". This provides information regarding my system and web-browser. Most web-browsers give a user agent string beginning with "Mozilla/5.0" because at one time certain browsers were restricted from various websites or features due to compatibility issues. Therefore, many web-browser developers put "Mozilla/5.0" in the user agent string to impersonate Firefox. Many web-browsers (including Microsoft's Internet-Explorer, Opera, and others) contain "Mozilla/5.0" in their user agent string. The next part of the string provides information on my system. The "X11" indicates that I use X11 on my system (as opposed to Wayland). Next, "Ubuntu; Linux x86_64;" informs the server that the user agent is running on a 64-bit Linux system (Ubuntu to be more specific). The revision number ("rv:34.0") is Firefox's version number. The "Gecko" refers to the browser's layout engine and the "20100101" is called the Geckotrail. The Geckotrail indicates that the engine is designed for a desktop system. Finally, the "Firefox/34.0" indicates that the browser is Firefox version 34.

about_firefox.png


NOTE: You can get a detailed explanation of your user agent string by going to http://www.useragentstring.com/.

Every browser and system may use a slightly different string layout. For instance, depending on the system and Firefox build/version, Firefox may use one of the following layouts.

Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion
Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail appname/appversion
Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion appname/appversion

The "appname" is used by derivatives of Firefox (such as Seamonkey).

Below are specific examples of various Firefox user agent strings.

Android
Mozilla/5.0 (Android; Mobile; rv:30.0) Gecko/30.0 Firefox/30.0
Mozilla/5.0 (Android; Tablet; rv:30.0) Gecko/30.0 Firefox/30.0

MS-Windows
Mozilla/5.0 (Windows NT 6.2; rv:10.0) Gecko/20100101 Firefox/33.0
Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:10.0) Gecko/20100101 Firefox/33.0
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20100101 Firefox/33.0

OS X
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0) Gecko/20100101 Firefox/33.0
Mozilla/5.0 (Macintosh; PPC Mac OS X 10.6; rv:10.0) Gecko/20100101 Firefox/33.0

Linux
Mozilla/5.0 (X11; Linux i686; rv:10.0) Gecko/20100101 Firefox/33.0
Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20100101 Firefox/33.0
Mozilla/5.0 (X11; Linux i686 on x86_64; rv:10.0) Gecko/20100101 Firefox/33.0
Mozilla/5.0 (Maemo; Linux armv7l; rv:10.0) Gecko/20100101 Firefox/10.0 Fennec/10.0

Firefox OS
Mozilla/5.0 (Mobile; rv:26.0) Gecko/26.0 Firefox/26.0
Mozilla/5.0 (Tablet; rv:26.0) Gecko/26.0 Firefox/26.0

Changing the User Agent String
There are ways to change the user agent used by web-browsers. This can be useful if a website blocks your browser due to many reasons. Some web admins may block a particular web-browser due to a personal dislike for the web-browser or due to technical reasons (the website may not support certain browsers). However, users may still want to access the information and resources. This is one reason for the user to change the user agent string.

Chromium - On the Chromium web-browser, the user agent string can be changed by clicking "More Tools -> Developer Tools". Next, change the field in the "UA" entry box. Alternatively, on that same screen, click the "Emulation" tab and then select a device and browser type in the "Spoofing User Agent" drop box menu.

chromium-user-agent-string.png


Firefox - Various addons exist that provide easy ways to change the user agent string. "User Agent Switcher" by "chrispederick" provides a fast and convenient way to change the user agent string via a toolbar button. Other user agent changers exist such as https://addons.mozilla.org/en-us/firefox/addon/uacontrol/ and https://addons.mozilla.org/en-US/firefox/addon/custom-user-agent-string/. However, there is a way to manually change the user agent string via "about:config" (Firefox's registry). Type "about:config" in the address bar. In this registry, search for "general.useragent.override". If it does not exist, then create a new entry named "general.useragent.override". Next, make the value a string of the desired user agent string. To make a user agent string for a specific website, make a new entry named "general.useragent.override.DOMAIN" where "DOMAIN" is the domain name of the website. Then, set the desired user agent string.

JavaScript User Agent String
Be aware that JavaScript also has a user agent string in the JavaScript variable "navigator.userAgent". Some addons for Firefox exist (such as https://addons.mozilla.org/de/firefox/addon/user-agent-js-fixer/) which provide users a way to change this user agent string.

List of User Agent Strings
An extensive list of user agent strings for many operating systems and browsers can be found at http://www.useragentstring.com/pages/Browserlist/. Another place that lists user agent strings is http://whatsmyuseragent.com/CommonUserAgents.
 

Attachments

  • slide.jpg
    slide.jpg
    53.2 KB · Views: 188,818

Staff online

Members online


Top