After my rant on stupid manual spammers, I thought I'd let you guys know some ways they you can stop automated form spam bots.
One way to trap spam bots is to name your obvious form fields like name and email to something that means nothing. Then you would create hidden form fields, but using the obvious names like name and email. The dumb form bot will likely fill in the hidden fields, which is easily detectable by your form processing script.
There is another trick that requires Javascript, but will make it impossible for a bot to use your form. The form action is omitted so that the form will do nothing without the Javascript 'activating' it. The code would look like this:
Make sure to change FORMACTIONHERE.ASP to whatever your form action was before.
A final tip I have is on how to stop a particular bot that tries to hack your mail forms to broadcast spam to their email list. This bot tries to take advantage of security problems in certain mail scripts to turn your server into a spam relay. The fix for this requires you to edit your mail script and to have an understanding of how it works. If you cannot do this step, the above measures will also likely stop this bot.
There are two signatures of this bot. One is that it will put a few lines of garbage (MIME code actually) into fields like Email and Subject, which should only be one line. The way to catch this is to check for a valid email and make sure that the To, From, and Subject fields are no longer than one line.
The next signature is that it will use your own domain name for its email addresses. For example, it will claim its email is name@yourdomain.com. To trap this, make sure no one can use your domain name for their email address.
One way to trap spam bots is to name your obvious form fields like name and email to something that means nothing. Then you would create hidden form fields, but using the obvious names like name and email. The dumb form bot will likely fill in the hidden fields, which is easily detectable by your form processing script.
Code:
<form>
<input type="hidden" name="email">
<input type="hidden" name="name">
Name: <input type="text" name="elnombre1"><br>
Email: <input type="text" name="addr">
<input type="submit" value="Send">
</form>
There is another trick that requires Javascript, but will make it impossible for a bot to use your form. The form action is omitted so that the form will do nothing without the Javascript 'activating' it. The code would look like this:
Code:
<form name="TheForm" method="post">
<script language="Javascript">
document.onLoad = ActivateForm();
function ActivateForm() {
objForm = document.forms['TheForm'];
if (objForm) {
objForm.action = 'FORMACTIONHERE.ASP';
}
}
</script>
<!-- The Rest of Your Form Here -->
<input type="submit" value="Send">
</form>
Make sure to change FORMACTIONHERE.ASP to whatever your form action was before.
A final tip I have is on how to stop a particular bot that tries to hack your mail forms to broadcast spam to their email list. This bot tries to take advantage of security problems in certain mail scripts to turn your server into a spam relay. The fix for this requires you to edit your mail script and to have an understanding of how it works. If you cannot do this step, the above measures will also likely stop this bot.
There are two signatures of this bot. One is that it will put a few lines of garbage (MIME code actually) into fields like Email and Subject, which should only be one line. The way to catch this is to check for a valid email and make sure that the To, From, and Subject fields are no longer than one line.
The next signature is that it will use your own domain name for its email addresses. For example, it will claim its email is name@yourdomain.com. To trap this, make sure no one can use your domain name for their email address.