-2

I'm trying to analyze my web server logs, and check which users accessed it from a Chrome browser on a desktop computer.

I see the following agent that contain the word Chrome, but also contain words such Safari and Edge:

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/49.0.2623.87 Chrome/49.0.2623.87 Safari/537.36

Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 AOL/9.8 AOLBuild/4346.2019.US Safari/537.36

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

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

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586

Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36

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

Mozilla/5.0 (X11; CrOS x86_64 7834.66.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.111 Safari/537.36

Why is it so confusing and how can I tell which one was really a Chrome?

EDIT: Main question is out of this list - which one is Chrome.

rockyraw
  • 1,095
  • 1
  • 15
  • 29

3 Answers3

0

Most of these are Chrome, but not all.

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/49.0.2623.87 Chrome/49.0.2623.87 Safari/537.36

This is Chromium (built off mostly the same source code as Chrome) running on Linux. It probably makes sense to consider this to be the same as Chrome.

Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 AOL/9.8 AOLBuild/4346.2019.US Safari/537.36

This is AOL Desktop, whose browser is Chromium-based.

Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36
Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36
Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36
Mozilla/5.0 (X11; CrOS x86_64 7834.66.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.111 Safari/537.36

These are Chrome, running on different operating systems (Windows 7, Windows 10, OS X, Windows 8.1, and Chrome OS.)

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586

This is Microsoft Edge (which is not actually based on Chrome, but it probably acts more like Chrome than IE at this point.)

libertyernie
  • 2,312
  • 1
  • 10
  • 11
-1

There is no way to tell from the UserAgent: header if the browser is actually Chrome. It is trivial to write a web bot/spider that outputs whatever UA string you wish.

http://www.user-agents.org/ has a list of common UA strings that map to various browsers that you can use in an associative array to get a best-guess of what the agent /claims/ to be - but there is no way to "prove" it.

To use these, just load them into a map or array structure in your middleware language or log-processing framework, and lookup the right column based on the left input from the UserAgent: header field.

The reason it is confusing is because a browser build consists of many different components (entire project, layout engine, browser codebase, variants, OS components it depends on, distribution-provided value adds, etc, etc) and these namespaces can collide.

BadZen
  • 3,420
  • 1
  • 20
  • 44
  • 1
    also browsers mimic other browsers _on purpose_. – Sergio Tulentsev Nov 09 '16 at 17:27
  • considering that my visitors do not use any spider that faked their UA, which one of the agents will be Chrome? I can't find the agents in the database link you provided, so I didn't find it really helpful. it is just a list of spiders. I'm interested in browsers. – rockyraw Nov 09 '16 at 17:38
  • The site contains "Spiders, Robots, Crawler[s], [and] Browser[s]" just as it claims. There is not a single UA that maps to chrome, but many. If you want to filter the file for all Chrome variants, look for "http://www.google.com/chrome" in the "link" field of the DB. – BadZen Nov 09 '16 at 17:56
  • in future, if I use this script, is it reliable to detect real browser? https://github.com/bestiejs/platform.js – rockyraw Nov 09 '16 at 20:59
-1

Here is some explanation.

So you get the user agent string like follows on Chrome browser.

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

This provides the information like on what platform like Chrome based on Safari build 537.36 and what layout engine is used like Gecko or Trident etc. You can find this information on http://www.useragentstring.com/index.php for different browsers.

Now different browser generate this information in their way. Firefox provide information like

Mozilla/5.0 (Windows NT 10.0; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0

Now how to detect browser correctly, there are number of good information. You can review more information on

How to detect Safari, Chrome, IE, Firefox and Opera browser?

Browser detection in JavaScript?

For c# you can refer to https://msdn.microsoft.com/en-us/library/3yekbd5b.aspx?f=255&MSPPError=-2147217396

Community
  • 1
  • 1
Rohit Chopra
  • 447
  • 1
  • 4
  • 11