PHP to flood email spam bots

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

PHP to flood email spam bots

Post by phice »

I've made a little script that will generate 2000 random emails, in which will flood a spam bot searching for emails.

Average load time: 3sec
Function: Generates 2000 emails
File size: 2kb
Example: http://www.perfectphp.com/random_emails.php

Source:

Code: Select all

<?php
// Start "time taken to load" function
function utime (){
$time = explode( " ", microtime());
$usec = (double)$time[0];
$sec = (double)$time[1];
return $sec + $usec;
}
$start = utime(); 



echo "<a href="$PHP_SELF?list=" . md5(rand(1,9999)) . "" style=font-family:Verdana;font-size:18px;color:000000>Continue to another list of 2000 emails</a><p>\n\n";

for ($i = 0; $i < 2000; $i++) {
$first = rand(0,999) . rand(0,999) . rand(0,999);
$second = rand(0,999) . rand(0,999) . rand(0,999);

// Change numbers to letters
$first = str_replace("0", "a", $first);
$first = str_replace("1", "b", $first);
$first = str_replace("2", "c", $first);
$first = str_replace("3", "d", $first);
$first = str_replace("4", "e", $first);
$first = str_replace("5", "f", $first);
$first = str_replace("6", "g", $first);
$first = str_replace("7", "h", $first);
$first = str_replace("8", "i", $first);
$first = str_replace("9", "j", $first);

$second = str_replace("0", "a", $second);
$second = str_replace("1", "b", $second);
$second = str_replace("2", "c", $second);
$second = str_replace("3", "d", $second);
$second = str_replace("4", "e", $second);
$second = str_replace("5", "f", $second);
$second = str_replace("6", "g", $second);
$second = str_replace("7", "h", $second);
$second = str_replace("8", "i", $second);
$second = str_replace("9", "j", $second);


// Set domain name extention
$ext = rand(0, 9);
$ext = str_replace("0", "com", $ext);
$ext = str_replace("1", "net", $ext);
$ext = str_replace("2", "org", $ext);
$ext = str_replace("3", "us", $ext);
$ext = str_replace("4", "biz", $ext);
$ext = str_replace("5", "info", $ext);
$ext = str_replace("6", "tv", $ext);
$ext = str_replace("7", "cc", $ext);
$ext = str_replace("8", "ws", $ext);
$ext = str_replace("9", "name", $ext);

echo "<a href="mailto:$first@$second.$ext" style=font-family:Verdana;font-size:10px;color:7979BB>$first@$second.$ext</a><br>\n";
}

echo "<p>\n";

// Display "time taken to load" function
$end = utime();
$run = $end - $start;
echo "<font style=font-family:Verdana;font-size:10px;color:000000>Time taken to load: " . substr($run, 0, 5) . " secs";
?>
I'm looking for anyone to improve on this little function to make it faster to load, and will use all letters of the alphabits in the first and second variables. Comments welcome.
Image Image
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Sure i'm willing to help. 8)

I've created some underground mail management and sending programs and the occasional job comes along for creating a spam program so i think i can be of service. :wink:

ill add you to msn shortly.
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post by Gen-ik »

People who encourage the very impersonal, annoying, and down right pathectic 'spam' culture should be repeatedly shot in the head.

Only the dumb and the stupid pay any attention to the crap that spam emails carry along with them, the rest of us have to waste our time deleting them from our inbox.

Spam is like a legal virus.. and personally I think it should be made illegal but tracking down the 'spammers' is tricky.


DON'T ENCOURAGE SPAM!!
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

I've made a little script that will generate 2000 random emails, in which will flood a spam bot searching for emails.
uh? what spam bot where?
To me as lowbrow user it looks like you yield stress on the ISPs that deliever (or not) the mails ;)
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

Post by phice »

No, no.

There are spam bots that crawl the internet, much like googlebot, searching for emails to add to their list. This page will infinitly flood their database with false emails. I should have reworded the message in the previous post.
Image Image
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

ah, those "links" are not supposed to be activated.
ic Image

Code: Select all

<html><body>
<?php
// Start "time taken to load" function
function utime (){
	$time = explode( " ", microtime());
	$usec = (double)$time[0];
	$sec = (double)$time[1];
	return $sec + $usec;
}

function decto26($n)
{
	$ret = '';
	while($n)
	{
		$ret .= chr(($n % 26)+97);
		$n = (int)($n / 26);
	}
	return $ret;
}

$start = utime();
$ext = array('.com', '.net', '.org', '.us', '.biz', '.info', '.tv', '.cc', '.ws', '.name');
$imax = count($ext)-1;
$rmax = getrandmax();
?>
<a href="<?php $_SERVER['PHP_SELF']; ?>?list=<?php echo md5(rand(1,9999)); ?>" style="font-family:Verdana;font-size:18px;color:000000">
	Continue to another list of 2000 emails
</a>
<p>
<?php
for ($i = 0; $i < 2000; $i++)
{
	// Change numbers to letters
	$mail = decto26(rand(17576, $rmax)) . '@' . decto26(rand(17576, $rmax)) . $ext[rand(0, $imax)];
?>
<a href="mailto:<?php echo $mail; ?>" style="font-family:Verdana;font-size:10px;color:7979BB"><?php echo $mail; ?></a>
<br />
<?php
}
echo '</p>';
// Display "time taken to load" function
$end = utime();
$run = $end - $start;
echo "<font style=font-family:Verdana;font-size:10px;color:000000>Time taken to load: " . substr($run, 0, 5) . " secs";
?>
testing a loop with 20.000 iteration this script is slightly faster than the original using all 26 characters
Post Reply