Forum Moderators: open

Message Too Old, No Replies

How to foul a spambot...

         

littleman

6:25 am on Mar 19, 2002 (gmt 0)



One way is to cloak your email address. That is what this little script does. It will work on most email harvesters. Call it via ssi where you would be putting your email address. Something like this:
<a href="mailto:<!--#exec cgi="email.pl" -->"><!--#exec cgi="email.pl" --></a>

Here is the script:

#!/usr/local/bin/perl
#your path to perl

$email = 'l_ttleman@yahoo.com'; #your email

print "Content-type: text/html\n\n";
if (
$ENV{'HTTP_USER_AGENT'} =~ /^Mozilla/ &&
($ENV{'HTTP_ACCEPT_LANGUAGE'} or $ENV{'HTTP_ACCEPT_ENCODING'=~ /gzip/})
){
print $email;
}
##There are a couple of bots that use a local referer to try to spoof scripts,
##so you *may* want to comment out this elsif
elsif ($ENV{'HTTP_REFERER' =~/$ENV{'SERVER_NAME'}/ }){
print $email;
}
else {
$email =~ s/\@/_\'AT\'_/;
$email =~ s/\./_\'D0T\'_/;
print $email;
}

Of course you could also adapt it to work from within a script as a subroutine.

ggrot

6:55 am on Mar 19, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Another interesting thing to do if you run the mail server for a domain is to return a special email address to bots and only bots. You could return something like spam123-456-789-012@example.com where the ip of the bot requesting the page is 123.456.789.012. Generally a spammer will be very careful about hiding behind open relay servers and the such when sending spam, but may not always be so careful when harvesting email addresses. When the spam comes in, you'll know the ip address of the harvester bot and you can send the isp a nice message or ban it from ever accessing your site again, etc.

Key_Master

8:16 am on Mar 19, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is an example [banbots.com] of an e-mail/url cloaking script I've been working on. It's not perfect but there is only so much you can do. It is very difficult to protect something that was (in theory) made to be public.

Littleman, don't forget Opera users :):

$ENV{'HTTP_USER_AGENT'} =~ /^Mozilla¦^Opera/ &&

volatilegx

6:52 pm on Mar 20, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ggrot,

You are my hero! That's a great idea!