27

My current honey pot on my registration form is an entry for phone number which is placed off screen using position: fixed;.

It tricked a standard breed form filler, but doesn't work as well as I though. Also, the spambots immediately responded to changes in the form, meaning that this is automatic, what can I do.

Note: I hate captchs since the make they users solve my problems which is never good.

GiantCowFilms
  • 1,033
  • 1
  • 15
  • 25

2 Answers2

53

Build a really smart honeypot

That may seem obvious, but here are a few tricks(Details later):

  1. Think Like a spam bot
  2. Assume that they are able to know what is on screen or behind other elements
  3. have multiple traps.
    • Time Trap
    • Honey pot

1. Think like a spam bot:

Start going through your page like a spam bot, You can even write your own which can waist time but is quite fun :). Most spam bots will crawl through the markup looking for a <form> element. Then they will look at your inputs and fill them in appropriately, which is the catch: how do they know what to fill in. They will prbably look at the Id, class, placeholder, and label. which brings us to our first method

Method #1:

Mis label inputs in your form code. Bascily your username input should have the Id of #Form_Email boom! spam bot fills out form incorrectly. Also hide and mislabel your inputs labels, use divs instead.*

Method #2 starts here

You've probably noticed that if you simply ignore hidden stuff, based on location what is in front of it and even the good old display: none;,visibility: hidden;,opacity: 0; or type='hidden'. This gives us a powerful weapon. I discovered this by accident while testing a time trap. I used a basic form filler to fill the form. On my site(I'm not talking about GiantCowFilms.com), the register form is in a dialog that opens when a user clicks a register button. By default it is hidden. This gave me an idea for

Method #2

Default: form is hidden. Basically, your form is hidden on page load, but is uncovered by some mouse based action(I don't think bots have mouses). If you wan't your form to be visible on page load, add a I identical decoy one which is above the real one in the markup.If the bot fills in and submits it, block its Ip for a few minuets.** For really users, simply when the mouse hovers over the decoy form, switch them around.

2. Assume that they know what your page looks like

Assuming that hiding honeypot with CSS is perfect is a grave mistake. Their are a lot of super smart screen readers like JAWS that could be repurposed for spaming. That is why you have multiple lines of defense.

3. Have multiple traps

  • Time Traps: Going back to thinking like a bot, would you wan't to wait on a site instead of attacking others? Method #3:Create a time trap. The best way is to print a time in a hidden input when the page loads. when you submit the form, it tells you how long it took. Fill the form as fast as you can. That should be the minimum amount of time to fill your for.Note: encrypt your time stamp so bots cannot change it.

    If you wan't to get really fancy, measure the WPM of the bot typing. This is done on stack exchange( try copy and pasting then submitting and question/answer). Also if the rate of typing is very consistent, that is a red flag.

  • Honeypots (Method #4): Use all of the above at once for best results. Make sure to trick dumb bots as well as smart bots (don't assume the bot is always trying hard.).

Now, in order to spam us, bots will have to have cursors, render the page, wait, type at a variable realist speed. If they make a bot like that, Then I guess it'll be Captcha time :(.

*People using screen readers will trigger or be confused by these defenses, and depending on your country you could get into trouble for discriminating against blind to semi-blind people. Therefor, when a user triggers the bot test, take them to a non loaded form with a disability friendly captcha like reCaptcha.

**People often share Ips and you can chase away valid users.

P.S. Use simple honey pots like you already have. Some bots are just too dumb to get tricked by what we have here.

GiantCowFilms
  • 1,033
  • 1
  • 15
  • 25
  • 5
    This is the first user that I have seen recommend idiosyncratic techniques for honeypot traps: i.e. the "mis-labelled" fields. I don't know why more people do not recommend this. It works well for me as well. I just don't think that spammers are bright enough to figure out this unusual behaviour. Excellent, excellent answer, which shows some effective analysis and really creative thinking. I'll certainly be stealing some of this from GiantCow. Thank you. – Parapluie Nov 20 '17 at 09:47
  • 3
    Great info. The only bit I don't 100% agree with is the WPM, well I think I don't agree with it because password managers are more common these days, and they will fill fields out automatically (And very quickly). The rest of the stuff is great. Are you collecting any data around this? – Chris Oct 31 '18 at 05:08
  • If you are processing the data server-side, use honeypot traps and server-side processing should effectiveky reduce it to '0' – Kevin Brown Mar 30 '19 at 22:38
  • 4
    You didn't mention the trick that singlehandedly catches 99% of the spam submitted to an e-mail form of mine which looks a little too much like a blog comment form: Case-insensitively blacklist the strings ``, `[/url]`, and `[/link]` and display a human-readable message asking the person to switch to URLs without markup and re-submit. – ssokolow Jul 12 '19 at 10:29
  • also, if it makes sense for your business, block foreign countries from loading your site for example we have a regional senior care company... this solves a lot right away.. of course some will use a VPN, but not too many – ladieu Jan 04 '22 at 17:38
  • 1
    Mouse hover is problematic because people on phones and tablets won't have mouses. – Mnebuerquo Jan 05 '23 at 14:52
19

For years, I've used my own 'form spammer trap' that uses a variety of techniques to block spambots. The most effective is to obscure fields (especially the form's 'action') for a short time period. Since the bot scrapes your form for the fields, and the 'action' page, and uses that info to "CURL" your form data, putting false info in those areas will fool just about all spambots.

After a timeout (JS-based), the obscured values are replaced with their actual values. By the time that happens, the spambot has moved onto another target, and using the bogus values will fail.

I've developed this whole process into a free solution available at my "Form Spammer Trap" site https://www.FormSpammerTrap.com . That site has been around for years, and the contact form there has yet to be successfully 'spam-botted'. (You bots are welcome to try.)

To implement in your site, you add one 'include' and three functions. And you can customize the form with some advanced techniques.

For those that are interested in how a spambot works, and why common 'tricks' such as hidden fields don't work, see here: https://www.securitydawg.com/how-bots-spam-contact-forms/ .

My 'FormSpammerTrap' solution is free (PHP-based), and is available via the Contact form (just check the box to get the free code). No obligations; I don't even save your email address.

But it is quite effective. IMHO.

Added 21 Jun 2020

The "FormSpammerTrap" solution is still around, and has had significant updates over the years. The latest version allows a lot more (and easier) customization of the form, although the basic use only requires one customization entry. The documentation is greatly improved.

And I am working on version 9, which will add even more customization. It should be released in a couple of weeks.

The https://www.FormSpammerTrap.com site has full details of the latest version, how it work, and a link to a blog entry I wrote about how form spammers work (and how they can be blocked).

And it is still free - just fill out the contact form on the site and check the box and get it immediately, with full documentation and samples. It's fully guaranteed or your money back! (well, it is free...)

(And thanks for the upvote. )

Added July 2022

The program is now up to version 15, with version 16 in the works. There are tons of new features, but the process still works - it blocks all bot attempts on a contact form. Take a look at the changelog on the web site.

And, it's still free.

Rick Hellewell
  • 1,032
  • 11
  • 34
  • 4
    Not sure why the downvote (it's always helpful to include the reason for the downvote; helps the person do better here...). The solution I use (and provide for free) works as advertised. You could take the processes I use and convert it into your own code, but the files allow for easy integration into your site. It's been working for many years. (Open invitation to spambots to try to defeat it with their standard processes. Hasn't happened yet.) So a downvote without explanation (anywhere here on Stack) is just not helpful to anyone. – Rick Hellewell Feb 04 '20 at 03:16