fracjidol Posted February 3, 2010 Share Posted February 3, 2010 Hello Is there a way to detect a mass download attempt of a website using php. I need this in php becouse i would like to write a script to ban IPs the attempts come from. Thanks for your help. Quote Link to comment https://forums.phpfreaks.com/topic/190814-preventing-mass-downloads-with-php/ Share on other sites More sharing options...
RussellReal Posted February 4, 2010 Share Posted February 4, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/190814-preventing-mass-downloads-with-php/#findComment-1006481 Share on other sites More sharing options...
fracjidol Posted February 4, 2010 Author Share Posted February 4, 2010 Ok i know if someone with advanced knowledge would like to do it, they could. But is there a not to complicated solution to prevent an average user that doesnt have advanced knowledge and uses some free program or something simillar? Thanx Quote Link to comment https://forums.phpfreaks.com/topic/190814-preventing-mass-downloads-with-php/#findComment-1006856 Share on other sites More sharing options...
JonnoTheDev Posted February 4, 2010 Share Posted February 4, 2010 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> Quote Link to comment https://forums.phpfreaks.com/topic/190814-preventing-mass-downloads-with-php/#findComment-1006875 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.