Page 1 of 2

[ABD] StopForumSpam.com automatted banning

Posted: Thu Dec 11, 2008 2:20 am
by microUgly
Modification Name: StopForumSpam.com automated banning
Author: microUgly

Modification Description::
Complements phpBB3's current banning system by checking a users username/email/ip against the StopForumSpam.com listing using its API. It will automatically ban current users and prevent registration.

Modification Version: 0.1

Requirements: phpBB 3.0.x
Features:
  • Can ban and prevent forum registration based on users IP, email, or username and enforce a ban on already registered users (each check is optional).
  • Can set your own tolerance (i.e. only ban username if it's been reported on StopForumSpam.com 5 or more times)
  • Can set your own ban end (i.e. allow an IP if it hasn't been reported for more than 10 days).
  • Logs identified spammers so you can track how well the system is working
Installation:
Sorry, I've never written a mod for distribution, and the system seems to complicated to be make the effort at this very moment. In any case, if you don't know how to follow what I write here then you shouldn't be using it anyway.
  1. Extract the files into a folder on your host.
  2. Open /includes/session.php
  3. In the function check_ban() find $db->sql_freeresult($result); (should be line 1117)
  4. AFTER that line include stopforumspam-ban.php. For example:

    Code: Select all

    include($_SERVER['DOCUMENT_ROOT'].'/mods/stopforumspam-ban.php');
Optionally, if you also want to block registrations based on the supplied username
  1. Open /includes/functions_user.php
  2. At the end of the validate_username function, before "return false" (should be line 1483) insert:

    Code: Select all

    $sfsReturn = include($_SERVER['DOCUMENT_ROOT'].'/mods/stopforumspam-disallow.php');
    if ($sfsReturn !== TRUE) return $sfsReturn;
    Make sure you get the path correct for your system.
[/s]
stopforumspam-disallow.php is not working.

You can customise the checks by editing the files. In stopforumspam-ban.php you can delete an entire array item from $banTriggers to not perform that check.

Log is created in the store/ folder. You can set the log details in each of the files.

Screenshots: n/a

MOD-Demo: None.
Modification Download: http://www.microugly.com/phpbb-mods/sto ... m-dev1.zip

Re: [DEV] StopForumSpam.com automatted banning

Posted: Thu Dec 11, 2008 6:53 am
by beggers
Always good to see more anti-spamming capability. Thanks!

Re: [DEV] StopForumSpam.com automatted banning

Posted: Thu Dec 11, 2008 7:48 am
by DoYouSpeakWak
Excellent
Image

Re: [DEV] StopForumSpam.com automatted banning

Posted: Mon Dec 22, 2008 6:14 am
by thejdm
something worth checking out.
thanks.

Re: [DEV] StopForumSpam.com automatted banning

Posted: Tue Jan 06, 2009 6:34 am
by microUgly
I finally got around to putting this on my live site. In the last hour 40 log entries have been recorded from 24 spammers. All of them were identified by their IP bar one who was identified by email address. One spammer was blocked from registration based on the chosen username--unfortunately the code I've uploaded here doesn't correctly log that event (doh!) so I don't know what username was supplied but he didn't come back.

I don't get that many spam posts, but I didn't realise spammers were hanging around so much. The captcha's would probably have blocked most of these guys anyway, but it's nice to have that second level of defense.

I think I need to extend the log to include what topics or forums they are looking at. I was tempted to log these into the user logs but I think there will be too many.

Re: [DEV] StopForumSpam.com automatted banning

Posted: Sun Mar 01, 2009 10:03 pm
by DiryHarry
Hi,

if I'm getting it right, your mod consists of two parts
- a part with that I can prevent registration of spmmers autmaticallay
- a part in the ACP?

Perhaps you can describe the second part? Is there a "Check against Stopforumspam" Button or Link in the detail view of every registered user? Or how does it look like?

Re: [DEV] StopForumSpam.com automatted banning

Posted: Fri Apr 17, 2009 10:33 am
by thejdm
has anyone else installed this mod?
the past week+ spam bots have been hitting my forum about 4-5 a day sometimes more.

Re: [DEV] StopForumSpam.com automatted banning

Posted: Thu Aug 06, 2009 9:20 am
by PurpleOne
Just like to say this works brilliantly! I have been constantly fighting with spammers registering themselves on my forum, I have been getting as much as 15 a day! This is only from the ones who don't give a valid address and my default inbox gets bombarded with failed delivery status. The ones that do have a valid address, I get just as many!

This stops the spammers from even getting a chance to register, although I had to remove the username from the ban trigger as some smart cookie decided to use the 'Anonymous' username!

:D

Re: [DEV] StopForumSpam.com automatted banning

Posted: Wed Aug 19, 2009 11:11 pm
by thejdm
i have this installed and had the 'PM me when spam registers' and well it says i had new PM's but when i went to the inbox i had 0, now i have 2 messages (so it says) but i dont have any. how the heck can i get that back to 0?

Re: [DEV] StopForumSpam.com automatted banning

Posted: Thu Nov 12, 2009 2:00 am
by finnw
PurpleOne wrote:This stops the spammers from even getting a chance to register, although I had to remove the username from the ban trigger as some smart cookie decided to use the 'Anonymous' username!
:D
It's worse than that, it can trigger already-registered users who have logged out. They go to the front page, see the "you have been permanently banned" message and assume their IP has been blacklisted. It hasn't. It's because they had no valid login cookie and the current username defaults to 'Anonymous'. These users could have continued reading/posting if they had ignored the message and logged in, but understandably they assume they cannot log in and walk away.

For my installation I modified the code so that if the current username is 'Anonymous' it ignores it but any other username will be looked up in the database.

Re: [DEV] StopForumSpam.com automatted banning

Posted: Sun Nov 15, 2009 12:40 am
by excentryk
finnw wrote:
PurpleOne wrote:This stops the spammers from even getting a chance to register, although I had to remove the username from the ban trigger as some smart cookie decided to use the 'Anonymous' username!
:D
It's worse than that, it can trigger already-registered users who have logged out. They go to the front page, see the "you have been permanently banned" message and assume their IP has been blacklisted. It hasn't. It's because they had no valid login cookie and the current username defaults to 'Anonymous'. These users could have continued reading/posting if they had ignored the message and logged in, but understandably they assume they cannot log in and walk away.

For my installation I modified the code so that if the current username is 'Anonymous' it ignores it but any other username will be looked up in the database.
hello - please tell me how you modified the code to allow Anonymous users to view forum?
I have problem because all of my guests are banned.
Please answer thx ;)

Re: [DEV] StopForumSpam.com automatted banning

Posted: Fri Nov 20, 2009 1:57 am
by finnw
excentryk wrote:hello - please tell me how you modified the code to allow Anonymous users to view forum?
I have problem because all of my guests are banned.
Please answer thx ;)
Here's the modified portion of the code:

Code: Select all

    // Unset any checks that we don't have values for.
    if (empty($user_id))
    {
      unset($banTriggers['username']);
    }
    elseif (isset($banTriggers['username']))
    {
      user_get_id_name($user_id, $user_name);

      if (!empty($user_name) && $user_name[1] != "Anonymous")
      {
        $banTriggers['username']['value'] = $user_name;
      }
      else
      {
        unset($banTriggers['username']);
      }
    }
    if (empty($user_email)) {
      unset($banTriggers['email']);
    } elseif (isset($banTriggers['email'])) {
      $banTriggers['email']['value'] = $user_email;
    }
    if (empty($user_ips)) {
      unset($banTriggers['ip']);
    } elseif (isset($banTriggers['ip'])) {
      $banTriggers['ip']['value'] = $user_ips;
    }

Re: [DEV] StopForumSpam.com automatted banning

Posted: Fri Nov 20, 2009 7:07 am
by alexx_2010
I did installed this mod i faced the same problem but couldn't find any solution.

Re: [DEV] StopForumSpam.com automatted banning

Posted: Mon Nov 23, 2009 6:06 pm
by roger.meier
I installed the mod and I'm getting this error:

Code: Select all

[phpBB Debug] PHP Notice: in file /mods/stopforumspam-ban.php on line 100: curl_exec() has been disabled for security reasons
I made sure the permissions of both php files are set to 755.

Any ideas?

Re: [DEV] StopForumSpam.com automatted banning

Posted: Wed Nov 25, 2009 1:11 pm
by un4saken
Someone please make this modx compatible