[Request] vbStopForumSpam

This is the result of about 12 hours coding (and drinking) after stumbling over this site - http://www.stopforumspam.com Its a RBL type system for forum admins, listing known spam IP / email / usernames.

At the point of user registration, the mod checks if the IP number / provided username / email addresses appear on a block list and can block the registration.

Whilst this isnt the most perfect way to stop all forum spam, its another step that spammers have to overcome.


What it does

It checks with a remote database of known forum spammers. Their IP number, email address and forum username are tested and based on your configuration, you can reject / log / accept user registrations based on what you get back.

This version doesnt have
- whitelisting or the ability to submit users to the database but it will within the next week.
- automatic user deletion / post / PM purging. There are good tools out there already, this does something else.

Currently, I would say this is an beta codebase. Please treat it as such.

Instructions are included in the installation.txt file - PLEASE read it first and dont forget to actually upload the files in the upload folder, otherwise it WILL kill your registration progress and you wont see the log file options in admincp. You do not need to download the product-vbstopforumspam-3.54.xml file unless you are using a vBulletin version older than 3.6.0

Changes to vB
- 3 new database tables
- 2 database table alternations
- No new templates.
- 2 Hook (register_addmember_process & register_addmember_complete)

Ive tested it but had feedback that it works with versions as old as 3.6.2... Support should go back to older versions, as long as they have hook support for register_addmember_process / register_addmember_complete

Known to work - tested by me
- vBulletin 3.6.8 on Apache 2.2 / PHP 5.1.2 on Linux using cUrl
- vBulletin 3.7 Gold on Apache 2.0 / PHP 4.4.3 on Windows without cUrl (template changes wont work on 3.7 - thats in the next version with auto template changes)

For code to submit spammers to the database, check this post for code changes
http://www.vbulletin.org/forum/showp...&postcount=288

Reported in the thread to work
- 3.6.1, 3.6.2, 3.6.9, 3.6.10, 3.7.0, 3.7.1, 3.7.2, 3.7.3, 3.74, 3.80, 3.81, 3.82


If you have 3.54, then you can use the product-vbstopforumspam-3.54.xml file attached instead of the one in the ZIP file, which will allow older vBulletin versions to access this mods' features. I personally havent tested this version, its a user contribution, thanks to Darrell Mobley, that changes the way the XML works when imported into older versions.

Installers should remember to refresh their ACP navigation window when they first install it so they can see the new log file menu item.

REQUIRES MySQL 4.1.1+

Future versions
- Automatic integration into vBulletin to add users to the stopForumSpam.com database from a form
- Whitelisting of username / IP / email addresses
- AJAX integration to allow for lookups from within the users profile
- Decreased remote query count from three per user to one per user.

Versions / Changes

0.1 Initial Release

0.2 pedigrees special brew birthday release.
- Small security update. If you have 0.1 installed, download 0.2 and replace your existing functions_vbsfs.php with the one in the archive. It just tests to see if its running inside the VB framework before anything else. This is what happens when you code at 2am after drinking wine

0.3
- stopped it processing valid registrations twice
- moved all non-function code into the plugin. Not a big one as 0.2 basically did that
- fixed a typo in the log pruner that stopped it working (404)
- removed unused fields from the database for people with mysql that doesnt support varchar > 255 (ie mySQL4). If you have 0.2 installed and dont need to prune your logs just yet, you dont really need to install this version but can instead wait for 1.0 unless of a massive security update.

0.4
- logs registrations that arent/wouldnt be blocked
- fixed XML errors when username has a space it in
- tightened up the cache so that it doesnt test a username against an email name to give a bypass result (for when a username is an email address that isnt banned where the email address is)
- fixed some basic logic errors in the PHP

0.6
- Should work on PHP 4.4 now - rewrote the XML with PHP4 in mind (tested on Apache2.0/PHP 4.4.3)
- Fixed a caching system where data wasnt being updated correctly which could cause a remote query when one wasnt needed
- Possible false negative situation when a spammer was blocked due to SFS.com being down who then visited again when it was up but within the cache expiry time
- Remote query failure when the result page isnt XML should work a bit better now. It does a very basic test for valid XML results.
- Fixed log purging (again) and it should actually work properly now.
- No longer requires PHP5
- The log viewer now links to a user profile when registration is allowed.

v0.61 - SECURITY UPDATE ONLY
- You dont need to uninstall/reinstall if you have 0.60, you just need to edit MEMBERINFO template
- Removed the template edits from the instructions as they allow people to see others IP numbers. My mistake and Ill stand at the wall ready for the firing squad if required to do so. Please revert MEMBERINFO template or find and delete this text from it

Code:
 	<if condition="$permissions[vbstopforumspamviewpermissions]=1">
	<div class="fieldset">Last IP Address : $bbuserinfo[ipaddress]
		<a onclick="pageTracker._trackPageview ('/outgoing/http_www_stopforumspam_com_ipcheck_bbuserinfo_ipaddress_');" href="http://www.stopforumspam.com/ipcheck/$bbuserinfo[ipaddress]" target="_blank"><img 

src="$stylevar[imgdir_statusicon]/vbsfs_view.gif" alt="View IP details at www.StopForumSpam.com" border="0">
		</a>
		<if condition="$permissions[vbstopforumspamsubmitpermissions]=1"><a href="#not_working_yet_$bbuserinfo[ipaddress]"><img 

src="$stylevar[imgdir_statusicon]/vbsfs_submit.gif" alt="Submit spam user details to www.StopForumSpam.com"  border="0"></a></if>
	</div>
</if>

NB : When upgrading from any version to 0.6, you must remove and then add the plugin due to changes in one of the database tables


OK, Ive been nagged and nagged and nagged (and not by my wife this time).

Here is a small change to 0.61 that will be worked on in 0.7 that will allow you to submit spammer details to the database from the admin control panel. It requires editting admincp/user.php

quickadd.png


These line numbers are for my 3.71 dev install, they might be a bit different depending on the version. Ive only tested it in 3.71

Find (about line 524)

Code:
 	// QUICK LINKS SECTION 
Insert ABOVE that (but below the if ($vbulletin->GPC['userid']) { )

 	Code:
 			// VBSTOPFORUMSPAM MOD
		if ($vbulletin->GPC['userid'] > 1) { // we dont want to ban our admin account now do we
			print_table_header("vbStopForumSpam");
			if ($vbulletin->options["vbstopforumspam_apikey"])
				print_label_row('Submit these details to www.stopforumspam.com ban list<BR><table><tr><td>Username:</td><td><input type="text" name="username"  size="30" value="'. $user['username'] . '"></td></tr><tr><td>Email:</td><td><input type="text" name="email"  size="30" value="' . $user['email'] . '"></td></tr><tr><td>IP:&nbsp;</td><td><input type="text" name="ip_addr"  value="' .$user['ipaddress'] . '"></td></tr></table><input name="api_key" type="hidden" value="' . $vbulletin->options['vbstopforumspam_apikey'] .	'"><input onclick="this.form.action=\'http://www.stopforumspam.com/add.php\';this.form.submit()"  type="button" class="button" value="' . $vbphrase['submit'] . '"/>');
			else
				print_label_row('You need an API key from www.stopforumspam.com before you can submit to the database' ,'');
			print_table_break('', $INNERTABLEWIDTH);	
		}
If you dont want to do the edits manually, then you can install the plugins (Coded by Wired1) here http://www.vbulletin.org/forum/showp...&postcount=289

You need to have an API key from www.stopforumspam.com in order to submit data, its free and easy to get... The code above is a quick hack that changes the pages "form" so that it submits to the database. As its a quick hack, this relies 100% on javascript being enabled and makes no tests that it is enabled.

Known Issues and workarounds
There are two known issues. If you cant see the logs in ACP/ Statistics and Logs, then you didnt upload the contents of the "upload" folder.... Its there for a reason, upload its contents to the root of your forum. This isnt an issue, its just something that 99% of the "it doesnt work" issues arise from.

Issues are
- If you sort on IP number in the logs, you get an SQL error. See this post for a quick fix.
http://www.vbulletin.org/forum/showt...or#post1609780
- The usergroup permissions / view details etc DONT work. I jumped the gun and put the permissions controls in there before I put the code in. Please delete the includes/xml/bitfield_vbstopforumspam.xml file and rebuild your postbit


Please click Installed Download Now
 
Back
Top