Script to ban hosts from connecting to your server by searching apache logs for keywords and odd browsers.


#I noticed several entires from a browser script obviously used by hackers.
## Lets block the bastards

for hackerhost in `cat /var/log/httpd/access_log | grep XXSOMEWORDXX | awk '{ print $1 }' | uniq `
do
    `iptables -A INPUT -s $hackerhost -j DROP`

done

Comments

Popular posts from this blog

Find countries in a file's text using regular expressions and Perl

Make links active in Excel 2007