[ABD] Raven's Antispam 1.2.0

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
User avatar
romans1423
Registered User
Posts: 1545
Joined: Sat Nov 02, 2002 4:44 pm
Location: Connersville, IN
Name: Rick Beckman

[ABD] Raven's Antispam 1.2.0

Post by romans1423 » Sat Jan 27, 2007 11:39 pm

Want to say goodbye to spam bots?

With Raven's Antispam, you'll be able to!

MOD Title: Raven's Antispam
MOD Description: Easy-to-install, fantastically effective protection against spam bots.
MOD Version: 1.2.0

MOD Download

Things to Keep in Mind
  • Raven's Antispam does not prevent humans from spamming. To provide protection against humans, I recommend looking into either Akismet or bbProtection.
  • For those browsing with JavaScript enabled in their browsers, the antispam protection will be unseen.
  • For those browsing with JavaScript disabled in their browsers, a short string must be entered on registration or guest-posting to verify humanity.
Ported with permission from the WordPress plugin of the same name.
Last edited by romans1423 on Mon Jun 25, 2007 8:06 am, edited 14 times in total.

User avatar
romans1423
Registered User
Posts: 1545
Joined: Sat Nov 02, 2002 4:44 pm
Location: Connersville, IN
Name: Rick Beckman

Post by romans1423 » Sun Jan 28, 2007 3:27 am

Updated to version 0.3.0. Raven's Antispam can now simply & effectively block bots from registering & posting new messages.

I hope.

This is still BETA, and I'm open to suggestions on how it can be improved, especially on things like code placement and variable checking and other such refinements.

I can't emphasize this enough: In my (and the original author's) experience, Raven's Antispam provided 100% protection against blog comment spam.

This MOD brings that high level of protection to phpBB with minimal fuss. As they say, set it and forget it!

Knubbi
Registered User
Posts: 77
Joined: Mon Jul 07, 2003 11:55 am

Post by Knubbi » Thu Feb 01, 2007 12:29 am

Hope, I am allowed to post here?!

The nice MOD worked fine at first but I wanted a shorter text captcha (4 instead 6 digits) and I messed with ravens_antispam.php and played around with the number in below commands:

Code: Select all

	return substr(md5(md5($mix)),3,6);
	return substr(md5(md5($mix)),8,3);
as I tought that this commands would affect the length of the text captcha.

That did not work, so I reverted the original values. But now, I always get an "Hacking attempt." error whenever I post as an unregistered user.

Any help how I can get back my forum? Thanks for any help.

User avatar
romans1423
Registered User
Posts: 1545
Joined: Sat Nov 02, 2002 4:44 pm
Location: Connersville, IN
Name: Rick Beckman

Post by romans1423 » Thu Feb 01, 2007 3:23 am

I don't know what would be causing the "Hacking attempt" error to be thrown unless the initial block of code in ravens_antispam.php has been altered. It should look like this:

Code: Select all

if ( !defined('IN_PHPBB') )
{
	die("Hacking attempt");
	exit;
}
In essence, it says that if the constant IN_PHPBB is not defined, the user cannot continue. This would be the case if ravens_antispam.php was accessed directly via the browser.

However, because the file is included in posting.php after the constant is set, the error should not be thrown -- registered or not.

Editing the length of the answer key is simple, and you were on the right track.

Code: Select all

return substr(md5(md5($mix)),3,6);
In that piece of code, 6 is the length. Changing it to 4 should work just fine. In essence, that code says to return the text contained in the 3, 4, 5, 6, 7, and 8 places of the result of double-hashing $mix. The 3 says to start with the third letter, rather than the first.

Knubbi
Registered User
Posts: 77
Joined: Mon Jul 07, 2003 11:55 am

Post by Knubbi » Thu Feb 01, 2007 9:17 am

I further investigated and found the Hacking attempt is thrown via common.php in the code segment:

Code: Select all

	// Merge all into one extremely huge array; unset
	// this later
	$input = array_merge($HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $HTTP_SERVER_VARS, $HTTP_SESSION_VARS, $HTTP_ENV_VARS, $HTTP_POST_FILES);

	unset($input['input']);
	unset($input['not_unset']);

	while (list($var,) = @each($input))
	{
		if (in_array($var, $not_unset))
		{
			die('Hacking attempt!3');
		}
		unset($$var);
	}

	unset($input);
}
I won't bother you with this if I would not believe that this happened directly after playing with the captcha length values. Do you see any connection here?

Your help would be very much appreciated.

Knubbi
Registered User
Posts: 77
Joined: Mon Jul 07, 2003 11:55 am

Post by Knubbi » Mon Feb 05, 2007 9:20 am

Any help? Since then I cannot use your MOD again as it immediately causes a "hacking attempt".

User avatar
romans1423
Registered User
Posts: 1545
Joined: Sat Nov 02, 2002 4:44 pm
Location: Connersville, IN
Name: Rick Beckman

Post by romans1423 » Mon Feb 05, 2007 4:31 pm

I've tried to recreate the hacking attempt error, but I haven't been able to. I'm not for sure how the code segment in common.php would be affected by the MOD. It's not the only place that throws the Hacking Attempt error; do you mind if I ask how you traced it there?

Knubbi
Registered User
Posts: 77
Joined: Mon Jul 07, 2003 11:55 am

Post by Knubbi » Mon Feb 05, 2007 5:35 pm

Very simple: I assigned different numbers to the "Hacking attempt" text (as you can see in above code where I added a '3'.

The "hacking attempt" starts appearing once I add the text input form field in posting_body.tpl:

Code: Select all

<input type="text" name="{RAVEN_NAME}" id="{RAVEN_NAME}" class="post" size="25" maxlength="32" value="" />
If I just leave out this input field, then I do not get the hacking attempt (but of course the Raven error message that the verification input is not correct).

It is so frustrating. I already uploaded the forum from scratch (without any other mod) but I still get this nasty error. Is there something altered in the MySQL that it is so persistent?

Any help?

User avatar
romans1423
Registered User
Posts: 1545
Joined: Sat Nov 02, 2002 4:44 pm
Location: Connersville, IN
Name: Rick Beckman

Post by romans1423 » Mon Feb 05, 2007 10:27 pm

The MOD doesn't touch the database in any way at all.

I'm still unable to recreate the error; it'd be great if some others tried it out as well so we can figure out what is going on.

That being said, the MOD successfully stopped all spam on my board. I'm signed up with bbProtection as well, and while I have the MOD enabled, the chart @ bbProtection shows ZERO spam attempts, meaning that the MOD is blocking them all before they are sent to bbProtection. Disabling the MOD, and spam starts reaching bbProtection again.

Unfortunately, I think it was blocking legitimate users as well; activity overall went down when it was installed. If there is a problem, it's eluding me quite nicely. :(

Knubbi
Registered User
Posts: 77
Joined: Mon Jul 07, 2003 11:55 am

Post by Knubbi » Tue Feb 06, 2007 9:42 am

The mod is fantastic and it works like a champ on another of my boards. It is just stalling on one board with this persistent error. I ran out of ideas what it could be if even a complete rebuilt of the forum failed to work.

--

I would suggest to set the code to 3 or 4 digits rather than 6. It is far random enough.

Other than that a really nice MOD!

User avatar
JLA
Registered User
Posts: 479
Joined: Tue Nov 16, 2004 5:23 pm
Location: USA
Name: JLA FORUMS
Contact:

Post by JLA » Tue Feb 06, 2007 10:53 pm

Tried this on your demo board and did not see that it worked

User avatar
romans1423
Registered User
Posts: 1545
Joined: Sat Nov 02, 2002 4:44 pm
Location: Connersville, IN
Name: Rick Beckman

Post by romans1423 » Wed Feb 07, 2007 12:17 am

Sorry, I actually have removed it from my board pending further tests; I've gotten word that the Wordpress plugin (from which my MOD is ported) blocks quite a few legitimate users somehow as well.

Further, I wanted to actually verify that it was blocking things, so when I removed it and saw the amount of requests being sent to bbProtection skyrocket, I got my verification.

The demo board is no longer a demo, but as far as I know, the MOD still works as advertised, pending evidence to the contrary.

User avatar
JLA
Registered User
Posts: 479
Joined: Tue Nov 16, 2004 5:23 pm
Location: USA
Name: JLA FORUMS
Contact:

Post by JLA » Wed Feb 07, 2007 1:03 am

If you have a place we can demo this, it would be appreciated.

Would like to see it in action prior to installing

Thanks

User avatar
romans1423
Registered User
Posts: 1545
Joined: Sat Nov 02, 2002 4:44 pm
Location: Connersville, IN
Name: Rick Beckman

Post by romans1423 » Thu Feb 08, 2007 1:59 am

JLA: Demo board info has been added to the first post.

I have also updated the MOD to 0.3.1 to fix a tiny bug where I copied too much of the HTML from the WordPress plugin from which this MOD is ported. The extra HTML shouldn't have any adverse affect, however.

Further, for those wanting to see a simple graphic representation of this MOD's efficacy, take a look at this:

Image

The image is from my board's stats @ bbProtection. The red represents posts & registrations that were made on my board that were blocked by bbProtection as spam. The green represents posts & registrations that bbProtection did not flag as spam.

The graph shows two things:

1) My board gets embarrassingly little traffic (generally less than 10 registrations AND posts per day).

2) When I had Raven's Antispam enabled on my board, it blocked all spam before it was sent to bbProtection for their tests. Disabling Raven's Antispam instantly resulted in the spam again being sent to bbProtection for screening.

I'm using bbProtection's graph as an example, of course; if you do not have bbProtection enabled on your board, all of that red would of course make it to your board. Raven's Antispam stops it cold.

And even if you have bbProtection, Raven's Antispam would be a benefit still; bandwidth to send posts & registrations to bbProtection and back would not be required if the spam posts were being stopped on your server with only a few lines of simple code. :)

User avatar
JLA
Registered User
Posts: 479
Joined: Tue Nov 16, 2004 5:23 pm
Location: USA
Name: JLA FORUMS
Contact:

Post by JLA » Thu Feb 08, 2007 2:31 am

Ok, it seems in your test board that

1. This is when JAVASCRIPT IS OFF for registration
2. This is when JAVASCRIPT is OFF and Guests are posting
3. Members can post with JAVASCRIPT OFF with no antispam
4. The SPAM code does not change from post to post

Correct?

Locked

Return to “[2.0.x] MODs in Development”

Who is online

Users browsing this forum: No registered users and 23 guests