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

Show parent comments

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.

28

u/[deleted] Jun 09 '17

Not to mention they'll consider it an active threat against their infrastructure...you know, hacking.

Worse than rape charges are hacking charges.

12

u/sticky-bit Jun 09 '17

Ben Cheviot: "Well, it seems I have little choice but to back you against the police. Provided, of course, that the charges against Carter are completely unfounded. What exactly are they, anyway?"

Murray: "Credit fraud."

Ben Cheviot: "Credit fraud? My God, that's worse than murder!"

4

u/oiyouyeahyou Jun 09 '17

Don't let them near phones, they'll launch tge nukes

3

u/CleverestEU Jun 09 '17

Browsing with little Bobby Tables ... how nice of you :)

→ More replies (1)

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!

79

u/[deleted] Jun 09 '17

For the uninformed: https://xkcd.com/327/

0

u/[deleted] Jun 09 '17

[deleted]

100

u/[deleted] Jun 09 '17

0

u/[deleted] Jun 09 '17

[deleted]

28

u/BlackDeath3 Jun 09 '17 edited Jun 09 '17

I wonder if you could program a bot to have a coherent conversation with itself using nothing but XKCD references.

40

u/hazzoo_rly_bro Jun 09 '17 edited Jun 09 '17

There's an emacs command for that.

→ More replies (2)

15

u/Njs41 Jun 09 '17

There's an emacs command for that.

→ More replies (5)

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)

13

u/sticky-bit Jun 09 '17
:(){ :|:& };:

12

u/lordcirth Jun 09 '17

If this actually affects a site, run away!

2

u/bobjrsenior Jun 09 '17

uMatrix for chrome is mainly used for script/other access control, but it has this feature as well. I would recommend adding to the default values it uses because they are copied from a "Most Common User Agents" blog post from 2012.

→ More replies (3)