| :: |
| Author |
Message |
Ralf Night
Joined: 15 Mar 2007 Posts: 10
|
Posted: Fri Mar 16, 2007 12:58 pm Post subject: Antispam |
|
|
Dear users! I need a anti-spam mod for phpBB! Like in this forum! Maybe this mod (i mean great code) is public for all? Please help me  |
|
|
| Back to top |
|
 |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 15129
|
|
| Back to top |
|
 |
noworyz PR0

Joined: 08 Jan 2007 Posts: 87
|
Posted: Fri Mar 16, 2007 2:54 pm Post subject: Re: Antispam |
|
|
here is the humanizer mod that I have customized for my own use and it has been amazing. Almost a year and not ONE spam registration.
In the following file, there is a variable called "customvariable". Change all the references of this variable to something you choose (anything you want such as "yoursitenameregister" or something like that).
There is a newer version of the original mod but I didn't work for me and I started receiving spam registrations again so I modified this mod a little and it has worked perfect.
Let me know if it is not ok to post this code here, Chris
| Code: | ##############################################################
## MOD Title: The humanizer
## MOD Author: Underhill < webmaster@underhill.de > (N/A) http://www.underhill.de/
## MOD Description: Changes the register form to prevent spam bots by a simple way
## MOD Version: 1.0.3
##
## Installation Level: easy
## Installation Time: 5 minutes
## Files To Edit:
## includes/usercp_register.php
## templates/subSilver/profile_add_body.tpl
## language/lang_english/lang_main.php
## Included Files: N/A
## 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 modification was built for use with the phpBB template "subSilver"
##
## Tip: Change the name of the attribute to confuse spam bots
## Tips-Download: http://www.underhill.de/downloads/phpbb2mods/thehumanizertips.txt
##
## Screenshot: http://www.underhill.de/downloads/phpbb2mods/thehumanizer.png
## Download: http://www.underhill.de/downloads/phpbb2mods/thehumanizer.txt
##############################################################
## MOD History:
##
## 2006-04-29 - Version 1.0.3
## - MOD Syntax changes for the phpBB MOD Database
##
## 2006-04-19 - Version 1.0.2
## - Fixed bug with mode=editprofile (Markus Wandel and fanrpg)
## - Fixed some little problems with spelling and usability
##
## 2006-04-18 - Version 1.0.1
## - MOD Syntax changes for the phpBB.de MOD Database
##
## 2006-04-17 - Version 1.0.0
## - Final-Version
## - Successfully tested with EasyMOD beta (0.3.0)
##
## 2006-04-14 - Version 0.0.1
## - BETA-Version
## - Built and successfully tested with phpBB 2.0.20
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------------------------------
#
includes/usercp_register.php
#
#-----[ FIND ]------------------------------------------------------------------
#
validate_optional_fields(
#
#-----[ AFTER, ADD ]------------------------------------------------------------
#
// The humanizer MOD
$customvariable = ( isset($HTTP_POST_VARS['customvariable']) ) ? ( ($HTTP_POST_VARS['customvariable']) ? TRUE : 0 ) : 0;
#
#-----[ FIND ]------------------------------------------------------------------
#
if ($board_config['enable_confirm'] && $mode == 'register')
#
#-----[ BEFORE, ADD ]-----------------------------------------------------------
#
// The humanizer MOD
if (!$customvariable && $mode == 'register')
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Are_u_human_wrong'];
}
#
#-----[ FIND ]------------------------------------------------------------------
#
if ( ($mode == 'register') || ($board_config['allow_namechange']) )
#
#-----[ BEFORE, ADD ]-----------------------------------------------------------
#
// The humanizer MOD
if ( $mode == 'register' )
{
$template->assign_block_vars('switch_register', array());
}
#
#-----[ FIND ]------------------------------------------------------------------
#
'SIGNATURE' => str_replace('<br />', "\n", $signature),
#
#-----[ AFTER, ADD ]------------------------------------------------------------
#
// The humanizer MOD
'ARE_U_HUMAN_YES' => ( $customvariable ) ? 'checked="checked"' : '',
'ARE_U_HUMAN_NO' => ( !$customvariable ) ? 'checked="checked"' : '',
#
#-----[ FIND ]------------------------------------------------------------------
#
'L_EMAIL_ADDRESS' => $lang['Email_address'],
#
#-----[ AFTER, ADD ]------------------------------------------------------------
#
// The humanizer MOD
'L_ARE_U_HUMAN' => $lang['Are_u_human'],
'L_ARE_U_HUMAN_EXPLAIN' => $lang['Are_u_human_explain'],
#
#-----[ OPEN ]------------------------------------------------------------------
#
templates/subSilver/profile_add_body.tpl
#
#-----[ FIND ]------------------------------------------------------------------
#
<!-- END switch_confirm -->
#
#-----[ AFTER, ADD ]------------------------------------------------------------
#
<!-- The humanizer MOD -->
<!-- BEGIN switch_register -->
<tr>
<td class="row1"><span class="gen">{L_ARE_U_HUMAN} *</span><br /><span class="gensmall">{L_ARE_U_HUMAN_EXPLAIN}</span></td>
<td class="row2">
<input type="radio" name="customvariable" value="1" {ARE_U_HUMAN_YES} />
<span class="gen">{L_YES}</span>
<input type="radio" name="customvariablecustomvariable" value="0" {ARE_U_HUMAN_NO} />
<span class="gen">{L_NO}</span></td>
</tr>
<!-- END switch_register -->
#
#-----[ OPEN ]------------------------------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]-----------------------------------------------------------
#
// The humanizer MOD
$lang['Are_u_human'] = 'Are you human?';
$lang['Are_u_human_explain'] = 'Sorry but this stupid question shall keep away the bots from this forum...';
$lang['Are_u_human_wrong'] = 'Sorry, but the "humanizer" question must be answerd.';
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------------------------
#
# EoM |
|
|
|
| Back to top |
|
 |
Ralf Night
Joined: 15 Mar 2007 Posts: 10
|
Posted: Fri Mar 16, 2007 3:04 pm Post subject: Re: Antispam |
|
|
Thank you so much! You rocks!!! |
|
|
| Back to top |
|
 |
Ľubor PR0

Joined: 13 Feb 2007 Posts: 52 Location: Slovakia,Bratislava
|
Posted: Sun Mar 18, 2007 12:25 pm Post subject: Re: Antispam |
|
|
SecuriForms
| Code: | ##############################################################
## MOD Title: Securiforms - spam protection
## MOD Author: XShady (xshady[@]itzone[.]sk)
## MOD Description: Protects posting forumlar against automatic robots
## MOD Version: 1.01
## Compatibility: 2.0.11 - 2.0.22
##
## Installation Level: Easy
## Installation Time: 5 Minutes
## Files To Edit: (3)
## includes/functions.php
## posting.php
## templates/subSilver/posting_body.tpl
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ SQL ]------------------------------------------
#
INSERT INTO phpbb_config( config_name, config_value )
VALUES (
'sf_salt', MD5( RAND( ) )
);
#
#-----[ OPEN ]------------------------------------------
#
includes/functions.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Securiforms implementation by XShady
function get_secure_name($original_name)
{
global $board_config, $SID;
return sha1(md5($original_name) . $SID . $board_config['sf_salt']);
}
#
#-----[ OPEN ]------------------------------------------
#
posting.php
#
#-----[ FIND ]------------------------------------------
#
$message = ( !empty($HTTP_POST_VARS['message']) ) ? $HTTP_POST_VARS['message'] : '';
#
#-----[ REPLACE WITH ]------------------------------------------
#
$message = ( !empty($HTTP_POST_VARS[get_secure_name('message')]) ) ? $HTTP_POST_VARS[get_secure_name('message')] : '';
#
#-----[ FIND ]------------------------------------------
#
$message = ( !empty($HTTP_POST_VARS['message']) ) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['message']))) : '';
#
#-----[ REPLACE WITH ]------------------------------------------
#
$message = ( !empty($HTTP_POST_VARS[get_secure_name('message')]) ) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS[get_secure_name('message')]))) : '';
#
#-----[ FIND ]------------------------------------------
#
'SMILIES_STATUS' => $smilies_status,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'MESSAGE_FORM_NAME' => get_secure_name('message'),
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/posting_body.tpl
#
#-----[ FIND ]------------------------------------------
#
if (document.post.message.value.length < 2) {
#
#-----[ REPLACE WITH ]------------------------------------------
#
if (document.getElementById("message").value.length < 2) {
#
#-----[ FIND ]------------------------------------------
#
function emoticon(text) {
var txtarea = document.post.message;
#
#-----[ REPLACE WITH ]------------------------------------------
#
function emoticon(text) {
var txtarea = document.getElementById("message");
#
#-----[ FIND ]------------------------------------------
#
function bbfontstyle(bbopen, bbclose) {
var txtarea = document.post.message;
#
#-----[ REPLACE WITH ]------------------------------------------
#
function bbfontstyle(bbopen, bbclose) {
var txtarea = document.getElementById("message");
#
#-----[ FIND ]------------------------------------------
#
function bbstyle(bbnumber) {
var txtarea = document.post.message;
#
#-----[ REPLACE WITH ]------------------------------------------
#
function bbstyle(bbnumber) {
var txtarea = document.getElementById("message");
#
#-----[ FIND ]------------------------------------------
#
<textarea name="message" rows="15" cols="35" wrap="virtual" style="width:450px" tabindex="3" class="post" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{MESSAGE}</textarea>
#
#-----[ IN-LINE FIND ]------------------------------------------
#
name="message"
#
#-----[ REPLACE WITH ]------------------------------------------
#
name="{MESSAGE_FORM_NAME}" id="message"
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM |
Slovak ANTISPAM mod |
|
|
| Back to top |
|
 |
Ralf Night
Joined: 15 Mar 2007 Posts: 10
|
Posted: Sun Mar 18, 2007 4:04 pm Post subject: Re: Antispam |
|
|
| what this mod do? |
|
|
| Back to top |
|
 |
HB phpBB SEO Team

Joined: 16 Oct 2006 Posts: 812
|
Posted: Sun Mar 18, 2007 4:17 pm Post subject: Re: Antispam |
|
|
There's a couple variants of this mod on phpBB. The key is this change:
| Code: | #
#-----[ IN-LINE FIND ]------------------------------------------
#
name="message"
#
#-----[ REPLACE WITH ]------------------------------------------
#
name="{MESSAGE_FORM_NAME}" id="message" |
The assumption is that bot spammers are directly calling posting.php without reading the submit form. With this mod, a unique key is included in the form and tested:
| Code: | #
#-----[ FIND ]------------------------------------------
#
$message = ( !empty($HTTP_POST_VARS['message']) ) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['message']))) : '';
#
#-----[ REPLACE WITH ]------------------------------------------
#
$message = ( !empty($HTTP_POST_VARS[get_secure_name('message')]) ) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS[get_secure_name('message')]))) : ''; |
Without the key, the message is treated as empty and rejected. This will work nicely until spammers go to the trouble of reading the returned form and extracting the key. |
_________________ Dan Kehn |
|
| Back to top |
|
 |
Ralf Night
Joined: 15 Mar 2007 Posts: 10
|
Posted: Sun Mar 18, 2007 5:26 pm Post subject: Re: Antispam |
|
|
| But spammers in my site doesnt posting... just register... |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 15129
|
|
| Back to top |
|
 |
Ralf Night
Joined: 15 Mar 2007 Posts: 10
|
Posted: Mon Mar 19, 2007 10:14 pm Post subject: Re: Antispam |
|
|
yes i see... but now i must waiting for activate my accounts... i will ask how i can uninstall mod which tell to add in lang_main.php:
$lang['antispam'] = 'Mistake! There was an attempt of an automatic insert of the message in a forum. Your message is sent to hell. Try still times who knows - can it will turn out? Still probably, that you too long wrote the message - then pass to page back, copy the text, update page, insert the copied text and press button "Send".'; |
|
|
| Back to top |
|
 |
hbbt
Joined: 05 May 2007 Posts: 30
|
Posted: Mon May 07, 2007 6:54 pm Post subject: Re: Antispam |
|
|
I have installed the humanizer and unique hash and still getting a few signed up.. just got them installed at my business forums but I was getting a bunch before I redid it all with the phpbb seo mod and these .. at least only 1 of the 6 or so that has signed up so far have actually posted...
Will keep you guys posted on more .. will probably add the better captcha as well .. |
|
|
| Back to top |
|
 |
noworyz PR0

Joined: 08 Jan 2007 Posts: 87
|
Posted: Mon May 07, 2007 8:23 pm Post subject: Re: Antispam |
|
|
| hbbt wrote: | I have installed the humanizer and unique hash and still getting a few signed up.. just got them installed at my business forums but I was getting a bunch before I redid it all with the phpbb seo mod and these .. at least only 1 of the 6 or so that has signed up so far have actually posted...
Will keep you guys posted on more .. will probably add the better captcha as well .. |
did you use the humaizer script from phpbb? If so, I used that as well and still got spam signups. I modified the code (as seen in my post above) and have not got 1 spam registration for almost a year now. |
|
|
| Back to top |
|
 |
|
|