Closed (fixed)
Project:
Bad Behavior
Version:
6.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Task
Assigned:
Reporter:
Created:
3 Apr 2009 at 16:47 UTC
Updated:
20 May 2011 at 23:31 UTC
Jump to comment: Most recent file
Many have tried to explain it before, even myself. But now that two fixes are required to get the module working (and given the blessing this module is for sites targeted by spammers), I'll try to summarize both steps in a simple set of instructions...
bad-behavior-generic.php bad-behavior-wordpress-admin.php index.html
bad-behavior-lifetype.php bad-behavior-wordpress.php README.txt
bad-behavior/ bad-behavior-mediawiki.php COPYING
common_tests.inc.php index.html msie.inc.php safari.inc.php core.inc.php konqueror.inc.php msnbot.inc.php screener.inc.php
banned.inc.php functions.inc.php lynx.inc.php opera.inc.php trackback.inc.php blackhole.inc.php google.inc.php movabletype.inc.php post.inc.php version.inc.php blacklist.inc.php housekeeping.inc.php mozilla.inc.php responses.inc.php whitelist.inc.phpsites/all/modules/badbehavior
sites/all/modules/badbehavior/bad-behaviorremove the line:
'strict' => variable_get('badbehavior_strict_checking_enable', 0),
in its place, add:
'logging' => 1,
'strict' => variable_get('badbehavior_strict_mode_enable', 0),You should be all set and able to see rejected requests and their ip's at "yoursite/admin/reports/badbehavior" (if clean url's are enabled).
In short, the above instructions represent the instructions below at shell level...
cd public_html/sites/all/modules
wget http://ftp.drupal.org/files/projects/badbehavior-6.x-1.0-rc2.tar.gz
tar -zxvf badbehavior-6.x-1.0-rc2.tar.gz
wget http://downloads.wordpress.org/plugin/bad-behavior.2.0.25.zip
unzip bad-behavior.2.0.25.zip
cp -r bad-behavior/* badbehavior
rm -rf bad-behavior
And for the edit of the badbehavior.module file:
pico badbehavior/badbehavior.module
Hope this helps others and saves them time (this is the 3rd time I have to sit down and go through the issues to figure out how to get this wonderful module to run properly).
| Comment | File | Size | Author |
|---|---|---|---|
| #65 | badbehavior_dev_2.1.13_20110427.patch | 2.84 KB | gregarios |
| #56 | badbehavior_dev_2.1.12_20110407.patch | 2.84 KB | gregarios |
| #50 | badbehavior_dev_2.1.11_20110322.patch | 2.84 KB | gregarios |
| #49 | badbehavior_dev_2.1.11_20110225.patch | 2.21 KB | gregarios |
| #44 | badbehavior_dev_2.1.10_20110129.patch | 2.26 KB | gregarios |
Comments
Comment #1
gregarios commentedThese instructions work.
Tested and working in Drupal 6.14 with the bad-behavior.2.0.33.zip download.
Comment #2
gregarios commentedI have a patch that should enable the module, after using the instructions found in this thread, to work with bad-behavior.2.0.33.zip, enabling the new Project Honey Pot (http:BL) functionality.
See this thread for some extra details: http://drupal.org/node/618482
Would someone please test it and report back? This patch is for version 6.x-1.0-rc2. It also incorporates the fix in #3 of the instructions in the first post of this thread.
Update: I can verify that the new
http:BLdoes work very well.Maintainer: Could you put up 5 minutes of your time to roll this into a new 1.0 release? :-)
Comment #3
MrGeek commentedThank you!
I was pulling out my hair after upgrading my D5 to D6 and not seeing anything in my BB logs.. The instructions above work perfectly.
Comment #4
gregarios commentedComment #5
gregarios commentedAttached is a complete compressed tar.gz of the module with version bad-behavior.2.0.33 of Bad Behavior rolled into it, in case anyone needs it all wrapped up. :-)
Comment #6
gregarios commentedMinor non-critical fix to the patch, and a full compressed module patched and ready to go, using bad-behavior.2.0.34.
Comment #7
praseodym commentedWhy not just include bad-behavior code with the module? Sounds like an easier solution to me.
Comment #8
gregarios commentedBecause they are two different maintained works. The Bad Behavior Drupal module can get updated on a different schedule than the Bad Behavior spam script. (They are two different maintainers for two different items)
Comment #9
praseodym commentedSure, but it does make the installation process overly complicated. Why not include a version with the module and have users update it when they want to?
Comment #10
gregarios commentedThe patch in #6 is compatible with bad-behavior 2.0.36.
Word from the author of Bad Behavior script: 2.1 should work with the Drupal module if the new whitelist file is created manually or supported in the database.
I'm afraid a patch doesn't seem to be able to add a whitelist file to the module. Please someone incorporate the patches into the module... and add the new separate whitelist file required by 2.1. My testing of version 2.1.1 yeilded failure to work.
Comment #11
dave reidMarked #618482: PHP Errors From blackhole.inc.php as a duplicate of this issue.
Comment #12
gregarios commentedOk, I've created a new patch, and this thread has been getting so long that I thought I should summarize. Here are the steps to get badbehavior-6.x-1.0-rc2 up and running on your Drupal 6 website, with Bad Behavior 2.1.1:
1) Download Bad Behavior 2.1.1 script-set here: http://www.bad-behavior.ioerror.us/download
2) Download Bad Behavior, the Drupal v6 Module.
3) Unzip the bad-behavior.2.1.1.zip file, which will create a bad-behavior folder.
4) Uncompress the badbehavior-6.x-1.0-rc2.tar.gz file, which will create a badbehavior folder.
5) Download the badbehavior-6.x-1.0-rc2_BB211.patch in this post and place it in the badbehavior folder.
6) Open the bad-behavior folder (which also contains another 'bad-behavior' folder) and delete the README.txt file from it.
7) Copy the entire contents of the bad-behavior folder, which previously contained the README.txt file, including the second 'bad-behavior' folder, into your badbehavior folder.
8) Apply the badbehavior-6.x-1.0-rc2_BB211.patch.
9) Place the badbehavior folder into your Drupal modules directory on your web server, configure and install per Drupal standard practices.
Voila! You can check your Reports --> Status to find out if you have it installed correctly in Drupal. This should get you up and running with Bad Behavior in the 2.1.x versions.
PS: These instructions and patch will not work for the Bad Behavior 2.0.xx series of scripts... only the 2.1.x series should be used with this.
Comment #13
gregarios commentedAttached updated patch makes additions to the README.txt file.
UPDATE: This patch works with Bad Behavior 2.1.2 released on 2010-02-13.
Comment #14
dave reidComment #15
gregarios commentedDave, is there any way to get that last patch applied to this? The maintainer doesn't respond. Do you have access to use my patch, then make the modifications from your patches (http://drupal.org/node/673466 & http://drupal.org/node/664062) into one combined release?
Comment #16
dave reidSince this is still a development version of BadBehavior, I think it makes sense to branch the module into a new version for compatability with BadBehavior 2.1.x.
Comment #17
gregarios commentedI'm all for making it a Bad Behavior 2.0rc1...
I like your improvements in the other patches you did. I barely had the PHP experience to pull off the HttpBL additions and the modifications to make BB2.1.1 work. I'm afraid modifying my patches to include yours is a bit outside by experience level. YOU on the other hand should be able to incorporate my patch with very little effort from the looks of it. :-)
Comment #18
dave reidSetting as postponed until we get the next release and create a new DRUPAL-6--2 branch.
Comment #19
gregarios commentedUPDATE: The patch in #13 works with Bad Behavior 2.1.2 released on 2010-02-13.
Comment #20
dh@tbed.org commentedPlease, maintainers -- make a new release! For the logging patch I was able to manually edit the bb module and re-upload it. But the patch for 2.1 looks too complicated for that approach, and I don't have ssh access to my server account to run the patch in a shell terminal. So please make a new release that rolls all this up... thank you!
Comment #21
gregarios commentedIf you are on a Unix machine or a Mac OSX box, you can patch it right on your machine in a shell access, then upload it to your server.
However, it would be very nice to see a new version out soon. (-;
Comment #22
dh@tbed.org commented@gregarios -- thanks! I was able to do the patch on my Mac (patched versus the last release in 2008) and upload the patched module and bb 2.1.2, but I still get a fatal error at line 22 of the module. I have restored the previous version and will wait for the rollup release, but THANK YOU for pointing out I can do patches locally. I can't believe that never occurred to me.
Comment #23
gregarios commentedDid you patch 6.x-1.0-rc2 and got the line 22 error?
Comment #24
dh@tbed.org commentedyes, or so I intended. should I double check that?
Comment #25
gregarios commented@dhochman: Maybe you could show us the exact error? I've been using the module as patched for a couple months now and it seems to work perfectly...
If needed, I could zip up a patched module and attach it so you could test it from one I know works, so you can determine if it was the patching process gone wrong or your particular setup maybe.
Comment #26
dh@tbed.org commentedThank you, Gregarios -- I would like to accept that kind offer because I can't see what I might have done wrong. Would you please make a post that includes your working patched module as an attachment? I will try it and report back. Thanks in advance.
Comment #27
gregarios commentedAttached is a fully patched Bad Behavior 6.x-1.0-rc2 module with version 2.1.2 of the official scripts included (installed) in it. All you need to do is unzip it and place the resulting folder in your modules directory.
To run it completely like I am, you should go to http://www.projecthoneypot.org/httpbl_configure.php and get a 12 character identification code to enter into the BB settings.
Comment #28
dh@tbed.org commentedThank you, Gregarios! This works perfectly and I'm delighted to again be current with bad behavior's latest and greatest iterations. Obviously my patching skills leave something to be desired. I'm most grateful to you.
I will investigate project honeypot and follow up there.
Comment #29
Carlos Miranda Levy commentedI confirm that unofficial download at #27 works properly.
Comment #30
gregarios commentedThis is a message to confirm that the patch in comment #13 does work with Bad Behavior scripts version 2.1.7 that just came out today.
Maintainer: Any chance of getting this module updated yet?
Comment #31
itserich commentedThank you thank you.
It is lucky to find this thread.
Please let people know how to install the new version on the main page.
Comment #32
gregarios commentedSome changes were needed to this module for compatibility with the new bad behavior 2.1.8 scripts. The full module with the BB 2.1.8 installed in it is attached — just unzip it and drop it in your modules folder, and set the settings.
Dave... any chance of getting a nicely done update for this? (-;
Comment #33
error commentedThanks, gregarios!
I suspect Dave's lost interest, since I haven't seen him participating in these issues in a year or so, but he's been active on other issues.
If I have to take it over myself I will, though just maintaining the core is enough work for a whole team :)
Comment #34
gregarios commentedUpdated complete package attached...
Comment #35
dave reidIt's hard for me to review zip files :)
Comment #36
gregarios commentedDave,
I stopped submitting patches because you said you were going to rewrite the module anyway... so I decided to just take the easy route since it is a dead-end version right now. However, if you decided against rewriting it, and you want a patch from me to put out a new version, let me know and I'll supply it. :-)
Comment #37
gregarios commentedDave: After looking at the extensive changes to your dev version... my patch would probably be moot anyway. IS the dev version a 100% functional version currently, with BB 2.1.9?
Comment #38
mcurry commentedSubscribing.
I'd love to know if BB 2.1.9 or later is supported...
Comment #39
gregarios commented@Michael Curry: Use the complete attachment from comment #34.
Comment #40
mcurry commented@gregarios
What version of the Drupal bad behavior module was that .zip file (from #34) based on? I just diffed it against the -dev version (http://drupal.org/node/674332) and the .module has changed rather dramatically.
Comment #41
gregarios commentedSorry... my "compatible" version is based from 6.x-1.0-rc2.
When Dave responds to comments #36 & #37 we'll know more.
Comment #42
dave reid@gregarios: You're right, my interest in this is very low at the moment. Would you like me to add you as a co-maintainer? It would probably make sense to make a new 2.x branch that works with BB 2.1.x.
Comment #43
gregarios commentedI suppose yes — if nothing but to keep up with the BB 2.1.x maintenance additions. Can you point me to instructions and rules on how to put up new releases? I must tell you I haven't been a maintainer for any Drupal modules yet.
Comment #44
gregarios commentedOk... here it is...
Attached is a patch for the 6.x-1.x-dev version, which brings it into compatibility with BB 2.1.10.
Apply the patch by placing it in a fresh copy of 6.x-1.x-dev and running this from inside the badbehaviour directory:
patch -Rp0 < badbehavior_dev_2.1.10_20110129.patchNOTE: The README.txt file has changed, and it is now a lot less complicated to install the BB scripts — please read it.
DAVE: Please apply this patch, or make some kind of small modification to allow both 2.0.x and 2.1.x versions of the BB scripts to work. (I think it can be done after my changes) Regardless... can you please just make a new release for us from this patch? :-) Please? It is currently running on my production site: www.kpbj.com
(PS: Don't ask me why the patch has the reverse flag in the code... I switched some files, but it works as instructed lol. To read the patch correctly, swap the minuses and pluses.)
Comment #45
LeisureLarry commentedSubscribing
Comment #46
gregarios commentedNOTE: The 6.x-1.x-dev version with the patch from #44 applied still works nicely with BB 2.1.11.
Comment #47
izmeez commentedsubscribing
Comment #48
chawl commentedConfirming #46.
Comment #49
gregarios commentedThe 6.x-1.x-dev (2011-Feb-24) version has had a small update, so I took the opportunity to roll a new patch for it. Please install the attached patch by placing it in the badbehavior folder and running from the command line:
patch -p0 < badbehavior_dev_2.1.11_20110225.patchThis patch includes the new instructions for BB Scripts 2.1.11 installation, so please read the README.txt file.
Dave: Please apply this to make a new 6.x-2.x-dev version at your discretion. Thanks! ;-)
Comment #50
gregarios commentedAttached is a new all-inclusive patch that endows the 6.x-1.x-dev (2011-Feb-24) version of the Bad Behavior Drupal module with BB 2.1.11 script compatibility and fixes a small
PHP notice: undefined indexerror resulting from changes in the core.inc module of the BB scripts.NOTE: This patch includes the new instructions for BB Scripts 2.1.11 installation, so please read the README.txt file.
Dave: Still could use a complete roll-in of this patch into a new version if you have a minute.
Please install this patch from the command line by placing the attached patch file into the "badbehavior" directory of this module and using this command:
patch -p0 < badbehavior_dev_2.1.11_20110322.patchrun from inside the directory.Comment #51
gregarios commentedComment #52
itserich commentedThanks gregarios
I recently ran into problems with the module and would like to update it. I have used command line but rarely, and worry about making an error trying to use it for applying the patch.
I looked and found no similar modules so anything which can be done to make this easier to install is helpful.
Comment #53
gregarios commented@ itserich:
Here are the commands to achieve a complete patched version of the module from the command line of your server:
Then simply follow the instructions in the README.txt file for normal installation.
Comment #54
itserich commentedThanks gregarios. It took me some time to figure out how to navigate to the path, and then I realized it is the same path as appears when navigating in cpanel.
It appeared to be working up to the end, where it stated hunks failed.
Comment #55
gregarios commentedI'm not sure why it would fail on your machine. What OS are you using? I just tried it again on my Mac (in the command-line) and it worked perfectly. I will try it on my FreeBSD machine in a bit and get back to this.
Comment #56
gregarios commentedOk, attached is a new patch (to go along with the new BB 2.1.12) and new patching instructions. You can just follow the instructions below and it shouldn't fail. At least it works on my FreeBSD server and my OSX 10.6.7 machine.
Instructions:
Let me know your results.
Comment #57
gregarios commentedComment #58
itserich commentedThank you, I will try it tomorrow.
I am on a CentOS 5.5, in my vps.
Comment #59
itserich commentedThanks gregarios, this applied well and it seems to be working.
This is the first patch I have applied other than manually so it is great to learn how to do it.
This seems to be a unique module so thank you for the help.
Comment #60
Peter Bowey commentedThanks gregarios, the above patch #56 for the BadBehavior 2.1.12 works fine; [function tested] with both Drupal and Pressflow V6.20.
I was half way through writing / debugging my very own Drupal Module / Core update for using both dnsbls_check() and http_bl_check() --when I discovered I was basically re-inventing / implementing what this BadBehavior 2.1.12 library + drupal module achieves. Through Google searches, I found I was literally duplicating what the 'library' BadBehavior' library was doing, and then more searching found this module utilizing that library (great).
This is a very outstanding module and library; when you [can finally] understand what is actually involved to protect web-servers against 'modern' warfare on any kind of 'user' input; forms, registration, guest comments, feedback, ticket-systems, contact us, etc.
Thanks for your effort and drupal community sharing! Appreciated!
Comment #61
Mr. Sharkey commentedI wonder why the full capabilities of Bad Behavior aren't being utilized? With two small file edits (neither to the core of Drupal), Bad Behavior's Screener feature can be implemented. I'll post more here if there's any interest.
Comment #62
gregarios commentedI'm interested. Show me what code goes where and I'll set up another patch if possible. Thank you.
Comment #63
itserich commentedAs a novice, I think this is a unique module which does not get much attention because the last release date is 3 years ago.
I do not think there is another module which works like Bad Behavior and it should probably be used by many more sites than the Reported Installs indicate. I am lucky to have happened upon it.
Comment #64
gregarios commentedYes. We badly need a new release rolled out of this thread's patch from comment #56. I thought Dave Reid would be the one to do it, but it's not looking like he's got time or something...
Comment #65
gregarios commentedUpdated patch for the newest BB Scripts...
New patch application instructions:
Comment #66
Mr. Sharkey commentedBad Behavior Screener inserts some javascript in the protected page's headers. According to Michael Hampton, the script does the following:
"The JavaScript code which gets inserted basically generates the same information as the cookie, and then dynamically adds it to every form on the page, so that the information gets submitted with the form (if the user has JavaScript enabled). If JS is disabled, the cookie is used instead. If both are disabled, well, there's nothing I can do about that. This code is used to attempt to detect malicious bots which take over a browser, e.g. Internet Explorer, and which otherwise would appear to be IE to the casual observer. Several recent spambots operate in this manner. It's also used to detect when content scraping is in use and the scraped content is passed to another host in a botnet. This is much less common, but it does happen."
Here's how to implement it:
First, you must reinsert the function into the module. This function is contained in bad-behavior-generic.php, but has been removed from badbehavior.module.
I placed this on line 228 of badbehavior.module, just after the function bb2_install() code.
Then, for each theme in use on the Drupal installation, edit themes/(theme name)/page.tpl.php to include a call to the bb2_insert_head() function. This has to be placed such that the resulting javascript code is in the {head} portion of the page. For example, in Garland, I placed it after $scripts:
As such:
Each theme may use slightly different layouts of similar code. I know that the zen theme in my D5.x installation was a bit different, but not by very much.
Comment #67
gregarios commentedRather than needing to modify the theme, would this help:
http://api.drupal.org/api/drupal/includes--common.inc/function/drupal_ad...
Comment #68
Mr. Sharkey commentedmv useless_text /dev/null
Comment #69
itserich commentedThank you gregarios.
I think it installed correctly, at least at patch command it reported no errors.
Is there a quick way to know which version of Bad Behavior is working? I am confused how it works because it seems to update the Drupal module and not the Bad Behavior library. Perhaps the update adds onto the library?
Comment #70
Mr. Sharkey commentedmv useless_text /dev/null
Comment #71
gregarios commented@Mr. Sharkey: If you want to continue on the "new features" idea, could you please start a new thread. This thread is reserved for updates to Bad Behavior that keep it in line with the BB Script 2.1.x series. I think you need to start a "feature request" thread.
Comment #72
Mr. Sharkey commentedNo Problem, Adios.
Comment #73
dave reid@gregarious: I've added you as a co-maintainer. Have at it! I'm no longer actively using badbehavior, so I won't be able to devote a whole lot of time, as has obviously been shown here.
Comment #74
dave reidAll the relevant information you need to clone/commit the repo as a maintainer as well as create releases is on the project's 'Git instruction' tab.
Comment #75
gregarios commentedThanks Dave. I'll see what I can do...
Comment #76
gregarios commentedNew development release is out and can be found here.
Comment #77
mcurry commented@gregarios:
Good news! Thanks for the quick work.
Now, if only we could see the 6.x-2.x-dev release appear on the project home page 'Downloads' section... :D
Comment #78
itserich commentedyes thank you gregarios