[RC] PhBad Behave based on Bad Behavior

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Philnate
Registered User
Posts: 10
Joined: Wed Jun 28, 2006 11:37 am

[RC] PhBad Behave based on Bad Behavior

Post by Philnate »

This mod is based on Bad Behavior to protect your forum from spam.
It's working just fine, but the administration of it could need some work.
If you have anything you want to see in it just contact me(best would be somewhere on my site).

Code: Select all

##############################################################
## MOD Title: PhBad Behave
## MOD Author: Philipp Heinze < poophil@yahoo.de > < http://phsoftware.de >
## MOD Description: Adds the famous Bad Behavior to your Forum and locks out
## the spammer already before they can enter your site
##
## MOD Version: .9 BETA
##
## Installation Level: Easy
## Installation Time: 5 Minutes
## Files To Edit: (2)
##				common.php,
##				bad-behavior/bad-behavior-phpbb2.php
##
## Included Files: (24)
##				admin/admin_bb_general.php,
##				INSTALL.mod
##				bad-behavior/bad-behavior-accept.php,
##				bad-behavior/bad-behavior-banned.php,
##				bad-behavior/bad-behavior-blackhole.php,
##				bad-behavior/bad-behavior-core.php,
##				bad-behavior/bad-behavior-database.php,
##				bad-behavior/bad-behavior-functions.php,
##				bad-behavior/bad-behavior-google.php,
##				bad-behavior/bad-behavior-http-headers.php,
##				bad-behavior/bad-behavior-konqueror.php,
##				bad-behavior/bad-behavior-lynx.php,
##				bad-behavior/bad-behavior-movabletype.php,
##				bad-behavior/bad-behavior-mozilla.php,
##				bad-behavior/bad-behavior-msie.php,
##				bad-behavior/bad-behavior-msnbot.php,
##				bad-behavior/bad-behavior-opera.php,
##				bad-behavior/bad-behavior-php4.php,
##				bad-behavior/bad-behavior-phpbb2.php,
##				bad-behavior/bad-behavior-protocol.php,
##				bad-behavior/bad-behavior-referer.php,
##				bad-behavior/bad-behavior-safari.php,
##				bad-behavior/bad-behavior-user-agent.php,
##				bad-behavior/bad-behavior-whitelist.php
##
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
##############################################################
## Author Notes: This Package is based on the Bad Behavior package
## 1.2.4. It's not recommend to manually upload a newer BB version
## please just use the latest Versions of the PhBad Behave, as a newer version
## of BB could break PhBad Behave.
## As soon as a new version of BB is out also PBB will be updated.
## PBB will be updated to work with BB2 as soon as it's released as stable version
## Please just contact me about Problems regarding the implementation of
## Bad Behavior into phpbb2, as I'm not the creator of Bad Behavior
## nor I'm willed to modify anything for it except it's absolutly needed
## for PhBad Behave to work.
## For Problems with Bad Behavior please visit:
## http://www.homelandstupidity.us/software/bad-behavior/
##############################################################
## MOD History:
##
##   2006-06-28 - .9 BETA
##	-first release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
You can grab it here:http://phsoftware.de/index.php/content/view/51/8/

dcz
Registered User
Posts: 787
Joined: Sun Feb 13, 2005 5:37 am
Contact:

Post by dcz »

Very nice idea ;)

phpBB SEO || phpBB3 SEO Premod || SEO phpBB3
GYM Sitemaps & RSS for phpBB3: GYM Sitemaps & RSS

hm2k
Registered User
Posts: 108
Joined: Mon Jun 09, 2003 2:04 pm
Location: UK
Contact:

Post by hm2k »

Does this work then?

User avatar
Ramon Fincken
Registered User
Posts: 4835
Joined: Thu Oct 14, 2004 1:04 am
Location: NL, The Netherlands Amsterdam area @GMT +1
Contact:

Post by Ramon Fincken »

Code: Select all

if (matchCIDR($wp_bb_remote_addr, "66.249.64.0/19") === FALSE) {
   wp_bb_spammer("User-Agent claimed to be Googlebot, claim appears to be false");
}
really?
Dutch quality fully managed WordPress hosting - ManagedWPHosting.nl

Before changing a file, some code or installing a MOD >> Make a backup first!

Do you like my mods? paypal me $1 :) forumsoftware[AT}creativepulses[DOT}nl [/size]
PhpBBantispam.com || Instant find your mod here

hm2k
Registered User
Posts: 108
Joined: Mon Jun 09, 2003 2:04 pm
Location: UK
Contact:

Post by hm2k »

Ramon Fincken wrote:

Code: Select all

if (matchCIDR($wp_bb_remote_addr, "66.249.64.0/19") === FALSE) {
   wp_bb_spammer("User-Agent claimed to be Googlebot, claim appears to be false");
}
really?


Really, I think what its saying is if the visiting CIDR range is in 66.249.64.0/19, then that is a match and therefore TRUE, however if its is FALSE, its a TRUE statement, meaning that the IP range is not a google IP, therefore its not a Googlebot.

They could have perhaps used...

Code: Select all

if (!matchCIDR($wp_bb_remote_addr, "66.249.64.0/19")) {
   wp_bb_spammer("User-Agent claimed to be Googlebot, claim appears to be false");
}

Code: Select all

#-----[ FIND ]------------------------------------------
#Note partial inline match
badbots@ioerror.us
#
#-----[ CHANGE ]------------------------------------------
#NOTE:Set it really to one of your emails as there's the possibilty that innocent
#people get blocked as well!!
email@of.yours
#
In the Install.MOD, what does this mean? I'm assuming I put my email address in there, but I wanted to know why exactly.

Also:

Code: Select all

#Additional Notes: if you want to block some spammer IP you need to add it to
#bad-behavior/bad-behavior-whitelist.php
Why would I add blacklisted IPs to a whitelist? Is this correct?

Philnate
Registered User
Posts: 10
Joined: Wed Jun 28, 2006 11:37 am

Post by Philnate »

You put the Email address there so real people, who got blocked can contact you so you know that innocent got blocked and you therefor can try to fix it.
THe thing with the whitelist was experimental and I just did missuse the whitelist function as blacklist one. It's removed in the latest install.mod file.

amichaels
Registered User
Posts: 1
Joined: Wed Dec 06, 2006 7:10 pm

Post by amichaels »

I'm really a novice at this sort of stuff, but my forums keep getting hammered by bad bots. I need more information on installing the Bad behave mod for PhPBB. There are no actual installation instructions in the INSTALL file. Can anybody help me out and tell me where exactly I should be extracting these folders and whatnot?

Edit: Nevermind. Found the instruction on how to read the instructions...

enderandrew
Registered User
Posts: 71
Joined: Thu Nov 30, 2006 7:55 am
Location: Omaha, NE
Contact:

Post by enderandrew »

How does this specifically stop spammers?

I have a few other mods aimed at stopping spammers and I'm curious if they'll overlap or interfere with each other, or if this is needed for me.
Nihilism makes me smile.

Philnate
Registered User
Posts: 10
Joined: Wed Jun 28, 2006 11:37 am

Post by Philnate »

Sorry for the late reply. Bad Behavior and the on it's based phBad Behave check the http_headers of the visitors/bots and compares them with the http_headers of Spambots. If these headers match the criterias of the spammer headers they get blocked. The blocking takes place at a level where the server havn't done too much already, and therefor the block decrease the amount of bot-spam-traffic to 0.
As the most Spam comes from Bots you can decrease the overall spam also extremely.
So this plugin is really good and can be compared with other spam solutions, without any problems.

But wait with adding it to your site as I will release next week the version 2.0, and the current available version 1.2.6 isn't any more supported.

I use phBad Behave within my own forum and it does block nearly 100% of the Spam.

DreAdeDcoRpSE
Registered User
Posts: 196
Joined: Fri Dec 22, 2006 3:43 am

Post by DreAdeDcoRpSE »

seems interisting, very good idea, what versions of phpBB has this been tested on. I am just woundering, I just recentally upgraded to version 2.0.21 from 2.0.18. I just wanted to know what versions this has been tested on. Well cant waite till the updated version comes out, I like to give it a try.

DreAdeDcoRpSE
Registered User
Posts: 196
Joined: Fri Dec 22, 2006 3:43 am

Post by DreAdeDcoRpSE »

oups, got posted twice.

Philnate
Registered User
Posts: 10
Joined: Wed Jun 28, 2006 11:37 am

Post by Philnate »

It works for sure for 2.0.18+ as I use it for my own board. As this isn't a mod which has too much to do with phpbb, it just needs to be called within it, there shouldn't be much of a problem with it for any earlier version nor with any future version.

Philnate
Registered User
Posts: 10
Joined: Wed Jun 28, 2006 11:37 am

Post by Philnate »

I just uploaded the latest BETA of phBad Behave 2. Currently there's no admin panel for it build in as well as the install.mod file could need some work. But the most important thing is that it will block spam which it does.
You can grab the beta here, feel free to report any problems.

dkinzer
Registered User
Posts: 21
Joined: Mon Sep 05, 2005 3:20 am
Location: Portland, OR

Post by dkinzer »

I ran into two problems when installing this. Firstly, there is a missing 'global' declaration in bb2_install:

Code: Select all

#
#
#-----[ OPEN ]------------------------------------------
#
bad-behavior-phpbb2.php
#-----[ FIND ]------------------------------------------
#
 function bb2_install() {
#
#-----[ AFTER, ADD ]------------------------------------------
#
	global $settings;
Secondly, I believe that the pathname to include bad-behavior-phpbb2.php is incorrect. In the INSTALL.mod file, the change to common.php is given as

Code: Select all

include_once(''bad-behavior/bad-behavior-phpbb2.php');
when it should be:

Code: Select all

include_once(''bad-behavior-phpbb2.php');
This assumes, of course, that that file is put in the phpBB directory and not down on level in ./bad-behavior. Even if you put it there instead, you still get errors.

Moreover, the directions in INSTALL.mod suggest that it should be in the lower directory, so it is consistent but wrong, I think.
Don Kinzer
ZBasic Microcontrollers
http://www.zbasic.net

RevJim
Registered User
Posts: 20
Joined: Mon May 15, 2006 9:27 pm

Post by RevJim »

Just for clarification, does this mod record logs somewhere? How do you know if it's working or not?

I installed it but I've had a couple of spams get through, so maybe I did something wrong... I've tweaked the script with dkinzer's changes and it didn't seem to improve anything, so any suggestions are appreciated.

-RJ

Post Reply

Return to “[2.0.x] MODs in Development”