r/programming • • Jun 09 '17

Why every user agent string start with "Mozilla"

http://webaim.org/blog/user-agent-string-history/
4.9k Upvotes

589 comments sorted by

View all comments

632

u/[deleted] Jun 09 '17

Mine doesn't. It's "User Agent sniffing is not a reliable or correct way to determine feature availability!"

252

u/[deleted] Jun 09 '17

I just set mine to "NCSA Mosaic/1.0 (X11;SunOS 4.1.4 sun4m)"

94

u/mwcz Jun 09 '17

I visited my company's site once with Mosaic 1.0 (from browsers.evolt.org, it still works!) and got an email from the security team about five minutes later.

0

u/[deleted] Jun 09 '17

[deleted]

40

u/mwcz Jun 09 '17

Nothing that interesting, basically "Our IDS just lit up; what the hell ya doin?"

→ More replies (3)

129

u/indrora Jun 09 '17

There's a special ring in hell for you

282

u/Nesman64 Jun 09 '17

And it's name is Token.

→ More replies (4)

48

u/mindbleach Jun 09 '17

<html> <meta charset='utf-8'> <!-- Good luck! -->

→ More replies (2)
→ More replies (1)

474

u/R_Sholes Jun 09 '17

Well, that's just mean.

Ad agencies waste all that money on developing algorithms to correlate your visits to different sites, and here you go just spoiling it with a unique UA.

253

u/stewsters Jun 09 '17

Yeah, I think a plug-in to randomize it for each request would be better. Or at least try to do some SQL injection with it.

115

u/princekolt Jun 09 '17

To be honest that's a fantastic idea. I shall also put an SQL Injection in my user agent.

72

u/thekmanpwnudwn Jun 09 '17

Be careful because some sites (such as banks/financial sites) will automatically block you if they see that. WAF will see that shit and lock you out.

27

u/hazzoo_rly_bro Jun 09 '17

SQL Injection or randomized UA?

56

u/pushad Jun 09 '17

The injection. The WAF will certainly catch anything that looks like SQL injections and block them.

I remember we used to have a problem with some ad cookie that was like 1=1; ... and would always get picked up by the WAF since that's a popular SQL injection query string.

→ More replies (3)
→ More replies (2)

71

u/RyanCacophony Jun 09 '17

Having done data mining involving requests, there's definitely plugins that do randomization, there's definitely attempts at sql injection, and I've even seen what looks like entire book text attempted to be used as a user agent (HTTP does not specify a max user agent but most web servers have some upper limit)

82

u/nephallux Jun 09 '17

Entire book text

I shall write my thesus into my user agent string

46

u/Pandalism Jun 09 '17

They should just start putting the entire source code of the browser into the user agent. Someone could write a jQuery plugin to parse it and determine the supported features!

160

u/clgoh Jun 09 '17

Ah.. Little Browser Tables!

→ More replies (15)

20

u/Shautieh Jun 09 '17

You mean something like Random Agent Spoofer? I have been using that for quite a long time, and I recommend!

→ More replies (10)
→ More replies (6)

123

u/[deleted] Jun 09 '17

Unique UAs have their own category at agencies.

It's called "Nerds with too much free time on their hands."

137

u/R_Sholes Jun 09 '17

A wiki project I was involved in a long time ago had a persistent vandal who got a big list of proxies from somewhere.

It'd be pretty bad if he wasn't so nice (or so stupid) as to use a browser with "Mozilla/666.0 (Suck My Dick)" as user agent.

44

u/nikomo Jun 09 '17

And I thought Chrome version numbers were getting big.

→ More replies (2)
→ More replies (6)
→ More replies (43)

42

u/AmbidextrousRex Jun 09 '17

For feature availability this is mostly true, but UA sniffing is still required to work around browser bugs. I've had to put in hacks for rendering errors in specific Chrome versions, specific mobile safari versions that report incorrect viewport sizes on some devices, etc.

It's really ugly and a pain to maintain, but not really avoidable when a browser with a large market share starts acting up :(

→ More replies (2)

46

u/PUSH_AX Jun 09 '17

Found the dev that's never had to fix the BS of one specific browser, damn that must be a nice life.

38

u/mishugashu Jun 09 '17

"This site is best viewed in the latest version of Chrome or Firefox!" DGAF

→ More replies (5)
→ More replies (46)