Drupal Bad Behaviour

This blog is no longer being updated. I have MOVED to my new home.

It was nice here, while it lasted, but hopefully a fresh start will make life more interesting elsewhere!
19th August 2005

Comment spam is the bane of many an interactive web site, and I long ago adopted Bad Behavior to limit spam attacks against my WordPress blogs. When setting up a Drupal site, I wanted to carry on using this wonderful utility, but was frustrated trying to get it to work – settling in the end for a nasty bodge.

It soon transpired that the author of Bad Behavior had been waiting for Drupal users that had claimed to use Bad Behavior to forward details, but to no avail.

When I did a recent review of my initial experiences with Drupal, several people said that I should contribute if I wanted to see things change, so here is my first “toe in the water” with the Drupal community – an implementation of Bad Behavior for Drupal.

I started by making the utility work as a Drupal module, then worked out how to use the database abstraction layer to implement logging, and finally (getting carried away) implemented some admin pages to show the logs and log detail. So, this is a fairly complete implementation, ready to roll. Download here.

To install, unpack Bad Behavior from here into a sub-directory of the modules directory and then copy badbehaviour.module into that folder. Turn on the module in admin/modules and tune the settings in admin/settings/badbehavior.

Enjoy the reduction in spam comments.

tags: bad behaviour drupal spam |

  • 1 On Wed, 04/01/2006 - 17:58, J (not verified) said:

    Bad Behavior for Drupal

    The drupal module isnt compatible with the new version of bad behavior, is it?

    //J

  • 2 On Wed, 04/01/2006 - 19:37, David said:

    Not BB2, but all current versions, yes

    Hi J,

    The Drupal module on my download page is compatible with BB 1.2.x and Drupal 4.6.x – there is another version on the Drupal site which supports Drupal 4.7 beta.

    I am not supporting BB2 at this stage, but will be happy to, nearer a formal release of that software. I hope Michael sorts out his PC problems soon.

  • 3 On Mon, 21/08/2006 - 05:47, A Smith (not verified) said:

    Thanks for the spambot killer

    I had drupal running unmaintained for about 10 months. Oops. When I came back my site was no longer functioning it had so many spam comments.

    I was choked. I saved what MySQL tables i could and started over with 4.7.

    But the bots or whatever kept coming back, looking for /?q=trackback/49 etc. or whatever used to be there.

    Now before I put BadBehaviour to work, I had 100 visits per hour from the bad guys, all to non-existent pages.

    In the 10 minutes since I set BB up, its blocked just about as many referers. I had 700 pages of logs in the past 2 weeks of IP to Ban by hand; thank you for getting this running with Drupal and saving me the sisyphus.

    I will donate (i.e. send you Bucks) to support an update to BB2!!! Please consider. Already your work is great.

  • 4 On Fri, 31/03/2006 - 05:18, Arvana (not verified) said:

    I'd be happy to. :-)

    I’d be happy to. :-)

  • 5 On Wed, 13/12/2006 - 20:59, Marc (not verified) said:

    BB2 port being reviewed?

    Hi,

    Just wondering if I can safely use the port Pobster is talking about.

    Thanks for a reply,
    Marc

  • 6 On Fri, 22/09/2006 - 11:05, Pobster (not verified) said:

    BB2 port

    Just wondered if you could review the issues on your Drupal module as there is a BB2 port based on your code there. It works very well, I’ve been using it for a number of weeks now and have recently upgraded to 2.0.6

    Pobster

  • 7 On Fri, 19/08/2005 - 19:55, IO ERROR (not verified) said:

    I'm looking forward to checking this out!

    I’m looking forward to checking this out! Thank you for your contributions!
  • 8 On Fri, 19/08/2005 - 20:16, Bad Behavior 1.2 - IO ERROR (not verified) said:

    [...] Update August 19: Bad Behavior is now available for Drupal

    [...] Update August 19: Bad Behavior is now available for Drupal. [...]

  • 9 On Sun, 28/08/2005 - 03:00, Adding Understanding (not verified) said:

    This is great! I added a menu item for Settings > badbehavior

    This is great! I added a menu item for Settings > badbehavior to access the settings from the standard admin menu. The line of code is posted here.
  • 10 On Sun, 28/08/2005 - 03:16, laura (not verified) said:

    There are two downloads linked in your post. The drupal-badbehav

    There are two downloads linked in your post. The drupal-badbehavior tarball holds a badbehavior.module file that, if I load into our modules directory, crashes the site immediately with a 500 server error.

    I took off white space at the end of the module, and then our site recovered and I could enable module, but then got this:

    Fatal error: badbehavior_init(): Failed opening required '<path_to_module>/bad-behavior-core.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in </path_to_module><path_to_module>/badbehavior.module on line 171</path_to_module>

    Any ideas what is going on? I certainly would love to try this module. Thanks.

  • 11 On Sun, 28/08/2005 - 16:26, Adding Understanding (not verified) said:

    I've experimented further and the line of code I suggested is n

    I’ve experimented further and the line of code I suggested is not necessary. It seems to have been a caching issue with the admin menu. In fact the code I added does nothing that I can discern.

    Laura – I had the same problem. The file badbehavior.module must be inside the bad-behavior folder. So you end up with modules/bad-behavior/badbehavior.module

  • 12 On Wed, 07/09/2005 - 19:26, Lucas Koorneef (not verified) said:

    Thanks a lot for writing a badbehavior module for Drupal. Finall

    Thanks a lot for writing a badbehavior module for Drupal. Finally an end to the countless comment spam attempts. I even disabled anynomous comments because I just couldn’t keep up ! Great ! thanks again.

    I always keep an eye on the CVS logs on www.drupal.org, so if there’s a new version or bug fix I’ll check it out asap.

  • 13 On Wed, 07/09/2005 - 21:11, Christian (not verified) said:

    TNX A LOT!

    TNX A LOT!
    It works great!

  • 14 On Sat, 19/08/2006 - 08:14, Randy (not verified) said:

    it blocks EVERY BODY (even me!)

    well, my install of Badbehavior on Drupal 4.6.5 seems to be a bit over agressive.. It blocks about 99% of my visitors, and even blocked ME until i added myself to the whitelist.

    this is what i get in the logs for virtually everybody that visits my site:

    Header ‘Connection’ contains invalid values
    GET /page-name HTTP/1.1 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */* Accept-Language: en-us Connection: Keep-Alive, close Cookie: PHPSESSID=5d5b1e7a3d74347cc71360158961f605; __utmb=107753300 Host: myhost.com Referer: http://www.google.com/search?hl=en&q=an+interesting+search+term User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)

    So what’s up with that?!

  • 15 On Sat, 19/08/2006 - 09:01, Randy (not verified) said:

    I sort figgerd it out..

    so, by looking at the code i could see that it does not like the “close cookie” so close to the “keep alive”.
    i commented out that section of the code and now people are getting back in the site. but how much will this impact it’s spam-killing abilities?

  • 16 On Thu, 17/11/2005 - 09:18, arvana (not verified) said:

    Just to clarify the installation instructions, for those like me

    Just to clarify the installation instructions, for those like me who have trouble figuring things out:

    1) You have to install BOTH badbehaviour.module (from this site) AND the files from the bad-behaviour site into the SAME modules folder.

    2) As far as I can tell, you don’t have to edit the bad-behaviour-wordpress.php file (or even upload it), as directed in the bad-behaviour installation notes.

    3) and you also don’t need to create a table in your database called bad_behavior_log.

    Please correct me if I’m wrong!

  • 17 On Sat, 19/11/2005 - 09:54, David said:

    Arvana,

    Arvana,

    1. Correct.
    2. Correct.
    3. Correct.

    Perhaps, you can help me write the next README.txt file ;-)

    David

  • 18 On Mon, 29/01/2007 - 12:02, Bad Behavior / Bad Behaviour: Bad Behavior 1.2 (not verified) said:

    [...] Update August 19: Bad

    [...] Update August 19: Bad Behavior is now available for Drupal. [...]

  • 19 On Tue, 29/01/2008 - 14:32, cam balkon (not verified) said:

    Cam balkon

    The drupal module isnt compatible with the new version of bad behavior

  • 20 On Mon, 25/02/2008 - 13:05, Pobster (not verified) said:

    Bad Behavior is now ported

    Bad Behavior is now ported to Drupal 6.x

    http://drupal.org/node/224903

  • 21 On Mon, 25/02/2008 - 13:11, David said:

    Thanks

    Thanks Pobster,

    I’ll have to dust off my old Drupal cvs account details and figure out how to bring it up to date. Sorry for abandoning the project.

    David

  • 22 On Sun, 10/08/2008 - 11:27, war gold (not verified) said:

    Great reccomendation, have

    Great reccomendation, have managed to jury-rig this to work with the latest version of Drupal. Will report on its effectiveness soon.

  • 23 On Fri, 29/08/2008 - 15:38, Diet Wyatt (not verified) said:

    Worked!

    Well it’s about been 3 years and I don’t see any comment spam. Looks like it worked after all, eh?

  • 24 On Fri, 26/09/2008 - 18:43, Layla (not verified) said:

    Dieting and exercising are

    Dieting and exercising are very helpful in establishing a healthy lifestyle. I find that too many people look at losing weight for appearance and not for the health benefits associated with it. It’s quite an odd perspective.

  • 25 On Wed, 15/10/2008 - 04:11, buy isk (not verified) said:

    Thanks for your overview

    I did the renaming of the directory like you stated and the errors stopped for me. Thanks!..... At least I think its working. I dont have anything in the settings area of admin and I have a pretty new web site so I dont know if I’m being hit or not. How do I tell?

    This is about the only post I’ve seen on the net about this Drupal problem. Glad I found it. I was going to give up on it.

    I’m using the new Drupal 4.7 and the Bad-Behaviour 4.7 from here … I believe (I dont remember anymore. I’ve downloaded all kinds of BB all over the internet.)

  • 26 On Fri, 23/01/2009 - 17:25, mpcoc (not verified) said:

    To install, unpack Bad

    To install, unpack Bad Behavior from here into a sub-directory of the modules directory and then copy badbehaviour.module into that folder. Turn on the module in admin/modules and tune the settings in admin/settings/badbehavior.

    mpcoc

  • 27 On Thu, 09/04/2009 - 08:54, eve isk (not verified) said:

    good reccomendation

    good reccomendation, have managed to jury-rig this to work with the latest version of Drupal. Will report on its effectiveness soon.

  • Archive

    User login