Live data from Hacker News

Ask HN: What do people use to prevent crawlers?

news.ycombinator.com

11–20 of 123 posts

Re: Ask HN: What do people use to prevent crawlers?

#11
post #9

The other day I've made a Chrome extension for scrapping a protected website. It worked wonderfully, as it simulated a normal user session, bypassing the JavaScript protections the website has. You can also run such scripts with a headless browser for full automation, PhantomJS being an obvious choice. You really can't protect against this unless you start making the experience of regular visitors much worse.

But your crawler must be very slow then.

Re: Ask HN: What do people use to prevent crawlers?

#14
post #11
post #9

The other day I've made a Chrome extension for scrapping a protected website. It worked wonderfully, as it simulated a normal user session, bypassing the JavaScript protections the website has. You can also run such scripts with a headless browser for full automation, PhantomJS being an obvious choice. You really can't protect against this unless you start making the experience of regular visitors much worse.

But your crawler must be very slow then.

They generally are fairly slow but it doesn't matter because you just set it and leave it to it until it has all the data you want, leaving you to get on with other things.

Re: Ask HN: What do people use to prevent crawlers?

#15
post #14
post #11

Earlier quoted context omitted.

But your crawler must be very slow then.

They generally are fairly slow but it doesn't matter because you just set it and leave it to it until it has all the data you want, leaving you to get on with other things.

Plus very easy to parallelize

Re: Ask HN: What do people use to prevent crawlers?

#17
I run a cronjob every 5 minutes that parses httpd access log. If there's an IP with abnormally large request number, it blocks it.

Most crawlers will make hundreds of requests in five minutes, while legitimate viewers will make be bellow 100.

Re: Ask HN: What do people use to prevent crawlers?

#18
We've used Incapsula (cheap and works, but awful support and service) and Distil (expensive and works, great support but steep pricing).

Both worked, both worked well with http downloads and selenium (and common techniques). Neither worked against someone dedicated enough - but there are the usual tricks for bypassing them (which we used, to test our own stuff).

We also developed something in-house, but that never helps.

Re: Ask HN: What do people use to prevent crawlers?

#19
post #9

The other day I've made a Chrome extension for scrapping a protected website. It worked wonderfully, as it simulated a normal user session, bypassing the JavaScript protections the website has. You can also run such scripts with a headless browser for full automation, PhantomJS being an obvious choice. You really can't protect against this unless you start making the experience of regular visitors much worse.

Sure you can protect against this - there are several companies that use machine learning to spot small differences between selenium and real users (mouse delays etc).

For example, it might detect that a mouse click is dispatched at exact intervals (and block it). To which you'd think "I'll just add Math.random() * 2000" which it'll easily detect as well.

It's _definitely_ doable, but it's not as trivial as recording a selenium macro. (Not to mention these tools look for selenium presence and extensions anyway).

Re: Ask HN: What do people use to prevent crawlers?

#20
post #17

I run a cronjob every 5 minutes that parses httpd access log. If there's an IP with abnormally large request number, it blocks it. Most crawlers will make hundreds of requests in five minutes, while legitimate viewers will make be bellow 100.

If an attacker uses something like Illuminati (or just abuses Tor or another botnet) then they can (and should) distribute HTTP requests across different IPs.

This is pretty cheap to do and I've seen it done before in several places I've worked (on the defending side).

Post reply on HN