[2.0.19] Easy BotStopper

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Post Reply

Rating:

Excellent!
44
65%
Very Good
9
13%
Good
8
12%
Fair
2
3%
Poor
5
7%
 
Total votes: 68

khsjr1970
Registered User
Posts: 242
Joined: Fri Aug 19, 2005 5:59 pm

Post by khsjr1970 »

@ PC Categories Heirarchy solves this problem, by removing any fields not necessary for registration from the signup.

Doesnt stop a human from spamming, but nothing does, or will.

ie only username password and email are needed to sign up for a forum, all other fields need to be entered AFTER login occurs, which mechanical spambots don't do.

I also know of a SPAM BOTS MOD on this board maybe , maybe in the dev area, its written by echovirus.
HPB
Registered User
Posts: 6
Joined: Wed Apr 19, 2006 8:40 pm

Post by HPB »

PCTalk
Here's the code I was telling you about for cutting out the IM's and Website. If anyone sees anything wrong, don't be afraid to let me know.

Of course, to use easymod, you will have to use a header on the code. It does install with easymod.

Code: Select all


#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php

#
#-----[ FIND ]------------------------------------------
#
$unhtml_specialchars_match = array('#>#', '#<#', '#"#', '#&#');
$unhtml_specialchars_replace = array('>', '<', '"', '&');
								
#
#-----[ AFTER, ADD ]------------------------------------------
#

//-----BEGIN Botstopper
	if ( $mode == 'editprofile' )
	{
		$template->assign_block_vars('only_show_notbot', array());
	}
//-----END Botstopper

#
#-----[ FIND ]------------------------------------------
#
			if ( !($row = $db->sql_fetchrow($result)) )
			{
				message_die(GENERAL_ERROR, 'Could not obtain next user_id information', '', __LINE__, __FILE__, $sql);
			}
			$user_id = $row['total'] + 1;
								
#
#-----[ AFTER, ADD ]------------------------------------------
#

//------BEGIN BOTSTOPPER
			if(  $icq!= '' || $aim != '' || $msn != '' || $yim != '' || $website != '')
			{ 
			die(); 
			}
//------END BOTSTOPPER


#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_add_body.tpl

#
#----[ FIND ]------------------------------------------
#
	<tr> 
	  <td class="row1"><span class="gen">{L_ICQ_NUMBER}:</span></td>

#
#----[ BEFORE, ADD]------------------------------------------
#
	<!-- BEGIN only_show_notbot -->

#
#----[ FIND ]------------------------------------------
#
		<input type="text" name="icq" class="post" style="width: 100px"  size="10" maxlength="15" value="{ICQ}" />
	  </td>
	</tr>

#
#----[ AFTER, ADD]------------------------------------------
#
	<!-- END only_show_notbot -->

#
#----[ FIND ]------------------------------------------
#
	<tr> 
	  <td class="row1"><span class="gen">{L_AIM}:</span></td>

#
#----[ BEFORE, ADD]------------------------------------------
#
	<!-- BEGIN only_show_notbot -->

#
#----[ FIND ]------------------------------------------
#
		<input type="text" class="post" style="width: 150px"  name="aim" size="20" maxlength="255" value="{AIM}" />
	  </td>
	</tr>

#
#----[ AFTER, ADD]------------------------------------------
#
	<!-- END only_show_notbot -->

#
#----[ FIND ]------------------------------------------
#
	<tr> 
	  <td class="row1"><span class="gen">{L_MESSENGER}:</span></td>

#
#----[ BEFORE, ADD]------------------------------------------
#
	<!-- BEGIN only_show_notbot -->

#
#----[ FIND ]------------------------------------------
#
		<input type="text" class="post" style="width: 150px"  name="msn" size="20" maxlength="255" value="{MSN}" />
	  </td>
	</tr>

#
#----[ AFTER, ADD]------------------------------------------
#
	<!-- END only_show_notbot -->

#
#----[ FIND ]------------------------------------------
#
	<tr> 
	  <td class="row1"><span class="gen">{L_YAHOO}:</span></td>

#
#----[ BEFORE, ADD]------------------------------------------
#
	<!-- BEGIN only_show_notbot -->

#
#----[ FIND ]------------------------------------------
#
		<input type="text" class="post" style="width: 150px"  name="yim" size="20" maxlength="255" value="{YIM}" />
	  </td>
	</tr>

#
#----[ AFTER, ADD]------------------------------------------
#
	<!-- END only_show_notbot -->

#
#----[ FIND ]------------------------------------------
#
	<tr> 
	  <td class="row1"><span class="gen">{L_WEBSITE}:</span></td>

#
#----[ BEFORE, ADD]------------------------------------------
#
	<!-- BEGIN only_show_notbot -->

#
#----[ FIND ]------------------------------------------
#
		<input type="text" class="post" style="width: 200px"  name="website" size="25" maxlength="255" value="{WEBSITE}" />
	  </td>
	</tr>

#
#----[ AFTER, ADD]------------------------------------------
#
	<!-- END only_show_notbot -->

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Until the day when God shall deign to reveal the future to man, all human wisdom is summed up in these two words,--'Wait and hope'.
Alexandre Dumas, The Count of Monte Cristo
PCTalk
Registered User
Posts: 259
Joined: Mon Jul 29, 2002 5:17 pm
Location: MD, USA
Contact:

Post by PCTalk »

Thanks, I will be adding the code soon. I'm tired of $pamBots. :evil:
Visit PCTalk.info to see my teaching website.
Wildtangent has closed their forum. See my member created substitute at Wildtangent Fansite.
Support Request Template - Knowledge Base
PCTalk
Registered User
Posts: 259
Joined: Mon Jul 29, 2002 5:17 pm
Location: MD, USA
Contact:

Post by PCTalk »

OK, successfully installed into v2.0.21 along with some additional "subtractions", and now the Profile Information section is almost totally empty. :D

I've been getting at lest one Bot registration a day and, so far, I haven't seen any.
Visit PCTalk.info to see my teaching website.
Wildtangent has closed their forum. See my member created substitute at Wildtangent Fansite.
Support Request Template - Knowledge Base
HPB
Registered User
Posts: 6
Joined: Wed Apr 19, 2006 8:40 pm

Post by HPB »

PCTalk wrote: OK, successfully installed into v2.0.21 along with some additional "subtractions", and now the Profile Information section is almost totally empty. :D

I've been getting at lest one Bot registration a day and, so far, I haven't seen any.


I just thought about this now, but you can remove the entire section including the "Profile Information" header part by using this code. It does reduce the lines of code to be inserted by 16 rather than doing each column individually.

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php

#
#-----[ FIND ]------------------------------------------
#
$unhtml_specialchars_match = array('#>#', '#<#', '#"#', '#&#');
$unhtml_specialchars_replace = array('>', '<', '"', '&');
								
#
#-----[ AFTER, ADD ]------------------------------------------
#

//-----BEGIN BotStopper
	if ( $mode == 'editprofile' )
	{
		$template->assign_block_vars('only_show_notbot', array());
	}
//-----END BotStopper

#
#-----[ FIND ]------------------------------------------
#
			if ( !($row = $db->sql_fetchrow($result)) )
			{
				message_die(GENERAL_ERROR, 'Could not obtain next user_id information', '', __LINE__, __FILE__, $sql);
			}
			$user_id = $row['total'] + 1;
								
#
#-----[ AFTER, ADD ]------------------------------------------
#

//------BEGIN BotStopper
			if(  $icq!= '' || $aim != '' || $msn != '' || $yim != '' || $website != '' || $location != '' || $occupation != '' || $interests != '' || $signature != '') 
			{ 
			die(); 
			} 
//------END BotStopper


#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_add_body.tpl

#
#----[ FIND ]------------------------------------------
#
	<tr> 
	  <td class="catSides" colspan="2" height="28">&nbsp;</td>

#
#----[ BEFORE, ADD]------------------------------------------
#
	<!-- BEGIN only_show_notbot -->

#
#----[ FIND ]------------------------------------------
#
		<textarea name="signature" style="width: 300px" rows="6" cols="30" class="post">{SIGNATURE}</textarea>
	  </td>
	</tr>

#
#----[ AFTER, ADD]------------------------------------------
#
	<!-- END only_show_notbot -->


#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
I did steal a little code from PCTalk. thanks for that, and sorry it's a little late.
Until the day when God shall deign to reveal the future to man, all human wisdom is summed up in these two words,--'Wait and hope'.
Alexandre Dumas, The Count of Monte Cristo
PCTalk
Registered User
Posts: 259
Joined: Mon Jul 29, 2002 5:17 pm
Location: MD, USA
Contact:

Post by PCTalk »

I realized the Begin/End pairs weren't necessarily needed around each section, or at all, but placed them anyway as I may decide to open one or more up for human input.

When I talk to people about joining, I tell them to let me know where they heard about us from and why they are joining. Where better to put that than in the Signature line? I remove it before I accept them, though, so it doesn't show later.
Visit PCTalk.info to see my teaching website.
Wildtangent has closed their forum. See my member created substitute at Wildtangent Fansite.
Support Request Template - Knowledge Base
PCTalk
Registered User
Posts: 259
Joined: Mon Jul 29, 2002 5:17 pm
Location: MD, USA
Contact:

Post by PCTalk »

HPB wrote: ... I did steal a little code from PCTalk. Thanks for that, and sorry it's a little late.


Nothing stolen if it's freely offered and I wouldn't have thought to add the rest if you hadn't freely given the original. :D

[Added]
Oops! 8O

Sorry, I didn't mean to make a separate post there. Any Mod please feel free to combine my two posts. :oops:
Visit PCTalk.info to see my teaching website.
Wildtangent has closed their forum. See my member created substitute at Wildtangent Fansite.
Support Request Template - Knowledge Base
tameb0y
Registered User
Posts: 1
Joined: Wed Jun 28, 2006 8:47 am

Post by tameb0y »

kulinar wrote: It would be nice if the IPs of all spammers (bots) are recorded in order to ban them.


try this: http://www.phpbb.com/phpBB/viewtopic.php?t=281477
dotca
Registered User
Posts: 1
Joined: Sat Apr 15, 2006 11:34 am
Contact:

Post by dotca »

Thanks!

First mods that I really needed.

10/10

Image
Image
wonko the sane
Registered User
Posts: 234
Joined: Fri Nov 07, 2003 6:54 pm
Location: London, U.K.
Contact:

Post by wonko the sane »

Thanks, this is great.

Just another thing phpbb should have built in really.
agaddini
Registered User
Posts: 2
Joined: Sun Jul 09, 2006 1:45 am
Location: Rome, Italy

Post by agaddini »

I would really need to install this mod, but in my usercp_register.php file I cannot find the first string sequence:

#
#-----[ FIND ]------------------------------------------
#
$unhtml_specialchars_match = array('#>#', '#<#', '#"#', '#&#');
$unhtml_specialchars_replace = array('>', '<', '"', '&');

My phpBB has been updated to version 2.0.19, and works perfectly (apart from bots...). The usercp_register.php file shows as ID:

* $Id: usercp_register.php,v 1.20 2002/04/03 23:24:59 psotfx Exp $

Did I miss something? Thank you very much for your help.
PCTalk
Registered User
Posts: 259
Joined: Mon Jul 29, 2002 5:17 pm
Location: MD, USA
Contact:

Post by PCTalk »

Try searching for only the string:

$unhtml_specialchars_match

and compare it to what you are supposed to look for. You probably have some Mods installed that have changed the strings.
Visit PCTalk.info to see my teaching website.
Wildtangent has closed their forum. See my member created substitute at Wildtangent Fansite.
Support Request Template - Knowledge Base
agaddini
Registered User
Posts: 2
Joined: Sun Jul 09, 2006 1:45 am
Location: Rome, Italy

Post by agaddini »

Nope. It looks as though my usercp_register.php file is different, and I dont't remember having installed any Mod at all. The only thing that have been installed were all the patches from version 2.0.0 to 2.0.19 (quite a few...). Could it be that usercp_register.php remains unchanged in the process? Can I dare swapping the usercp_register.php file with a "fresh" 2.0.19 one?

The point is I cannot find the two variables beginnning with $unhtml_specialchars_, or nothing that looks like the array being assigned (for instance, searchin "quot" finds nothing).

I realize my problem is somewhat tedious, and I will greatly appreciate your support if possible. I remain strongly convinced that your Mod should be definitely integrated in the next phpBB version.

So, thank you anyway.
PCTalk
Registered User
Posts: 259
Joined: Mon Jul 29, 2002 5:17 pm
Location: MD, USA
Contact:

Post by PCTalk »

agaddini wrote: Nope. It looks as though my usercp_register.php file is different, ...

I just looked at the patch file for the update from 2.0.18_to_2.0.19 and found the lines right at the beginning of the file.

Code: Select all

/*

	This code has been modified from its original form by psoTFX @ phpbb.com
	Changes introduce the back-ported phpBB 2.2 visual confirmation code. 

	NOTE: Anyone using the modified code contained within this script MUST include
	a relevant message such as this in usercp_register.php ... failure to do so 
	will affect a breach of Section 2a of the GPL and our copyright

	png visual confirmation system : (c) phpBB Group, 2003 : All Rights Reserved

*/

if ( !defined('IN_PHPBB') )
{
	die("Hacking attempt");
	exit;
}

$unhtml_specialchars_match = array('#>#', '#<#', '#"#', '#&#');
$unhtml_specialchars_replace = array('>', '<', '"', '&');
I have a feeling that, if you've been hand patching files since 2.0.0 that you must have left something out and it might be a good time to just make a clean install of 2.0.20 and reinstall only those mods you feel most important.
Visit PCTalk.info to see my teaching website.
Wildtangent has closed their forum. See my member created substitute at Wildtangent Fansite.
Support Request Template - Knowledge Base
WaterTiger
Registered User
Posts: 44
Joined: Mon Mar 06, 2006 1:52 am
Location: Aussie
Contact:

Post by WaterTiger »

hello,

kinda new to all the mods etc, but i did what was required with this mod, no errors, when i registered a new name i could still see the website field and i put a web addy in and it registered me, i checked in the members list and it does not show the url for the new user i created, is this how its meant to work? (hope so lol)

so i guess i will end up with alot of new users just not spam url's?

cheers

this forum is so helpful once you get your head around all the options :)
Post Reply

Return to “[2.0.x] MOD Database Releases”