Forum Moderators: phranque

Message Too Old, No Replies

Autoban IPs after bad requests

         

ahmedtheking

12:35 pm on Mar 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've been having a look at my logs, and I get a lot of hacks coming through trying to get to web mail and so on. Is there a script that auto bans IPs for, say, a few days, after a load of 404s?

jdMorgan

4:01 pm on Mar 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could adapt either of the following two scripts:

key_master's script [webmasterworld.com] (PERL) uses invisible 'trap' links seeded into your pages pointing to resources which are disallowed by robots.txt. If a bad bot ignores robots.txt, then it follows those links. The result is that the script is activated, which adds the offending bot's IP address to a denied-IP list in .htaccess. WebmasterWorld member stapel and I have added enhancements to this script.

xlcus' script [webmasterworld.com] (PHP) blocks access based on the speed of requests. It's good for catching scrapers and site downloaders. Again, once the trap is sprung, the offender's IP address is added to a denied-IP list in .htaccess. WebmasterWorld member AlexK contributed enhancements to this script.

In both cases, the threads cited above are the last in a series of threads. You may want to do a search to find the earlier threads to see discussion about the development of the scripts.

Jim