NP_BlackList.php

This is a rework of the Pivot Blacklist by Marco. It blacklists commentspammers based on IP, keywords or referer. This is a wrapper around this plugin providing you an administration panel and fully Nucleus integreated functionality.

General Plugin info
Author: xiffy
Current Version: 0.98
Download: Blacklist [zip] [52.2kb]
Forum Thread: Nucleus forum thread

Installing

  1. Unzip the file and upload the contents to your plugin directory
  2. Make sure ALL the files in the directoy <plugins>/blacklist/settings/ are writable.
  3. Remove the blacklist URL from the plugin
  4. Configure the plugin on the plugin specific pages

How to use the plugin

This plugin checks whether a comment is spam based on a blacklist of ip's and keywords. The comment, author and referer are checked against the keywords. The blacklist can be customized and checked in the admin area. Statistics of blocked messages are available.

Blacklist can generate .htaccess snippets based on 'catched' rules. That means that any rule matched by a spammer is logged in a separate backlog. This backlog is used to generate .htaccess rules resulting in a 403 forbidden page for well know and used blacklist rules.

Available SkinVars and/or TemplateVars

  • None required

Options

  • Enable/Disable blacklist
  • Custom referer for blocked messages
  • Custom global blacklist (currently none available)
  • Enable/Disable referer blocking
  • Enable/Disable IP blocking
  • Number spam attacks before an ip will be blocked

Bugs

  • A failed blacklist update will slow down your blog's loading as it keep trying to update the list. This will happen when you didn't remove the default master blacklist
  • Rules in the form 'domain.net' will be interpreted as 'domain?net' whereby the '?' stands for any character.

History

  • pre 0.95
    • rapid development of spam catching techniques. lot's of bugfixes due to the conversion from pivot to nucleus.
  • version 0.95
    • In this version i've added the option to block visitors based on their referrer. This way you can take some load of the server by capturing the visitor really soon, just before you would serve him the webpage.
    • This version also sports a plugin api. This way other plugins like np_chat and trackback can check submitted content for spam too. There is some discussion on this matter in the above metioned forum thread.
  • version 0.96
    • In 0.96 there is also the opportunity to block notorious spammers based on their ip-address. When a client hits your site with spam, the counter for that ip starts counting. As soon as he spams your site above the threshold (plugin option; default 10) the ip-address is added to the blocked-ip list. From now on, all requests coming from that address will be blocked immediatly.
    • The current version can generate .htaccess snippets which you can incorporate in your exsisting .htaccess. This should stop the spammers at the gate, freeing some resources and memory of your server. The snippets are only generated for rules that are matched by blacklist.
  • version 0.97
    • For version 0.97 I've added another, new event which is available in Nucleus version 3.2 and onward. This new event makes the hacked action.php obsolete.
  • version 0.98
    • In this version the list retrieved from Jay Allen is converted differently; all . will be replaced by \. which is far better because it improves speed, and it solves a bug that the dot was interpreted as a wildcard instead of a real dot.

Code example plugin api

This plugin also contains a plugin API so other plugins like trackback, chat and the like can call blacklist to scan information submitted to the weblog on spam.

The following code can be incorporated in your plugin. If you do, the teststring will be checked for spam …

global $manager;
if ($manager->pluginInstalled('NP_Blacklist')) {
  $spamcheck = array ('type'  => 'Referer', 'data'  => $body, 'return'  => false);
  $manager->notify('SpamCheck', array ('spamcheck' => & $spamcheck));
}

See also the readme.txt included in the zipfile.

blacklist.txt · Last modified: 2010/12/09 20:09 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki