[RC1] Spam-bot Surprise!

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.
User avatar
Dog Cow
Registered User
Posts: 2486
Joined: Fri Jan 28, 2005 12:14 am
Contact:

[RC1] Spam-bot Surprise!

Post by Dog Cow » Fri Oct 06, 2006 7:27 pm

Spam-bot Surprise 1.0.1 MOD by Dog Cow

== INTRO & DESCRIPTION ==
This modification attempts to stop automatic scripts (bots) from both posting messages and registering accounts at your forum. Spam-bot Surprise will not stop human spammers from manually posting messages or registering user accounts on your forum.

This is done by taking the current IP address of the user and encoding it via one of three different formulas, selectable via Admin CP -> General Admin -> Configuration -> Spam-bot Surprise.

Additionally, you may also change the URL variable name, some examples:

www.mysite.com/forum/posting.php?f=1&check=e83hal12
http://www.mysite.com/forum/posting.php ... p=e83hal12
http://www.mysite.com/forum/posting.php ... s=e83hal12

This process is 99% invisible to legitimate, human users of your forum. It requires no extra thought or interaction by human users. It only shows itself in the posting and registration URLs.

The process and implementation behind Spam-bot Surprise MOD is my own original idea, except for the function sbs_txt2bin, which was borrowed from the User gag MOD by Swizec and modified slightly.

== INSTALLATION, COMPATIBILITY, & SUPPORT ==

Spam-bot Surprise has been tested on phpBB versions 2.0.10, 2.0.14, 2.0.21, and 2.0.22. Spam-bot Surprise will also install with Nuttzy's EasyMOD.

If you find Spam-bot Surprise useful in preventing spam on your forum, please consider visiting my web site at http://www.macgui.com
(You can get tech-support there, too!)

== Download ==

It's not yet validated, but you can download it here: http://dserver.macgui.com/Spambot_Surprise_1_0_1.zip
Last edited by Dog Cow on Sat Jan 27, 2007 4:35 pm, edited 6 times in total.
Moof!
Mac GUI Vault: Retro Apple II & Macintosh computing archive.
Inside Allerton bookMac GUIMac 512K Blog

User avatar
EXreaction
Former Team Member
Posts: 5666
Joined: Sun Aug 21, 2005 9:31 pm
Location: Wisconsin, U.S.
Name: Nathan

Post by EXreaction » Sat Oct 07, 2006 3:37 am

If your ignoring registered users wouldn't this code work instead?

Code: Select all

//
// Flood control
//
if ($userdata['user_id'] == ANONYMOUS)
{
	$sql = "SELECT MAX(post_time) AS last_post_time
		FROM " . POSTS_TABLE . "
		WHERE poster_ip = '$user_ip'";
	$result = $db->sql_query($sql)
	$row = $db->sql_fetchrow($result))

	if ( (intval($row['last_post_time']) > 0) && ( ($current_time - intval($row['last_post_time'])) < intval($board_config['flood_interval']) ) )
	{
		message_die(GENERAL_MESSAGE, $lang['Flood_Error']);
	}
}
I have not tested it or tried your mod at all yet(plus I am wiped from working 9 hours) so it probably won't work...but it might give you ideas if anything... :)

User avatar
Dog Cow
Registered User
Posts: 2486
Joined: Fri Jan 28, 2005 12:14 am
Contact:

Post by Dog Cow » Mon Oct 09, 2006 11:18 pm

And I still want my registered users to have their shorter flood limit too
Moof!
Mac GUI Vault: Retro Apple II & Macintosh computing archive.
Inside Allerton bookMac GUIMac 512K Blog

User avatar
EXreaction
Former Team Member
Posts: 5666
Joined: Sun Aug 21, 2005 9:31 pm
Location: Wisconsin, U.S.
Name: Nathan

Post by EXreaction » Wed Oct 11, 2006 2:19 am

Dog Cow wrote: And I still want my registered users to have their shorter flood limit too


It doesn't affect regular users at all...just guest posts... :wink:

User avatar
Dog Cow
Registered User
Posts: 2486
Joined: Fri Jan 28, 2005 12:14 am
Contact:

Post by Dog Cow » Wed Dec 27, 2006 4:44 pm

v1.0.1 has just been finished!

I will upload it here for those who want to try it out before it has been submitted and validated

(link in the first post)
Last edited by Dog Cow on Sat Jan 27, 2007 4:34 pm, edited 1 time in total.
Moof!
Mac GUI Vault: Retro Apple II & Macintosh computing archive.
Inside Allerton bookMac GUIMac 512K Blog

TPFKAS
Registered User
Posts: 87
Joined: Thu Nov 18, 2004 10:59 pm

Post by TPFKAS » Sat Jan 27, 2007 11:35 am

Does this mod conflict with the Anti Spambot ACP mod?

User avatar
Dog Cow
Registered User
Posts: 2486
Joined: Fri Jan 28, 2005 12:14 am
Contact:

Post by Dog Cow » Sat Jan 27, 2007 4:33 pm

TPFKAS wrote: Does this mod conflict with the Anti Spambot ACP mod?


I have no idea.

I would assume NO, since Spam-bot Surpruise uses a completely different method.
Moof!
Mac GUI Vault: Retro Apple II & Macintosh computing archive.
Inside Allerton bookMac GUIMac 512K Blog

TPFKAS
Registered User
Posts: 87
Joined: Thu Nov 18, 2004 10:59 pm

Post by TPFKAS » Mon Jan 29, 2007 10:11 am

I found this snippet in version 1.0.1 for admin/admin_board.php

Code: Select all

#
#-----[ FIND ]------------------------------------------
#
$activation_none = ( $new['require_activation'] == USER_ACTIVATION_NONE ) ? "checked=\\"checked\\"" : "";
$activation_user = ( $new['require_activation'] == USER_ACTIVATION_SELF ) ? "checked=\\"checked\\"" : "";
$activation_admin = ( $new['require_activation'] == USER_ACTIVATION_ADMIN ) ? "checked=\\"checked\\"" : "";
#
#-----[ AFTER, ADD ]------------------------------------------
#

// Spam-bot Surprise 1.0.1
$sbs_formula_1 = ( $new['sbs_formula'] == SBS_FORMULA_IP ) ? "checked=\\"checked\\"" : "";
$sbs_formula_2 = ( $new['sbs_formula'] == SBS_FORMULA_ENCODEDIP ) ? "checked=\\"checked\\"" : "";
$sbs_formula_3 = ( $new['sbs_formula'] == SBS_FORMULA_COMBO ) ? "checked=\\"checked\\"" : "";
I couldn't find the original lines and then found that there are backslashes too many compared with my original code.

Shouldn't it be like this?

Code: Select all

#
#-----[ FIND ]------------------------------------------
#
$activation_none = ( $new['require_activation'] == USER_ACTIVATION_NONE ) ? "checked=\"checked\"" : "";
$activation_user = ( $new['require_activation'] == USER_ACTIVATION_SELF ) ? "checked=\"checked\"" : "";
$activation_admin = ( $new['require_activation'] == USER_ACTIVATION_ADMIN ) ? "checked=\"checked\"" : "";
#
#-----[ AFTER, ADD ]------------------------------------------
#

// Spam-bot Surprise 1.0.1
$sbs_formula_1 = ( $new['sbs_formula'] == SBS_FORMULA_IP ) ? "checked=\"checked\"" : "";
$sbs_formula_2 = ( $new['sbs_formula'] == SBS_FORMULA_ENCODEDIP ) ? "checked=\"checked\"" : "";
$sbs_formula_3 = ( $new['sbs_formula'] == SBS_FORMULA_COMBO ) ? "checked=\"checked\"" : "";
Or should the double \\ be there in the replacement code? I left one out but found that in the configuration menu the "check variable name" becomes "check". I guess this is not right....

EDIT: I tried with double \\, but then I get a syntax error...

User avatar
Dog Cow
Registered User
Posts: 2486
Joined: Fri Jan 28, 2005 12:14 am
Contact:

Post by Dog Cow » Mon Jan 29, 2007 10:11 pm

That, I think, was an issue with my text editor. (which I shall have to correct, obviously!)
Moof!
Mac GUI Vault: Retro Apple II & Macintosh computing archive.
Inside Allerton bookMac GUIMac 512K Blog

TPFKAS
Registered User
Posts: 87
Joined: Thu Nov 18, 2004 10:59 pm

Post by TPFKAS » Thu Feb 01, 2007 6:33 pm

I have this mod installed for 5 days or so now, but it doesn't seem to be doing anything.
I also have the Anti-spam ACP mod installed for a a month or so and it catches a couple of spambots every day but there are bots that don't fill in any of the hidden fields so they get passed that mod. I was hoping that this mod would catch the ones that get through , but unfortunately I see no decrease in the amount of spambots. Is there a way I can see if it is installed correctly or determine how many bots have been stopped? Can I test it somehow?

User avatar
Dog Cow
Registered User
Posts: 2486
Joined: Fri Jan 28, 2005 12:14 am
Contact:

Post by Dog Cow » Thu Feb 01, 2007 10:26 pm

Even I don't know if it works, sorry! I have no practical means of testing it, no sort of logging system, etcetera.

Keep in mind: you may be getting more posts from human spammers than from bots.

Otherwise, I can't make any guarantees that this MODification does work efficiently.

If it makes things any better, I use it on my site and I've only gotten one spam post this year, so far.
Moof!
Mac GUI Vault: Retro Apple II & Macintosh computing archive.
Inside Allerton bookMac GUIMac 512K Blog

TPFKAS
Registered User
Posts: 87
Joined: Thu Nov 18, 2004 10:59 pm

Post by TPFKAS » Fri Feb 02, 2007 9:16 pm

Mmm, thanks for your effort Dog Cow, but I give up on this mod for now. Keep up working against these darn bots....

User avatar
Dog Cow
Registered User
Posts: 2486
Joined: Fri Jan 28, 2005 12:14 am
Contact:

Post by Dog Cow » Fri Feb 02, 2007 10:02 pm

Quite alright! I can't expect everyone to be successful with it! :)
Moof!
Mac GUI Vault: Retro Apple II & Macintosh computing archive.
Inside Allerton bookMac GUIMac 512K Blog

User avatar
el loquillo
Registered User
Posts: 49
Joined: Sun Aug 21, 2005 3:40 pm
Location: Bronx, New York

Re: [RC1] Spam-bot Surprise!

Post by el loquillo » Thu Jun 05, 2008 4:00 pm

i install it and when i go to the admin panel i get this error:

Parse error: syntax error, unexpected T_STRING in /hermes/bosweb/web034/b346/ipw.ondalowc/public_html/forum/admin/admin_board.php on line 131
Dominican Republic!!!----->>>>Platano Power

User avatar
el loquillo
Registered User
Posts: 49
Joined: Sun Aug 21, 2005 3:40 pm
Location: Bronx, New York

Re: [RC1] Spam-bot Surprise!

Post by el loquillo » Thu Jun 05, 2008 7:18 pm

el loquillo wrote:i install it and when i go to the admin panel i get this error:

Parse error: syntax error, unexpected T_STRING in /hermes/bosweb/web034/b346/ipw.ondalowc/public_html/forum/admin/admin_board.php on line 131

Never mind i read up n i got it. but now when i update configuration it gives me this error:


Failed to update general configuration for 'sbs_check' ,'check'

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sbs_check' ,'check''' at line 3

UPDATE phpbb_config SET config_value = '''sbs_formula'' ,''1''' WHERE config_name = ''sbs_check' ,'check''

Line : 88
File : admin_board.php
Dominican Republic!!!----->>>>Platano Power

Post Reply

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

Who is online

Users browsing this forum: No registered users and 10 guests