News for hackers. Stuff that matters.
Re:Company withdrawing from Facebook as analytics show 80% o... by dredmorbius on Monday July 30, 2012 @03:38PM (#4314243)
We've found that identifying sources of traffic and patterns of usage is superior to simple user-agent detection, particularly as, since you've noted, user-agent spoofing is trivial, and/or some bot traffic is driven through user-based tools (say, script-driven MSIE bots).

Instead of that, we'll watch for patterns of use in which high volumes of traffic come from unrecognized non-end-user network space.

"Unrecognized" means that it's not one of your usual search vendors: Google, Yahoo, Bing, Baidu, Yandex, Bender, AddThis, Facebook, etc.

"Non-end-user network space" means a netblock which is clearly not a residential or commercial/business networking provider.

For this you'll mostly want to eyeball, though when we saw very high volumes of search coming at us from ovh.net (a French low-cost hosting provider), it was pretty obvious what the problem was.

Using an IP to ASN/CIDR lookup (such as the Routeviews project: http://www.routeviews.org/) and a local ASN -> name lookup. One source of this is http://bgp.potaroo.net/cidr/autnums.html

Re:Company withdrawing from Facebook as analytics show 80% o... by rscale on Monday July 30, 2012 @04:24PM (#4314492)
One as-yet-unmentioned technique is to adjust a bot score by taking an OS fingerprint, and comparing that to the listed user agent.

It's not perfect for a variety of reasons, but I found it to be a useful input for a similar bot detection problem. That said, this was a long time ago so I'd need to re-run some experiments to see if the hypothesis remained valid.

For those not familiar with OS fingerprinting, it's a method of looking at the details of a connection and determining which operating system is most likely to have created packets with those options and flags. In BSD, it's built into pf.

Re:Company withdrawing from Facebook as analytics show 80% o... by tripzilch on Monday July 30, 2012 @07:01PM (#4315147)
On the packet level ... hm that's pretty clever, definitely not trivial to fake, either.

Just that if your bot runs from, say, Windows 7 and it spoofs an IE8 user-agent header, or even runs by directly automating IE itself, how do you detect it then? Both of those scenarios are not unlikely at all.

Re:Company withdrawing from Facebook as analytics show 80% o... by rscale on Monday July 30, 2012 @08:34PM (#4315451)
If the bot spoofs a user-agent that is viable for the OS, then you need to rely on other signals. It only works as a component of a defense in depth strategy.
Re:Company withdrawing from Facebook as analytics show 80% o... by dredmorbius on Monday July 30, 2012 @05:42PM (#4314838)
Interesting. Any Linux equivalents or Java classes which offer similar capabilities (we're using a Java-based application server / webserver).
Re:Company withdrawing from Facebook as analytics show 80% o... by biot on Monday July 30, 2012 @07:01PM (#4315149)
It works off of checking the SYN packet [0], which happens at the transport layer [1]. Once it gets to the application layer the information is not available unless the transport layer stores the information and provides a method to query a given connection.

[0] http://www.openbsd.org/faq/pf/filter.html#osfp

[1] http://en.wikipedia.org/wiki/OSI_model

Re:Company withdrawing from Facebook as analytics show 80% o... by dredmorbius on Monday July 30, 2012 @07:48PM (#4315295)
I suspected something like this, but was hoping enough of the signature might survive for a daemon (or Java class acting as one) to take a peek.
Re:Company withdrawing from Facebook as analytics show 80% o... by rscale on Monday July 30, 2012 @06:54PM (#4315124)
The linux equivalent is p0f (http://freecode.com/projects/p0f)

I can't speak to Java classes, but they'd need to be dealing with raw packets which isn't an option in a typical stack.