2007-08-10, 06:56 AM
I run my own CentOS 5-based web server which powers my website among a couple of others. I have a WordPress blog which attracts quite a lot of comment and more recently trackback spam.
I use the Akismet service, so it rarely ever gets through, but I'm finding from my server logs that I'm getting hit quite frequently by spammers giving it a try, sometimes every few seconds for several minutes at a time. Sitting there tail -f'ing the access_log when they do this and it becomes apparent they're knocking on the door quite frequently. I'd like to be able to implement some solution to block IPs if they attempt to do more than a few trackbacks in a certain amount of time.
I'm running the latest version of Apache 2.2 in the CentOS 5 repositories.
Here's an example from /var/log/httpd/access_log of the kind of thing I mean:
Code:
72.232.150.250 - - [10/Aug/2007:07:26:10 +0100] "POST /blog/2007/01/10/wpget-a-question-to-all-users/trackback/ HTTP/1.0" 302 338 "http://peter.upfold.org.uk/blog/2007/01/10/wpget-a-question-to-all-users/trackback" "TrackBack/1.02"
There are a few factors that might help in determining rules to implement:
- More than a certain number of attempts within a certain time from the same IP (say, 15 in 5 minutes or more)
- User-Agent set to TrackBack/versionnumber
- URL in the form of /blog/year/month/day/string/trackback/ (with or without trailing slash)
- HTTP POST request
Thanks guys in advance. :)