Table of Contents
glFusion Spam-X Plugin
glFusion includes multiple layers of defense against spam, the Spam-X plugin is one of the key defenses. It has a modular architecture that allows it to be extended with new modules to fight the ever evolving spammers.
glFusion and the Spam-X plugin will check the following for spam:
- Story submissions
- Trackbacks and Pingbacks
- Event submissions
- Link submissions
- Forum Posts
- The text sent with the “Email story to a friend” option
- Emails sent to users via the “send email” form from their profile page
- A user's profile
The Spam-X plugin was built to be expandable to easily adapt to changes the comment spammers might make. There are three types of modules: Examine, Action, and Admin. A new module is contained in a file and can simply be dropped in and it will be added to the plugin. Examine Modules
glFusion ships with the following examine modules:
- Stop Forum Spam (SFS)
- Spam Link Counter (SLC)
- Personal Blacklist
- IP Filter
- IP of URL Filter
- HTTP Header Filter
Stop Forum Spam (SFS)
SFS is a centralized, server-based service that examines posts made on websites and detects when certain links show up in unusually high numbers. In other words, when a spammer starts spamming a lot of sites with the same URLs and those sites all report to SFS, the system will recognize this as a spam wave and will flag posts containing these URLs as spam.
In other words still, it's a dynamic blacklist that automatically updates itself when a spammer starts spamming for their site. And it can only get better (in terms of accuracy and reaction speed) the more sites use it.
SFS is a free service run by Project Honey Pot at https://www.projecthoneypot.org/.
Privacy Notice: It should be stressed that using SFS means that information from your site is being sent to a third party's site. In some legislations you may have to inform your users about this fact - please check with your local privacy laws.
Sending information to an external site may also be undesirable on some setups, e.g. on a company intranet. You can disable SFS support by removing the four files SFS.Examine.class.php, SFSbase.class.php and SFSreport.Action.class.php files from your Spam-X directory (/path/to/glfusion/plugins/spamx/modules). Or you can simply disable the Spam-X plugin entirely (or uninstall it).
Spam Link Counter (SLC)
SLC will examine a post and determine how many links to external sites are in the post. Anything more than 5 (configurable via the Online configuration) will be flagged as spam and rejected. Personal Blacklist
The Personal Blacklist module lets you add keywords and URLs that typically exist in spam posts. When you're being hit by spam, make sure to add the URLs of those spam posts to your Personal Blacklist so that they can be filtered out automatically, should the spammer try to post them again.
This will also help you get rid of spam that made it through, as you can then use the Mass Delete Comments and Mass Delete Trackbacks modules to easily remove large numbers of spam posts from your database.
The Personal Blacklist also has an option to import the glFusion censor list and ban all comments which contain one of those words. This or an expanded list might be useful for a website that caters to children. Then no comments with offensive language could be posted. IP Filter
Sometimes you will encounter spam that is coming from one or only a few IP addresses. By simply adding those IP addresses to the IP Filter module, any posts from these IPs will be blocked automatically.
In addition to single IP addresses, you can also add IP address ranges, either in CIDR notation or as simple from-to ranges.
Please note that IP addresses aren't really a good filter criterion. While some ISPs and hosting services are known to host spammers, it won't help much to block an IP address by one of the well-known ISPs. Often, the spammer will get a new IP address the next time he connects to the internet, while the blocked IP address will be reused and may be used by some innocent user.
IP of URL Filter
This module is only useful in a few special cases: Here you enter the IP address of a web server that is used to host domains for which you may see spam. Some spammers have a lot of their sites on only a few web servers, so instead of adding lots of domains to your blacklist, you only add the IP addresses of those web servers. The Spam-X module will then check all the URLs in a post to see if any of these is hosted on one of those blacklisted web servers.
HTTP Header Filter
This module lets you filter for certain HTTP headers. Every HTTP request sent to your site is accompanied by a series of headers identifying, for example, the browser that your visitors uses, their preferred language, and other information.
With the Header filter module, you can block HTTP requests with certain headers. For example, some spammers are using Perl scripts to send their spam posts. The user agent (browser identification) sent by Perl scripts is usually something like “libwww-perl/5.805” (the version number may vary). So to block posts made by this user agent, you would enter:
Header: User-Agent Content: ^libwww-perl
This would block all posts from user agents beginning with “libwww-perl”.
Once one of the examine modules detects a spam post, the action modules will decide what to do with the spam. Most of the time, you will simply want to delete the post then, so this is what the Delete Action module does.
As the name implies, the Mail Admin Action module sends an email to the site admin when a spam post is encountered. Since this can cause quite a lot of emails being sent, it is disabled by default.
Action modules have to be enabled specifically before they are used (examine modules, on the other hand, are activated by simply dropping them into the Spam-X directory). For this, every action module has a unique number that needs to be added up with the number of the other action modules you want to enable and entered as the value for the spamx config variable in glFusion's main configuration.
The Delete Action module has the value 128, while the Mail Admin Action module has the value 8. So to activate both modules, add 128 + 8 = 136 and enter that in the Configuration admin panel.
The SFS Examine module is complemented by a SFS Action module that ensures that SFS module is notified of spam posts caught by other examine modules. It “piggybacks” on the Delete Action module, i.e. when you activate the Delete Action module, you'll also enable the SFS Action module.
The Admin modules for the Personal Blacklist, IP Filter, IP of URL Filter, and HTTP Header Filter modules provide you with a form to add new entries. To delete an existing entry, simply click on it.
The Log View module lets you inspect and clear the Spam-X logfile. The logfile contains additional information about the spam posts, e.g. which IP address they came from, the user id (if posted by a logged-in user), and which of the examine modules caught the spam post.
In case a large number of spam posts made it through without being caught, the Mass Delete Comments and Mass Delete Trackbacks modules will help you get rid of them easily. Before you use these modules, make sure to add the URLs or keywords from those spams to your Personal Blacklist. Trackback Spam
Trackbacks are also run through Spam-X before they will be accepted by glFusion. There are also some additional checks that can be performed on trackbacks: glFusion can be configured to check if the site that supposedly sent the trackback actually contains a link back to your site. In addition, glFusion can also check if the IP address of the site in the trackback URL matches the IP address that sent the trackback. Trackbacks that fail any of these tests are usually spam. Please refer to the documentation for the configuration for more information.
The Spam-X plugin's configuration can be changed from the Configuration admin panel: Spam-X Main Settings
Spam-X Configuration Options
- Enable Logging
- Whether to log recognized spam posts in the spamx.log logfile (if set to True) or not (False).
- Don't Filter Admin Posts
- The Spam-X plugin will filter posts by any user - even site admins. This can be a problem sometimes, e.g. when you want to post a note about spam that itself contains “spammy” URLs or keywords. When this option is set to True then posts made by users in the 'spamx Admin' group are not checked for spam.
- Timeout (in seconds) for contacting external services such as SFS.
- Notification Email
- Email address to which spam notifications are sent when the Mail Admin action module is enabled.
- Spam-X Actions
- This only exists as a fallback in case $_CONF['spamx'] in glFusion's main configuration is not set. (i.e. $_CONF['spamx'] takes precedence).