Forum Moderators: DixonJones
I've been playing around with useragent string lately, because it seems to be the way of detecting user's browser/OS... but it can be very unreliable, as these can be changed very easily with modern web browsers.
But if you look at web sites like www.mozilla.com/firefox, it seems like they are not using the useragent string for OS detection! Today I have modify my useragent string to a non-existing OS and browser, and mozilla.com is still be to detect my real OS!
So I am wondering how did they do that? Is there some other techniques for OS detection? They are not using OS fingerprinting are they?
Thanks.
As for cookies, I used several laptops that has not been to firefox's website... so I think it is irrelevant.
Yes browser capabilities can be used to determinate the browser... but what about the OS? I ran Firefox on different OS's and the mozilla firefox home page can still detect the real OS reliably.
have you tried spoofing the user agent AND turning off javascript?
As for cookies, I used several laptops that has not been to firefox's website... so I think it is irrelevant.
// Borrowed from addons.mozilla.org - thanks :)var PLATFORM_OTHER = 0;
var PLATFORM_WINDOWS = 1;
var PLATFORM_LINUX = 2;
var PLATFORM_MACOSX = 3;
var PLATFORM_MAC = 4;// Default to windows
var gPlatform = PLATFORM_WINDOWS;if (navigator.platform.indexOf("Win32") != -1)
gPlatform = PLATFORM_WINDOWS;
else if (navigator.platform.indexOf("Linux") != -1)
gPlatform = PLATFORM_LINUX;
else if (navigator.userAgent.indexOf("Mac OS X") != -1)
gPlatform = PLATFORM_MACOSX;
else if (navigator.userAgent.indexOf("MSIE 5.2") != -1)
gPlatform = PLATFORM_MACOSX;
else if (navigator.platform.indexOf("Mac") != -1)
gPlatform = PLATFORM_MAC;
else
gPlatform = PLATFORM_OTHER;
On the same front you have browser detection. I've seen most sites, even google, using basic detection that can be spoofed easily by simply changing the user-agent. In fact there are alternative methods to better detect the type of browser. So far, the code I use hasn't reported false positives (100% reliable for FF, IE, Op). I'm sure a solid method can also be devised for OS detection.