Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

Spam trap. Even better than James'

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> Site Suggestions
View previous topic :: View next topic  
Author Message
Joe Man




Joined: 21 Jan 2004
Posts: 742
Location: S. Latitude 47°9', W. Longitude 123°43'

PostPosted: Sat Jan 29, 2005 8:32 am    Post subject: Spam trap. Even better than James' Reply with quote

http://www.absforums.com/index.php?showtopic=37308&st=0&#entry1284364
Behold. This might actually be useful to you, though it might not. I thought it might be interesting.

Code:
<?php

/***********************
 * SpikeTrap           *
 * by rmuser           *
 * v006                *
 * Started 27 Jan 2005 *
 * Updated 29 Jan 2005 *
 ***********************/

$minlen = 4;
$maxlen = 13;
$minaddr = 18;
$maxaddr = 113;
$minlinks = 7;
$maxlinks = 33;

$alphabet = array('a',
                  'a',
                  'b',
                  'c',
                  'd',
                  'e',
                  'e',
                  'f',
                  'g',
                  'h',
                  'i',
                  'i',
                  'j',
                  'k',
                  'l',
                  'm',
                  'n',
                  'o',
                  'o',
                  'p',
                  'q',
                  'r',
                  's',
                  't',
                  'u',
                  'u',
                  'v',
                  'w',
                  'x',
                  'y',
                  'z');
                 
$tlds = array('.com',
              '.com',
              '.com',
              '.com',
              '.com',
              '.com',
              '.com',
              '.net',
              '.net',
              '.net',
              '.net',
              '.net',
              '.org',
              '.org',
              '.org',
              '.edu',
              '.gov',
              '.mil',
              '.biz',
              '.info',
              '.us',
              '.co.uk',
              '.ac.uk',
              '.org.uk',
              '.com.au',
              '.co.nz',
              '.co.jp',
              '.ne.jp',
              '.ac.jp',
              '.fi',
              '.se',
              '.de',
              '.nl',
              '.ws',
              '.cc',
              '.tv',
              '.ch',
              '.no',
              '.be',
              '.ca',
              '.cx',
              '.pl',
              '.ru',
              '.tk');

function microrand() {
    list($usec, $sec) = explode(' ', microtime());
    return (float)$usec * 1000000;
}

function gen_addr() {
    global $minlen, $maxlen, $alphabet, $tlds;
    $namelen = mt_rand($minlen, $maxlen);
    $domainlen = mt_rand($minlen, $maxlen);
    $tld = $tlds[mt_rand(0, count($tlds)-1)];
    $name = '';
    for ($n = 0; $n <= $namelen; $n++) {
        $name .= $alphabet[mt_rand(0, count($alphabet)-1)];
    }
    $domain = '';
    for ($d = 0; $d <= $domainlen; $d++) {
        $domain .= $alphabet[mt_rand(0, count($alphabet)-1)];
    }
    echo '<a href="mailto:' . $name . '@' . $domain . $tld . '">' . $name . '@' . $domain . $tld . '</a>';
}

function gen_addr_nolink() {
    global $minlen, $maxlen, $alphabet, $tlds;
    $namelen = mt_rand($minlen, $maxlen);
    $domainlen = mt_rand($minlen, $maxlen);
    $tld = $tlds[mt_rand(0, count($tlds)-1)];
    $name = '';
    for ($n = 0; $n <= $namelen; $n++) {
        $name .= $alphabet[mt_rand(0, count($alphabet)-1)];
    }
    $domain = '';
    for ($d = 0; $d <= $domainlen; $d++) {
        $domain .= $alphabet[mt_rand(0, count($alphabet)-1)];
    }
    echo $name . '@' . $domain . $tld;
}

function gen_link($ext = '.html') {
    global $minlen, $maxlen, $alphabet;
    $namelen = mt_rand($minlen, $maxlen);
    $name = '';
    for ($n = 0; $n <= $namelen; $n++) {
        $name .= $alphabet[mt_rand(0, count($alphabet)-1)];
    }
    echo '<a href="http://' . $_SERVER['SERVER_NAME'] . $_SERVER['SCRIPT_NAME'] . '/' . mt_rand(1, 99999999999) . $ext . '">' . $name . '</a>';
}

function gen_text($len = 8) {
    global $alphabet;
    $text = '';
    for ($t = 0; $t <= $len; $t++) {
        $text .= $alphabet[mt_rand(0, count($alphabet)-1)];
    }
    echo $text;
}

// Access logging
$logfp = fopen('/home/ninjas/traplog.txt', 'a');
$loginfo = date("[H:i:s T j F Y]\t") . 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] . "\t" . $_SERVER['REMOTE_ADDR'] . "\t" . gethostbyaddr($_SERVER['REMOTE_ADDR']) . "\t" . $_SERVER['HTTP_USER_AGENT'] . "\n";
fwrite($logfp, $loginfo);
fclose($logfp);

if (!isset($_SERVER['PATH_INFO'])) {
    mt_srand(microrand());
}
else {
    $path = explode('/', $_SERVER['PATH_INFO']);
    $path = explode('.', $path[1]);
    if (empty($path[0])) {
        mt_srand(microrand());
    }
    elseif (!is_numeric($path[0])) {
        mt_srand(microrand());
    }
    elseif (strlen($path[0]) > $maxlen) {
        mt_srand(microrand());
    }
    else {
        mt_srand($path[0]);
    }
}

$pattern = mt_rand(0, 2);
sleep(3);
switch ($pattern) {
    case 0:
        ?>
<HTML>
<HEAD>
<TITLE><?php for ($g = 0; $g <= mt_rand(1, 5); $g++) { gen_text(mt_rand(3, 11)); echo ' '; } ?></TITLE>
<META NAME="robots" CONTENT="noindex,nofollow">
</HEAD>
<BODY>
<P>
<?php
for ($w = 0; $w <= mt_rand(5, 19); $w++) {
    gen_text(mt_rand(3, 11));
    echo ' ';
}
?>
</P>
<P>
<?php
for ($a = 0; $a <= mt_rand($minaddr, $maxaddr); $a++) {
    gen_addr();
    echo "<BR>\n";
}
?>
</P>
<P>
<?php
for ($b = 0; $b <= mt_rand($minaddr, $maxaddr); $b++) {
    gen_addr_nolink();
    echo ' ';
}
?>
</P>
<P>
<?php
for ($l = 0; $l <= mt_rand($minlinks, $maxlinks); $l++) {
    gen_link('.html');
    echo ' ';
}
?>
</P>
<P>
<?php
for ($w = 0; $w <= mt_rand(7, 28); $w++) {
    gen_text(mt_rand(3, 11));
    echo ' ';
}
?>
</P>
</BODY>
</HTML>
        <?php
        break;
    case 1:
        echo '<?xml version="1.0" encoding="iso-8859-1"?','>';
        ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title><?php for ($g = 0; $g <= mt_rand(2, 8); $g++) { gen_text(mt_rand(4, 9)); echo ' '; } ?></title>
<meta name="robots" content="noindex,nofollow" />
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<div>
<?php
for ($a = 0; $a <= mt_rand($minaddr, $maxaddr); $a++) {
    gen_addr();
    echo ' ';
}
?>
<br /><br />
<?php
for ($w = 0; $w <= mt_rand(8, 27); $w++) {
    gen_text(mt_rand(6, 15));
    echo ' ';
}
?>
<br /><br />
<?php
for ($b = 0; $b <= mt_rand($minaddr, $maxaddr); $b++) {
    gen_addr_nolink();
    echo "<br />\n";
}
?>
<br />
<?php
for ($w = 0; $w <= mt_rand(7, 28); $w++) {
    gen_text(mt_rand(3, 11));
    echo ' ';
}
?>
<br /><br />
<?php
for ($l = 0; $l <= mt_rand($minlinks, $maxlinks); $l++) {
    gen_link('.php');
    echo "<br />\n";
}
?>
</div>
</body>
</html>
        <?php
        break;
    case 2:
        ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title><?php for ($g = 0; $g <= mt_rand(3, 7); $g++) { gen_text(mt_rand(2, 7)); echo ' '; } ?></title>
<meta name="robots" content="noindex,nofollow">
</head>
<body>
<?php
for ($b = 0; $b <= mt_rand($minaddr, $maxaddr); $b++) {
    gen_addr_nolink();
    echo ' ';
}
?>
<br><br>
<?php
for ($a = 0; $a <= mt_rand($minaddr, $maxaddr); $a++) {
    gen_addr();
    echo "<br>\n";
}
?>
<br>
<?php
for ($w = 0; $w <= mt_rand(5, 19); $w++) {
    gen_text(mt_rand(3, 11));
    echo ' ';
}
?>
<br><br>
<?php
for ($l = 0; $l <= mt_rand($minlinks, $maxlinks); $l++) {
    gen_link('.htm');
    echo ' ';
}
?>
</body>
</html>
        <?php
        break;
}
?>

_________________
"Everyone has 200,000 bad drawings in them, the sooner you get them out the better."
~Charles Martin Jones

Last edited by Joe Man on Fri Dec 13, 1957 1:21 am; edited 2,892 time in total
Back to top
View user's profile Send private message Send e-mail
cabbageking
...worships at your feet!




Joined: 02 Nov 2004
Posts: 52

PostPosted: Wed Feb 02, 2005 9:49 am    Post subject: Reply with quote

Either the world's gone mad or your talking a language I don't understand. But it sounds interesting Razz ! What is it? Obviously a spam trap but how does it work?
_________________
The Daleks are coming!! Woooo!
Back to top
View user's profile Send private message Visit poster's website
raezr




Joined: 19 Feb 2005
Posts: 3

PostPosted: Sat Feb 19, 2005 2:31 pm    Post subject: Reply with quote

It generates random fake emails and links that appear to go to other sites but really return to the spam trap. What ends up happening is that spam bots will collect hundreds of fake emails and go in circles.

It doesn't stop spam but is a way to get back at annoying bots that only use up your bandwidth and flood your inbox.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> Site Suggestions All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group