[7.5.7+] Stop Forum Spam - Login Detection - 12/02/2013 7:00 AM
Author: Gizmo/Gremelin (James of VNC Web Services)
Requirements:
Valid UBB.Threads 7.5.7 install and license (note, this will run on previous builds, but you'll need to apply the Stop Forum Spam modification beforehand).
About:
It occoured to me one night, while working on a client site, that spammers weren't just the "drive by" variety anymore (whereby they sign up, spam, and go on); in today's world we see an increasing number of "sleeper" spammers (whereby someone registers, they wait a while, and then spam). It hit me that when they register, they're a legit "no spam" user in spam databases, but when they begin their trouble they already have bypassed registration checks through any multitude of software packages.
I then decided to revisit my original Stop Forum Spam modification and look at the template mod for the registration check and apply the settings to the UBB.Threads login screen; as, since they're already registered and seemingly "legit", the login check would validate them every time they attempt to login; thus if they're now listed as a spammer, they can't login and, well, spam.
NOTE: If you're having problems with API timeouts ("Unable to Connect to Stop Forum Spam Database" error) you can adjust the API URL in login.tpl to use:
Versus the default:
In languages/english/stop_forum_spam.php:
Find:
Add Above::
In scripts/login.inc.php:
Find:
Replace With:
In templates/default/login.tpl:
Find:
Add Below:
Find:
Add Below:
Requirements:
Valid UBB.Threads 7.5.7 install and license (note, this will run on previous builds, but you'll need to apply the Stop Forum Spam modification beforehand).
About:
It occoured to me one night, while working on a client site, that spammers weren't just the "drive by" variety anymore (whereby they sign up, spam, and go on); in today's world we see an increasing number of "sleeper" spammers (whereby someone registers, they wait a while, and then spam). It hit me that when they register, they're a legit "no spam" user in spam databases, but when they begin their trouble they already have bypassed registration checks through any multitude of software packages.
I then decided to revisit my original Stop Forum Spam modification and look at the template mod for the registration check and apply the settings to the UBB.Threads login screen; as, since they're already registered and seemingly "legit", the login check would validate them every time they attempt to login; thus if they're now listed as a spammer, they can't login and, well, spam.
NOTE: If you're having problems with API timeouts ("Unable to Connect to Stop Forum Spam Database" error) you can adjust the API URL in login.tpl to use:
Code
$xml_string = @file_get_contents("http://api.stopforumspam.org/api?ip=". $_SERVER["REMOTE_ADDR"]);
Versus the default:
Code
$xml_string = @file_get_contents("http://www.stopforumspam.com/api?ip=". $_SERVER["REMOTE_ADDR"]);
In languages/english/stop_forum_spam.php:
Find:
Code
$ubbt_lang['SFS_DETECTED_INFO_1'] = "At this time your registration can not be continued. Your IP address has been flagged as that of a known spammer/spambot via the ";
Add Above::
Code
$ubbt_lang['SFS_DETECTEDLOGIN_INFO_1'] = "At this time your login can not be continued. Your IP address has been flagged as that of a known spammer/spambot via the ";
In scripts/login.inc.php:
Find:
Code
"wordlets" => array("login"),
Replace With:
Code
"wordlets" => array("login","stop_forum_spam"),
In templates/default/login.tpl:
Find:
Code
{* Script Version 7.5.8 *}
Add Below:
Code
{php}
$xml_string = @file_get_contents("http://www.stopforumspam.com/api?ip=". $_SERVER["REMOTE_ADDR"]);
if($xml_string != false) {
$xml = new SimpleXMLElement($xml_string);
if ($xml->appears == 'yes') {
{/php}
{$tbopen}
<tr>
<td class="tdheader" colspan="2">
{$lang.SFS_DETECTED}
</td>
</tr>
<tr>
<td colspan="2" class="alt-2">
{$lang.SFS_DETECTEDLOGIN_INFO_1}
<a href="http://stopforumspam.com/ipcheck/{$smarty.server.REMOTE_ADDR}" target="_blank">Stop Forum Spam</a>
{$lang.SFS_DETECTED_INFO_2}
<br /><br />
Powered by the <a href="http://www.virtualnightclub.net/" target="_blank">VNC Web Services</a> <a href="http://www.stopforumspam.com/" target="_blank">Stop Forum Spam</a> addon for <a href="http://www.ubbcentral.com/" target="_blank">UBB.threads</a>.
</td>
</tr>
{$tbclose}
{php}
} else {
{/php}
Find:
Code
</form>
Add Below:
Code
{php} } } else { {/php}
{$tbopen}
<tr>
<td class="tdheader" colspan="2">
{$lang.SFS_ERROR_TITLE}
</td>
</tr>
<tr>
<td colspan="2" class="alt-2">
{$lang.SFS_ERROR_CONNECTION}
<br /><br />
Powered by the <a href="http://www.virtualnightclub.net/" target="_blank">VNC Web Services</a> <a href="http://www.stopforumspam.com/" target="_blank">Stop Forum Spam</a> addon for <a href="http://www.ubbcentral.com/" target="_blank">UBB.threads</a>.
</td>
</tr>
{$tbclose}
{php} } {/php}
Please leave your thanks below so we can know that we've helped you!