UBB.Dev
Posted By: arentzen Give harvesters some emailadresses - 05/31/2008 11:53 AM
Hej
This post is dedicated for those who run their forums on shared servers, and do have problems with exceeded bandwidth and harvesters.

Im running UBB 7.2.2 and when I view in the referrer log, I'd noticed a lot of strange visits from spammer-sites which problably harvest emails, and my host told me to decrease bandwidth or moving my board. Therefore I'd like to share a little script which generate false emails and links to harvesters. (Harvesters doesnt respect a robots.txt file!).

The script does only requires PHP, and can be used in all pages or forums.
PHP Code

<?php
/* Script which generates false emailadresses and bogus links in a endless loop */

$min_length = 6; // min. numbers of chars & letters in emailadress
$max_length = 12; // max. numbers of chars & letters in emailadress
$min_emails = 100; // min. numbers of emails
$max_emails = 200; // max. numbers of emails
$min_bogus_links = 1; //min. numbers of bogus links
$max_bogus_links = 5; // max. numbers of bogus links

mt_srand ((double) microtime() * 1000000);
$your_domain = $_SERVER['SERVER_NAME'];
$self = $_SERVER['PHP_SELF'];
$set_to_use = "abcdefghijklmnopqrstuvwxyz_1234567890";
$set_length = strlen($set_to_use);
$number_of_emails = mt_rand($min_emails,$max_emails);

echo
"e-mailadresses<br>";
While (
$number_of_emails > 0)
{
$number_of_emails--;
$this_ones_length = mt_rand($min_length,$max_length);
$s_x = "";
for (
$b_x = 1; $b_x <= $this_ones_length; $b_x++)
{
$s_x = $s_x . $set_to_use[mt_rand(1,$set_length)];
}
echo
"<a href="mailto:".$s_x."@".$your_domain."">".$s_x."@".$your_domain."</a>;  ";

}
echo
"<p>links<br>";
$this_run_bogus_links = mt_rand($min_bogus_links,$max_bogus_links);

While (
$this_run_bogus_links > 0)
{
$this_run_bogus_links--;
$this_ones_length = mt_rand($min_length,$max_length*2);
$s_x = "";
for (
$b_x = 1; $b_x <= $this_ones_length; $b_x++)
{
$s_x = $s_x . $set_to_use[mt_rand(1,$set_length)];
}
echo
"<a href="http://www.".$your_domain."".$self."?".$s_x."">"."http://www.".$your_domain."/".$s_x."</a><br>";
}
?>



Heres a how to do:
1. Copy the script into a text editor and name the file 'emails.php' ( or whatever you prefer)
2. Upload it to server
3. upload 'pixel.gif' to server (NOTE! pixel.gif is a 1x1 transparent pixel, and is therefore invisible)
4. Call the script with a link to it in the top and bottom of your board, ex. header.php and footer.php
HTML
<a href="/emails.php"><img src="/pixel.gif" border="0" alt="" /></a> 

Enjoy!

Attached picture pixel.gif
Attached picture helppixel.gif
Posted By: AllenAyres Re: Give harvesters some emailadresses - 05/31/2008 6:37 PM
Grazie - JustDave did something like this for the old 5-series - anything to give spammers some of their own medicine thumbsup
Posted By: Gizmo Re: Give harvesters some emailadresses - 06/01/2008 1:37 AM
Well, I'd hope you don't have any catchall email addrs setup, as you seem to be referring your own domain, i think it'd be more fun to refer their hostname wink...
Posted By: sirdude Re: Give harvesters some emailadresses - 06/01/2008 6:06 AM
use it as your 404 page laugh
© UBB.Developers