Peter's Blog

Redefining the Impossible

Comment spam


My site is being really hammerred by comment spammers today but not one has got through thanks to my policy of refusing to allow comments containing urls to be submitted (not even for moderation: I moderate all comments, I found deleting comment spam to be tedious as well as annoying).

It is a simple hack to the drupal comment module but it is very effective. Ok, I could get spam without url's in but what's the point, apart from vandalism? They still go into the moderation queue and get deleted.

And when people do want to post url's they soon figure out how to get around the block. If they cannot do that then their comments are probably not worth consideration anyway.

I'd give the details of the hack here but it gives the spammers a clue. If you are interested then email me.

Update: following on from the vast surge in comment spam attempts (three or four a minute, 24/7), statcounter tells me people are searching for drupal captchas. I have given up on these, something about drupal states, redirects, session management or whatever stops them working reliably. The spam comment check is just part of the comment validation, there is nothing much that can go wrong with it, it is just straight if/then/else code.

In a way the spam check is a captcha (Completely Automated Public Turing Test to Tell Computers and Humans Apart), you can still get through if you show some smarts. It doesn't use graphics so it doesn't look cool and it doesn't shut out blind people.

The comment spam is coming from a range of ip addresses, maybe an array of compromised pc's (thanks Microsoft). Each 'failure' page is using some of my 10G/month bandwidth. I'll have to keep an eye out and see what kind of impact this is having. It could be even worse than inktomi slurps bots doing 100M of crawling a month and not directing anyone here through their search results.


Filed under: captcha drupal spam

Marco Says:

over 2 years ago

Yes!

Its so bloody annoying! By the way your page rates pretty high up on drupal comment spam search!

I'm ginving the "spam" module a try to see if it averts some of this spam that is coming through lately.

Dankesehr Says:

over 2 years ago

Hi, interesting article about the anti-comment spam fix, can you please tell me how it is done?

Dankesehr

Peter Says:

over 2 years ago

I have emailed you.

Peter

Cero Spam Says:

over 2 years ago

Hi, we are testing a new free form-protection service (cerospam.com.ar), for blogs and for any kind of web site. It is easy to setup each form with this system, and it is very useful for protecting comment forms from spammers. It is based on captcha method. Until now it seems to work fine. No matter what kind of blog software you are using, this is not a plugin. Please, test it and do not hesitate to send us your comments! Thank you.

Peter Says:

over 2 years ago

All the best with the business but I just belatedly reviewed five weeks worth of comments and not one was spam, despite almost constant spamming attempts. I am happy with my comment spam defences.

Peter

Bert Says:

over 2 years ago

Hi Peter,

I'm in the same situation as you were: despite using Drupal's comment spam module, some still slip through and it's a pain in the southern region to have to manually delete the spam each day. So I'm interested in a fix.

OTOH another approach to thwart the robots apparently is to add a simple 1+1=? sum in the submission process. My php skills are non-existant, but maybe you can include it in your fix?

Peter Says:

over 2 years ago

So far after however many months I haven't had a single comment spam. I am still on drupal 4.6, I haven't upgraded to 4.7 as I don't have time to fix whatever it breaks (custom theme, wilki module etc) so I am not sure if you would be interested in my code.

Peter

Ted Says:

over 2 years ago

Hi Peter, been doing something similar with the blog script I'm writing in Perl. Wouldn't mind finding out what you've used. Mine does an image thing (which I won't go into here), but blind folks wouldn't see it. I've eliminated email altogether on mine (which could prove a pain for some). URL's the same as my email

Peter Says:

over 2 years ago

I just hacked the Drupal php scripts to look for http, www etc. It's not a big deal. I have got one or two spam recently but probably submitted by humans. Once they see that comments are moderated they give up.

Peter

Have Your Say

I welcome constructive comments or questions but I reserve the right to delete any comments that displease me.

Who are you?

(Optional) If you enter an email address here I might email you back. Your email address will not be sold to spammers or shown anywhere

What do you have to say?