default user agent header value

Browser Detection with User-Agent Header in Terms of Security

We (and almost all other web sites or malicious users do the same) detect your browser information  from your HTTP User-Agent header.

What is User-Agent Header?

The User-Agent header contains a string value that allows the network protocol peers to identify the following information; application type, operating system, browser vendor or browser version. Most of the time, we can find the device model and manufacturer from the User-Agent header. It may also contain information such as the client device’s OS version, Java capabilities, etc.

An example User-Agent header is provided below.

Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

User-Agent Headers Means

Each part of user-agent header has different meaning.

Mozilla/5.0: is general expression that says the browser is Mozilla compatible, and 5.0 is its version information.

(X11; Linux x86_64; rv:52.0): describes the native platform the browser is running on operating system such as Windows, Mac, Linux or Android. rv:52.0 indicates the release version of Gecko.

Gecko/20100101: indicates that the browser is based on Gecko. On Desktop, “20100101” is the fixed string and known as geckotrail.

Firefox/52.0: indicates the browser information. The browser is Firefox, and the version is 52.0

Default, you are sending all this information to every web page you visit.

There are lots of method to detect browser information from User-Agent header.  For example, we found  information using the “navigator.userAgent”  JavaScript ( a scripting language works in web pages) call.

Example Of User-Agent Headers

The User-Agent header information changes according to browser. You can look following examples:

 

Browser Name Example of User-Agent
Firefox Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:42.0) Gecko/20100101 Firefox/42.0
Chrome Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36
Opera Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36 OPR/38.0.2220.41
Safari Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1
Internet Explorer Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0)
HTC One Mozilla/5.0 (Linux; Android 6.0; HTC One X10 Build/MRA58K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/61.0.3163.98 Mobile Safari/537.36
Samsung Galaxy S8 Mozilla/5.0 (Linux; Android 7.0; SM-G892A Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/60.0.3112.107 Mobile Safari/537.36
Google Bot Googlebot/2.1 (+http://www.googlebot.com/bot.html)

We can change this value easily.

When we do not change any information, our page will look like the below screenshot. It’s one of authors default user-agent value.

user-agent header default value

user-agent header default value

 

We edited User-Agent header value to following string: “Test/5.0 (Test; Test Test; rv:525252525252.0) Gecko/20100101 Test/52525252525252.0”.  So here is the new user-agent header :

 

user-agent header changed value

user-agent header changed value

 

We did it using a proxy program like Burp Suite. There are lots of extension for the browsers. Keep reading.

Why User-Agent Information Important For Security?

User-Agent header value is so important for security. Can any attackers exploit it if you visit a harmful website? The answer is yes.

If  you visit a malicious website with your browser information (using User-Agent value) it means the attacker has enough information to try exploiting your system. As known there are some exploit kits (harmful code groups) in the wild written in JavaScript (a scripting language works in browsers).  If you send a request (visit) a malicious website, any exploit kits can be run in your browser. But guest what ? They need to know your browser information to exploit your browser. Because every harmful codes target only one browser with specific version.  Here are some vulnerabilities info for different browsers :

  • MS10-002 Microsoft Internet Explorer “Aurora” Memory Corruption (CVE-2010-0249)
  • MS12-063 Microsoft Internet Explorer execCommand Use-After-Free Vulnerability (CVE-2012-4969)
  • Internet Explorer 11 VBScript Engine Memory Corruption (CVE-2016-0189)
  • Google Chrome Vulnerability (CVE-2014-3177)

After attacker know your browser version, he can run harmful javascript codes dedicated to your browser. If you change your browser information (with changing user-agent header value) you add a new layer of security. But don’t forget that : Just changing your user-agent header does not means you are secure !

How Can I Change User-Agent Header Value ?

There is some methods without installing any extension. But using an extension is recommended.

Chrome Extension to Change User-Agent Value

It’s developed by google to help website developer. You can set a new user agent header as you wish. Most installed user-agent switcher extension in the market.

User-Agent Switcher for Chrome offered by google.com : The User-Agent Switcher for Chrome is the answer. With this extension, you can quickly and easily switch between user-agent strings. Also, you can set up specific URLs that you want to spoof every time.

User-Agent Switcher for Chrome

 

 

You can chose predefined headers from top right icon. Easy to use, easy to change user-agent header. Highly recommended. The most popular extension after User-Agent Switcher for Chrome offered by google.com.

User-Agent Switcher for Google Chrome offered by useragentswitcher.org : This extension adds a button to switch between user-agents. Browse with our predefined user-agents or add your own user-agents.

 

User-Agent Switcher for Google Chrome

User-Agent Switcher for Google Chrome

Firefox Extension to Change User-Agent Value

There are two great extension for firefox in the market.

 

Easy to use and predefined User-Agent values. Only cons is the design.

User Agent Switcher by chrispederick : The User Agent Switcher extension adds a menu and a toolbar button to switch the user agent of a browser.

User Agent Switcher for firefox

User Agent Switcher by chrispederick  for firefox

It has great design. You can change user-agent header with icons. Select browser to change it. We really liked this extension.

User-Agent Switcher by Linder: Featured Extension Featured Extension Quickly and easily switch between popular user-agent strings.

User-Agent Switcher by Linder for firefox

 

In safari and edge browsers you should change user-agent header with manually.

 

That’s all. We just wanted to give you some  information about User-Agent header value in terms of security and privacy. With changing user-agent you not only hide your fingerprint but also improve your security while surfing on the web.

Comments on the post