Loading...
 
Features / Usability

Features / Usability


Re: Large number of spammer registrations

posts: 214

Back in June I converted an existing website from html to Tiki. The site did not get a lot of visitors before the conversion, but less than 36 hours after it re-appeared as a Tiki site, it started getting hit by lots of Tiki register attempts.

I sent an email about it to the Tiki-devel list, and emails to that list get added to the Tikiwiki-devel (mailman list mirror) forum, so you can read my email here: Convert your site to Tiki and increase your traffic....

 Note
The version of my email that was posted in the Tikiwiki-devel (mailman list mirror) forum was wiki parsed, which messed up the code. There is a cleaner version of the email in the Sourceforge Tikiwiki-devel archive, I recommend you read that one if you are interested in the code:Convert your site to Tiki and increase your traffic....


Basically it recommends that everyone should block "URLAppendBot" with their .htaccess file because I am pretty certain that was the robot that identified my site as a Tiki and fed the information to the distributed bot that does the tiki-register attempts.

Copy to clipboard
Add the lines below after the "RewriteEngine On" RewriteCond %{HTTP_USER_AGENT} URLAppendBot [NC] RewriteRule .* - [F]


Also, I included the code for a Stop Forum Spam plugin I have created. The plugin is kind of garbled in the forum post, so I will include it, with my instructions for how to use it here.

This plugin uses the Stop Forum Spam API to check IP addresses, to see if they are of reported spammers.
It needs to be saved as:

Copy to clipboard
/lib/wiki-plugins/wikiplugin_checkipwithstopforumspam.php


Plugin code (I am sorry for the formatting, the CODE plugin does not work with this code so I had to do a lot of encoding to be able to display the code below):

<?php
function wikiplugin_checkipwithstopforumspam($data, $params) {
    global $user, $prefs, $tikilib, $smarty;
    extract($params, EXTR_SKIP);
  if (!isset($msg) && !isset($page)) {$msg="Sorry, you may not register.";}
// Only check Stop Forum Spam if the group is Anonymous
  $userGroups = $tikilib->get_user_groups($user);
  $sfschk=1;
// This will check all the groups, if any are not Anonymous, do not do SFS check
  foreach ($userGroups as $key=>$grp) { if ($grp != 'Anonymous') {$sfschk=0;} }
    if ($sfschk) {
  // *** CHECK IP against SFS
      $addr = $_SERVER['REMOTE_ADDR'];
      # $addr="222.187.222.66"; # for testing, bad IP address
      $response = file_get_contents('http://www.stopforumspam.com/api?ip='.$addr);
      $pattern = '/<appears>yes<\/appears>/';
    if (preg_match($pattern, $response))
      {$SFS=1;} else {$SFS=0;} // SFS set to 1 if known spammer
  // *** End of SFS check
  if ($SFS) {
    if (isset($page)) {
      header("Location: tiki-index.php?page=$page"); // redirect to page if SFS known spammer
      exit;
  } else {
    header("Location: ./tiki-information.php?msg=$msg"); // leave and display message if SFS known spammer
    exit;
      }
    }
  }
return "";
}



To use this plugin, set up a User Tracker to collect information about your members, select that the tracker description should be wiki parsed, and then add the plugin to your User Tracker description:

Copy to clipboard
{CHECKIPWITHSTOPFORUMSPAM()/}


There are 2 optional parameters, page= and msg=. If neither of them are set, and the IP address is found in Stop Forum Spam's database, the visitor gets sent to a page that displays the default message: "Sorry, you may not register".

You can change the message with msg="your message", or send them to a wiki page with page=PageName. If a page= is specified, the msg= is ignored.

It does not check the IP address with Stop Forum Spam of someone that is logged in, so it will not call Stop Forum Spam for your IP address when you list your trackers and it shows the description.

You can test that it is working by un-commenting (removing the first "#") the line:

Copy to clipboard
# $addr="222.187.222.66"; # for testing, bad IP address


Then log out (or use a different browser) and access your tiki-register.php. With that line un-commented, the 222... address will be used instead of your IP address and you should get redirected away from the registration page.
Be sure to add the "#" back in when you are done testing, or delete that line altogether.

Note: I have only tested this plugin with Tiki 9, so use it at your own risk.


While I was researching the Stop Forum Spam API, I found
ZB Block. I have installed it and have been using it for a while with some of my Tiki sites. You might consider checking it out. One problem I had with it was that it blocked access to my Neighborhood Association Tiki website when that site was accessed from our local library's wireless access point. Some spammer had used the library and the library's IP address had been added to the Stop Forum Spam database, which is used by ZZ Block. There is a way to white list IP addresses though.

Tom

There are no comments at this time.

Upcoming Events

1)  18 Apr 2024 14:00 GMT-0000
Tiki Roundtable Meeting
2)  16 May 2024 14:00 GMT-0000
Tiki Roundtable Meeting
3)  20 Jun 2024 14:00 GMT-0000
Tiki Roundtable Meeting
4)  18 Jul 2024 14:00 GMT-0000
Tiki Roundtable Meeting
5)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
7) 
Tiki birthday
8)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting
9)  21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting
10)  19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting