#!/usr/bin/perl ###################################################################### # # [Script]: eatme.pl # # [Version]: v0.10 - 05-07-2007 # # [Author]: Jerome Bruandet # # [Description]: spam bot trap # # [Requires]: apache + perl + mod_rewrite (or mod_security) # # [Installation]: see http://spamcleaner.org/fr/misc/eatme.html # ###################################################################### #======================= USER CONFIGURATION =========================# # alphabets letters used to create fake emails : @alphabet=('a','b','c','d','e','f','g','h','i','j','l','m', 'n','o','p','r','s','t','u','v'); # domain names extensions used for fake emails : @tld=('.net','.com','.org','.fr','.de','.eu'); # fake page extension. By default, '.htm'. # if you want to chane it, change also the the mod_rewrite rule # in your apache conf or .htaccess file : $extension= ".htm"; # Maximum number of characters to generate for the email name # domain name : $max_car=13; # Maximum number of fake emails to create and display on each # fake page. Do not put a value greater than 200 as some bots # could become suspicious it is a trap : $max_emails=150; # number of links to other fake pages to display per page : $max_links=8; # number of fake page to generate : after having sent $max_pages # to the bot, the script will stop creating new ones. This helps # to avoid endless loop. # value should be less than 100 : $max_pages=10; # 404 error message to diplay to your visitors if, by mistake, # on of them trigger the script : $message_404="Error: page not found"; #===================== END USER CONFIGURATION =======================# print "Content-type: text/html\n\n"; print qq~

$message_404

~; print "
"; $nb_letters=@alphabet; $nb_tld=@tld; # $max_pages already displayed ? $URL = $ENV{'REDIRECT_URL'}; if ($URL=~/(\d{1,2})\Q$extension\E$/i){ if ($1>=$max_pages){goto NO_PAGES} $count=$1; } $count++; # Create fake links/pages : $HOST= 'http://'.$ENV{'HTTP_HOST'}; for (1..$max_links){ $HTML_page=&genere_chaine."$count$extension"; print "$HTML_page
\n"; } print "

"; NO_PAGES: # Fake emails : for (1..$max_emails){ $user_name = &genere_chaine; $domain_name=&genere_chaine; $ext=$tld[int(rand($nb_tld))]; print "$user_name\@$domain_name$ext \n"; } print "

"; print ""; exit; ###################################################################### sub genere_chaine{ $chaine=""; $nb_car= rand($max_car); $nb_car+=2 if $nb_car<4; for (1..$nb_car){ $letter = int(rand($nb_letters)); $chaine.=$alphabet[$letter]; } return $chaine; } ######################################################################