Spoofing the User Agent with Safari or Firefox
Tags: access_log,
apache,
awstats,
firefox,
safari,
statistics,
user agent
Posted 20. December 2006.
If you're a web designer or administrator and frequently have to access your own web pages, it is useful to hide your own requests from the web server's statistics generated by a tool like Awstats. For dial-up users it is common practice to ignore a subnet's IP range like this:
# ...
SkipHosts="REGEX[^123\.456\.]
However, if you are like me and you are with a popular ISP, this would not only filter out your own requests, but also a whole lot of other people's visits. It would be much more accurate to fingerprint your exact computer. The easiest way is through a genuine custom user agent string from your browser. I will first show you how to do this in Safari:
Safari: A genuine custom user agent string
Tools like Saft or Safari Enhancer will only let you choose from predefined browser strings like Mozilla or MSIE. It is not a good idea to filter by common browser names. This will do the magic:
Quit Safari before you type that command and restart afterwards. Note: The escaped quotes are necessary! Check if it works for you by looking at your servers log files. It worked for me with Mac OS X 10.4.8 and Safari 2.0.4. Copy your old user agent string from your servers log and append some genuine characters at the end that no other user agent would use, i.e. 'itsme'.
Firefox
With Firefox, changing the user agent string is just to easy. In the address bar, enter about:config. Type useragent into the Filter field, then double click on the general.useragent.extra.firefox key and add your genuine string to it.

In one last step, tell Awstats to ignore requests from that user agent to filter your computer from your Awstats statistics:
# ...
SkipUserAgents="REGEX[itsme$]"
You can now safely browse your web pages with whatever computer you have configured to be filtered, no matter of what IP address you have.
Subscribe to this Feed
Social bookmark
Comments [8]
Commenting is closed for this article.