Forum Moderators: phranque

Message Too Old, No Replies

How do I stop spam on email forms?

         

Mel3020

4:37 am on Jan 5, 2009 (gmt 0)

10+ Year Member



I have read some threads on this forum with ideas about how to stop the constant flow of spam emails through contact/guestbook forms, but the problem is that I don't understand a lot of it. I am very new to web design and I just don't understand some of the terminology or how to implement some of the ideas given. I'm using Expression Web to design my website and I created a 'contact us' form using the form control feature. Can anyone please give me advice on how to prevent spammers from invading my inbox in simple terms? I would be very, very grateful!

grelmar

12:32 am on Jan 9, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here's a simple, zero programming knowledge required solution, that I've used for years (on some sites) - I prefer captcha, but that's not always appropriate.

To get away from captcha solutions, it's all about how the email itself is handled. Most hosting companies offer some sort of spam filtering on their email accounts. Have the form submit the email to an account you've set up with the spam filtering on.

Then forward all the email in that account to GMail, which has some pretty awesome spam filtering.

Then, pop the GMail account to your desktop email client. If you use TBird, even better, because it has a very good Bayesian filter of its own.

It may sound complicated, but it isn't. It's a 10 minute setup. And it's 99.9% effective.

incrediBILL

12:43 am on Jan 9, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If you don't think I have some experience with this problem, here's the stats from attempts spams bounced from a single form on a single page on one website using the simple techniques outlined above.

YEAR - Spam Attempts
2009 - 719 (to date)
2008 - 52037
2007 - 15912
2006 - 5515 (partial year)

As you can see there was a massive escalation in '08 and it peaked at 7K spams/month then tapered off at the end of the year to 4K spams/month.

That's over 74K pieces of junk auto-rejected due to spammers doing the stupid things spammers do and not being able to process javascript.

Other forms on my site are also rejecting garbage but it's not quite the volume of this one form which seems to be very attractive to the spammers.

jimh009

12:46 am on Jan 9, 2009 (gmt 0)

10+ Year Member



When it comes to email and spam, I'm not the most technically inclined around. But, I'll give you two ideas that have worked for me.

On one of my sites, I run a vBulletin board. As someone here mentioned, the little captcha to register is easily broken. I was having at least 100 bogus registrations everyday...and after a while it was just like "enough!" So, I disabled the automatic registration, and had the registration link forwarded to an standard HTML page. There, a person can simply copy the "required information" into their email, fill out the information I ask for (username, location, etc...) and email it to me (using the method outlined below to send an email). I'll then manually register them...which is a LOT simpler than sorting through unending piles of spam registrations.

Two interesting things happened since I did this. First, I'm getting more registrations...mainly because I'm no longer deleting valid registrations along with the spam ones. And secondly, the robots hitting the forum just "vanished." I went from averaging anywhere from 3000-5000 "visitors" on the forum at any one time to having 15-20 (I have a very small forum.) This dramatic drop in the spam bots greatly enhanced the performance of my VPS, prevented my VB session table from filling up, among many other happy things.

I don't use a "contact us" form on any of my sites. Instead, people can send me email via a standard "looking" mailto link or by typing in the graphical email address shown on the page. Now, the key thing here is to make the address in the mailto link encoded in javascript...deeply encoded. While javascript might be able to be broken, I've yet to have any address encoded in it broken...yet (I've been doing this for five years, too!). As for the graphical email address, I make it simple to read...unlike those squiggly lines that can be impossible to read. Thus, it could be broken, although I take a few sneaky steps to throw things off a bit for the bots if they try (and so far, they haven't succeeded, perhaps because they don't know where to look).

But here's what works about this system. I NEVER use the primary email address for the site in either the mailto or graphic email address. Instead, I use disposable email addresses (example might be contact123@domain.com) and have that email forwarded to my primary address. Typically, what happens is that I keep the email address live for about a year. I then take it down and put up a new one and replace the graphical image with a new one, too.

While this system sounds simple, it works amazingly well.

Not sure if this will work for your problem, but it certainly solved mine.

Also, one last thing. In your email setup (at least if you use cPanel), make sure all "unaddressed email" to your domain automatically disappears. I forgot to do this for one of my domains in Cpanel. When I finally remembered to do it (two years later!), I had more than 10,000 messages clogging up the online email in cPanel (addressed to "webmaster@domain.com" "admin@domain.com", etc...). By not using those common addresses for your email addresses and having all email disappear for addresses that haven't been specifically created for your account, you can dramatically cut down on the spam you receive.

Tourz

1:07 am on Jan 9, 2009 (gmt 0)

10+ Year Member



After I started using a bullet-proof spam filter that came with my hosted exchange service, I was able to post the raw email address right on the website. Only about five a day get through now, and sometimes they actually turn out to be pretty useful.

Making my contact form page secure got rid of all the form spam. I think I'll try that again soon.

JS_Harris

1:15 am on Jan 9, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Using a custom field + changing the question regularly + not asking a yes or no or simple math question has worked wonders for me.

I also employ a "maximum attempts" approach where if someone gets the question wrong 5 times they have to wait 15 minutes to try again.

None of this stops semi assisted bots where someone is watching their bot work but it gets most every other bot.

The best custom fields ask you to fill in a missing letter or two in a well known word, like "which character is missing from WEBMA TER" for example.

[edited by: JS_Harris at 1:15 am (utc) on Jan. 9, 2009]

blend27

1:20 am on Jan 9, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



BILL,

--Many mobile devices use a mobile service-

I respectfully read every comment you make on the matter, every time it is mentioned, but what about the providers that allow VOIP, Collocation and D.UP from the same allocated IP Range. or I am on Sprint WiFi Range(using my Palm as a connection) Broadcasting CUNY IP(Proxy HTTP 1.1) with proper headers, and Mobile UA "Posting" to a list of known Guestbooks, eating cookies and ignoring the fact that the cow is DEAD?

The reason I mention this is that 2 weeks ago, I witnessed a proxy GET from an IP with following by 17 IPs serving the same cookie in the headers(A.K.A Authenticated).That was CUTE. ;-)

Long Live the dead COW!

Blend27

incrediBILL

1:37 am on Jan 9, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Blend27, I never said I rely solely on the mobile devices service provider, some mobile devices have very unique services easy to authenticate, others do not. It's just another signal in all the noise I use to narrow down candidates to challenge.

pageoneresults

1:57 am on Jan 9, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I don't know jack about this but I will say that my new Nukem Utility (hand rolled IP blocking) is working quite well on what little form spam was left. We capture IP on the submissions and sure enough, many of the submissions shared the same IP so we know there are just a small group of submitters responsible for a bulk of the form spam. Any time I see one come in, I grab that IP and poof, into the 403 bin with them. :)

Seems to be working very well so far. And I'm on Windows. Heh!

swa66

2:04 am on Jan 9, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



IncrediBill,

Do you have the scripted solutions in #3822249 above posted out here somewhere ?

Usure what languages you use etc. but some of the things can be more inspiring in code.

Still my biggest battle is with sweatshops, and those are humans using regular browsers on dynamic IPs, so I unfortunately end up with blocking way too much just not to have a flood of pure filth.

Contact forms etc: I have a lot of success with dropping things that try to post images or links, but I surely have some false positives in there too, so optimizing that would be interesting to try.

docbird

4:01 am on Jan 9, 2009 (gmt 0)

10+ Year Member



From coding duffer:
Maybe Bad Behavior could help, if site is suitable. Bonus should be stopping proportion of bad bots eating bandwidth, slowing things down.

Seems a goldmine of info in this thread; spectrum from non-coders, to some deep n heavyweight looking info.

incrediBILL

7:28 am on Jan 9, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Here's a non-programming solution to cover the requirement of POST and valid REFERER which can be applied to all forms on your site in the .htaccess file.

RewriteCond %{HTTP_REFERER} !^http://(www\.)?example.com/.*$ [NC,OR]
Rewritecond %{HTTP_METHOD} !^post [NC]
RewriteRule formpage\.html - [NC,F]

davidof

8:48 am on Jan 9, 2009 (gmt 0)

10+ Year Member



Akismet can be a useful solution combined with Captchas. It is a database of known spammers.

incrediBILL

9:19 am on Jan 9, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



it is a database of known spammers

Many spammers use botnets and rapid flux so they're never where you thought they were the 2nd time around.

Using Askimet is kind of like trying to shoot a duck after it already flew south for the winter.

2clean

9:30 am on Jan 9, 2009 (gmt 0)

10+ Year Member



List all the letters A to Z on a page and then ask the user to enter letter n (when n is randomized). Tie it into a database that checks the value. Some people can't do maths at all, but counting to 26 is within most people's grasp. The Gmail solution was also cool

davidof

12:15 pm on Jan 9, 2009 (gmt 0)

10+ Year Member



> Many spammers use botnets and rapid flux

that's true, any many are idiots sitting in front of keyboards filling in captures for fun and profit.

Webwork

2:46 pm on Jan 9, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



If we, collectively, could create an effective solution or deterrent to form or email spam I might have hope that we will find a solution to other issues, such as global warming.

I think our failure to address even simple every day issues, like spam, tends to eat away at our confidence or belief - or commitment to the idea(s) that we, as a species, can do better in other realms, such as global warming, pandemic flu, genocide, famine, and on and on.

Save the cheerleader. Save the world.

Kill form or email spam and we might just begin to believe we can tackle larger issues.

Anyone care to volunteer to be a hero?

netmeg

5:14 pm on Jan 9, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I've been told it's not foolproof, but for my sites and my client sites, I've had pretty near 100% spam stoppage using a combination of a hidden field and specifying the required referring page before processing the request.

phranque

9:49 pm on Jan 9, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I've had pretty near 100% spam stoppage using a combination of a hidden field and specifying the required referring page

no spam and also no forms submitted by visitors with referrers turned off, including for example some very legitimate ones behind corporate firewalls with no choice in the matter.
which is an ok decision if you don't care about those vistors, but if it happens to be that corporation's web site...

netmeg

9:52 pm on Jan 9, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



No, I didn't mean that - I mean the form submission has to travel a specific path on my site, otherwise it gets tossed.

rocknbil

9:53 pm on Jan 9, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've always found a combination of things works best, however a well done CAPTCHA is still nearly foolproof all by itself.

See post #7 on page one of this thread, apparently it's pretty easily hacked - or is it that vBulletin's captchka is just off-the-shelf weak? (see below . . . )

@ jimh009:

On one of my sites, I run a vBulletin board. ... the little captcha to register is easily broken.

However, the "custom user registration field" seems to have the same effect, a few of them hit it for a week or so after the first inception of it, then gave up, which brings me to the point (see below . . .)

@ grelmar: wow that's a lot of passing around to get to one email. :-)

I still say, get at the root, to heck with road blocks and hoops. Filter your data, call it a day, it really is the easiest path that presents no additional tasks for our already short-tempered/attention spanned visitors.

incrediBILL

11:54 pm on Jan 9, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



very legitimate ones behind corporate firewalls with no choice in the matter

I'm sorry, office nazis will just have to loosen up the corporate policies.

Not broadcasting referrers from page to page on a site is silly at best.

However, you can still track them with sessions.

gosu

4:50 pm on Jan 10, 2009 (gmt 0)

10+ Year Member



The big bad gun agains spammers I am using:
Use captcha in registration & E-mail confirmation upon registration.
Lock all contact forms for unregistered users, and make them available only for the logged in users.
Ban IP addresses of spammers.
"_"

rocknbil

4:58 pm on Jan 10, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ban IP addresses of spammers.

This is . . . an approach . . . one I've used in the past to a deep extent. But it's a really bad idea.

Why?

Most of the spammers are using compromised computers on otherwise legitimate IP's. So Joe Schmoe gets a trojan on RoadRunner bandwidth (or Sprint, Verizon, whatever) and it gets used by a spammer from time to time. We know the story, they should clean up the computer - but their sale is as good as anyone else's . . .

Food for thought.

gosu

5:23 pm on Jan 10, 2009 (gmt 0)

10+ Year Member



Ban IP addresses of spammers, I mean :
many spammers are using related IP addresses such as (for example):
x.y.a.b
x.y.c.d
x.y.e.f
So what we see here is that a guy who has taken his time to fill your beloved website with junk using the very same ISP.
Obviously we can "surprise" him by banning, using mask
x.y.*.*

Otherwise banning single IP addresses is not that good idea,
and better than banning a WHOLE country, just some of the users using the same ISP will be banned too, which is not a big deal. People gotta hate spammers and blame them :)

[edited by: phranque at 9:37 am (utc) on Jan. 11, 2009]
[edit reason] ip specifics [/edit]

kapow

5:37 pm on Jan 10, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Pick-and-Mix a selection of form filters for your situation:
- Hidden empty field,
- Hidden set field,
- List of dissallowed entries in non-comments fields e.g. http, www, [, <?, .... etc
- Wrong referrer,
- Easy human question,
- Ban IPs by behaviour,
- Captcha,
- ...etc

We manage 100+ business websites for a broad range of clients. We use a combination of 3 of the above and have reduced form spam by 99% for the last 3 years. Plus we,
- Do not reveal that a form entry has been banned,
- Send all banned submissions to a dedicated mailbox, and review every few months. I think we've seen 2 or 3 false positives in as many years.

Ban IP addresses of spammers.

...Most of the spammers are using compromised computers on otherwise legitimate IP's. So Joe Schmoe gets a trojan...and it gets used by a spammer from time to time. We know the story, they should clean up the computer - but their sale is as good as anyone else's.

Not sure I agree. If you get banned because your security is crap, you will learn to get effective security.

kapow

5:45 pm on Jan 10, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have forms on my site that are targeted to businesses and I would legitimately ask for the company URL to their web site. How do I stop the spammer with a filter, but let the legit guy through?

1. Put the url request in a separate field
2. Give that field non-obvious name e.g. xyz,
3. Ban forms that enter: http, www, [,... etc into any other field,
4. Allow: http, wwww, in the xyz field only.

bsterz

7:41 pm on Jan 10, 2009 (gmt 0)

10+ Year Member



One note - I too struggle with this and I'm looking into some JS functions to get away from Captcha. The email filtering solution doesn't work for me, because I still end up with a database filled with invalid entries to give to my client. Yes, I could write routines to clean the data, but as always, elegant solutions work at the source of the problem.

I've seen some solutions that look for mouse movement - I like that idea, but haven't pursued it much yet

caribguy

8:13 pm on Jan 10, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



One thing I haven't sen mentioned yet: form feedback preview.

We use this in combination with a POST requirement, the preview also mangles BBCode and HTML - making it human-readable but unsuitable for spamming...

rocknbil

1:23 am on Jan 11, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



...you will learn to get effective security.

I would . . . you would . . . but the average Joe Schmoe? He'd blame it on your web site (had it happen!,) give the computer away, buy a new one, switch ISP's, kill the problem with money . . . anything but fix it. :-)

grelmar

1:00 am on Jan 12, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



@rocknbill

wow that's a lot of passing around to get to one email. :-)

True, and I won't begin to claim it's an ideal setup. But it has some advantages:

1: The mentioned zero programming skill required.
2: Set it and forget it solution. Once in place, you don't have to tinker with it.
3: Invisible to the user. they have no idea of how things are getting passed around to get screened. The form can be wide open, easy, accessible.
4: Once set, invisible for the admin. You just get notes dropped into your inbox.

My preferred solution is a combo of Akismet (or equivalent) and captcha/recaptcha. On site with traffic below that of a "big name blog", so long as you go to the one time effort of making a custom captcha library, you're pretty much in the clear as far as maintenance goes. Captcha cracking is arduous, and usually relies on brute force methods. So if you replace the stock library (and there are surprisingly few variations of the stock libraries) with one of your own, chances are no one is going to bother coming up with an independent set of rules for your site.

Unless you're a whopping big target, like a big name blog, in which case you're in for a long hard ride. The bigger, more popular you are, the more effort and time you're going to have to put in, because the bigger you are, the dirtbags will be more willing to put in the time and effort.

This 72 message thread spans 3 pages: 72