Jump to content

Preventing Mass downloads with PHP


fracjidol

Recommended Posts

in a world of proxies and non-static ips.. your ip banning logic will most likely not get rid of the problem, just temporarily stop it.

 

you can detect such a thing though, by having every request point to a landing php file, then that landing file will push out the other file if the request meets the requirements. however, detecting such a thing will be hard because when a user goes to lets say index.php, index.php will count as the first download, then the images inside on index.php will count as other downloads, and according to the log those requests will occur very very close together..

 

you can check for referers and if the second request doesn't carry over a referer value, of a page on your website you can deny the request, but then there is users who will have their browser to not send the referer, then they're gonna get denied all the time..

 

also, if someone is serious about getting all your stuff they'd just set it up via curl and send a referer with every request..

 

this is a hard thing to do :)

Is there a way to detect a mass download attempt of a website

Just block using your .htaccess file

i.e.

# Block WGET attempts
SetEnvIfNoCase User-Agent "^Wget" bad_bot
<Limit GET POST PUT HEAD> 
order allow,deny 
allow from all 
deny from env=bad_bot
</Limit>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.