views:

3399

answers:

6

Is there a good, up-to-date listing anywhere that maps User-Agent HTTP Header strings --> operating systems?

+2  A: 

Here's a quick list... let me know if I missed one you are interested in.

// Match user agent string with operating systems
Windows 3.11 => Win16,
Windows 95 => (Windows 95)|(Win95)|(Windows_95),
Windows 98 => (Windows 98)|(Win98),
Windows 2000 => (Windows NT 5.0)|(Windows 2000),
Windows XP => (Windows NT 5.1)|(Windows XP),
Windows Server 2003 => (Windows NT 5.2),
Windows Vista => (Windows NT 6.0),
Windows 7 => (Windows NT 7.0),
Windows NT 4.0 => (Windows NT 4.0)|(WinNT4.0)|(WinNT)|(Windows NT),
Windows ME => Windows ME,
Open BSD => OpenBSD,
Sun OS => SunOS,
Linux => (Linux)|(X11),
Mac OS => (Mac_PowerPC)|(Macintosh),
QNX => QNX,
BeOS => BeOS,
OS/2 => OS/2,
Search Bot=>(nuhk)|(Googlebot)|(Yammybot)|(Openbot)|(Slurp)|(MSNBot)|(Ask Jeeves/Teoma)|(ia_archiver)

Nescio
I have windows 2004 running, and the string contains "Windows 5.2", not "Windows NT 5.2".
Frank Schwieterman
should be: Windows 7 => (Windows NT 6.1)
ByteNirvana
+2  A: 

Below link lists famous Operating systems which can be detected from user agents. http://www.geekpedia.com/code47_Detect-operating-system-from-user-agent-string.html

The below link lists common useragents. http://www.seehowitruns.net/index.php?report=1&action=view_report&x=2&y=10

Ramesh
+1  A: 

It's worth keeping in mind that the user agent header can easily be faked. I wouldn't rely on it for anything important.

Sherm Pendley
Yes, that's a good point.
C. Dragon 76
You can't use it as a security check, but otherwise its fine. Very rarely will a user tweak their user-agent string, and if they do I don't mind if my software fails for them.
Frank Schwieterman
"and if they do I don't mind if my software fails for them": So _you're_ the one!
Anonymous
+5  A: 

What language are you developing in? That makes a huge difference in what is available to you if you want to do data-mining on the user agent string.

Nescio's response provides a good list. The second link under PHP in my list also contains basically the same information which is simple enough that you should be able to translate it to any language.

Dan Herbert
Very useful links. Thanks! I'm using ASP.NET and hadn't noticed HttpBrowserCapabilities. That certainly helps.
C. Dragon 76
A: 

It's nearly always a bad idea to do UA sniffing. You can't rely on it at all.

If you want to sent the client a response specific to its environment you should perhaps distinguish differences from content-type or encoding. These are rock-solid specified.

mkoeller
+1  A: 

The User Agent from the browser is not something I would rely on for anything, We all use it for statistics, but we know they're not 100% accurate.

I use firefox and regularly spoof IE for some sites that don't like it, my regular UA is:

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.3) 
Gecko/2008101315 Ubuntu/8.10 (intrepid) Firefox/3.0.3

I sometimes use a firefox extension to change it to:

Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; MS-RTC LM 8; 
.NET CLR 2.0.50727; .NET CLR 1.1.4322)

when you are looking at it, you would need to parse the different parts, the OS is the third part of the semicolon-delimited values between brackets.

Osama ALASSIRY