another clumsy hack

Posted by paul on August 09, 2008

Seeing a lot of junk that looks spammy, so this is a first cut at denying them whatever they are looking for.

#!/usr/local/bin/bash
cat /usr/local/www/data-dist/.htaccess.base > /usr/local/www/data-dist/.htaccess.tmp
grep "Successfully fetched" /var/log/httpd/httpd-error.log | awk '{ print $8 }' | cut -d"." -f1,2,3 | >> /usr/local/www/data-dist/.htaccess.dyn
sort -n /usr/local/www/data-dist/.htaccess.dyn | uniq | awk '{ print "Deny from "$1"." }' >> /usr/local/www/data-dist/.htaccess.tmp
cp /usr/local/www/data-dist/.htaccess.tmp /usr/local/www/data-dist/.htaccess
Trackbacks

Trackbacks are closed.

Comments

Leave a response

Comments

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="">

Comments: