* * based on wpoison.pl - Version 1.8p by Ronald F. Guilmette * * This port was written by Jason A. Borgmann * * Below you will find the original copyright and disclaimer for Ronald's * wpoison.pl script. * * For usage instructions see http://www.monkeys.com/wpoison/ * * Original idea by Ronald F. Guilmette * Code implemented by Ronald F. Guilmette * * Copyright (c) 2000,2001 Ronald F. Guilmette; All rights reserved. * * Redistribution and use in source form ONLY, with or without modification, * is permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by Ronald F. Guilmette. * 3. Neither the name of Ronald F. Guilmette nor the names of other con- * tributors to this software may be used to endorse or promote products * derived from this software without specific prior written permission. * 4. Either a copy of, or a link to the official Wpoison logo graphic (which * may be found at http://www.monkeys.com/wpoison/logo.gif) must be * included in, and clearly and legibly visible on the home page of any * web site which uses, employs, includes, or makes reference to this * software or any derivative or modified version thereof. Also, the * official Wpoison logo itself must be include in an HTML hyperlink * so that any usser clicking on any part of the logo image will be * directed/linked to the Wpoison home page at: * * http://www.monkeys.com/wpoison/ * * In order to satisfy this requirement, you may simply include the * following HTML code somewhere (anywhere) on your web site home page: * * * * * * Disclaimer * ---------- * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ $pname = "wpoison"; $tmp_words_file = "/tmp/wpoison.words"; $num_cached_words = 4096; $randwords = ""; $tl_domains_1 = array("com", "com", "com", "com", "net", "net", "net", "org", "org", "edu", "edu", "gov", "mil", "int"); $tl_domains_2 = array( "uk", "su", "af", "al", "dz", "as", "ad", "ao", "ai", "aq", "ag", "ar", "am", "aw", "au", "at", "az", "bs", "bh", "bd", "bb", "by", "be", "bz", "bj", "bm", "bt", "bo", "ba", "bw", "bv", "br", "io", "bn", "bg", "bf", "bi", "kh", "cm", "ca", "cv", "ky", "cf", "td", "cl", "cn", "cx", "cc", "co", "km", "cg", "ck", "cr", "ci", "hr", "cu", "cy", "cz", "dk", "dj", "dm", "do", "tp", "ec", "eg", "sv", "gq", "er", "ee", "et", "fk", "fo", "fj", "fi", "fr", "fx", "gf", "pf", "tf", "ga", "gm", "ge", "de", "gh", "gi", "gr", "gl", "gd", "gp", "gu", "gt", "gn", "gw", "gy", "ht", "hm", "hn", "hk", "hu", "is", "in", "id", "ir", "iq", "ie", "il", "it", "jm", "jp", "jo", "kz", "ke", "ki", "kp", "kr", "kw", "kg", "la", "lv", "lb", "ls", "lr", "ly", "li", "lt", "lu", "mo", "mk", "mg", "mw", "my", "mv", "ml", "mt", "mh", "mq", "mr", "mu", "yt", "mx", "fm", "md", "mc", "mn", "ms", "ma", "mz", "mm", "na", "nr", "np", "nl", "an", "nc", "nz", "ni", "ne", "ng", "nu", "nf", "mp", "no", "om", "pk", "pw", "pa", "pg", "py", "pe", "ph", "pn", "pl", "pt", "pr", "qa", "re", "ro", "ru", "rw", "kn", "lc", "vc", "ws", "sm", "st", "sa", "sn", "sc", "sl", "sg", "sk", "si", "sb", "so", "za", "gs", "es", "lk", "sh", "pm", "sd", "sr", "sj", "sz", "se", "ch", "sy", "tw", "tj", "tz", "th", "tg", "tk", "to", "tt", "tn", "tr", "tm", "tc", "tv", "ug", "ua", "ae", "gb", "us", "um", "uy", "uz", "vu", "va", "ve", "vn", "vg", "vi", "wf", "eh", "ye", "yu", "zr", "zm", "zw"); $abet = array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"); function death($message) { global $pname; echo ' Content-Type: text/html WPOISON - Unexpected Error '; print $pname . ": " . $message; echo ' '; exit; } function gen_new_random_words_list() { global $tmp_words_file, $num_cached_words; if(file_exists($tmp_words_file)) { if(!unlink($tmp_words_file)) { death("Error unlinking file: " . $tmp_words_file); } } if(file_exists("/usr/dict/words")) { $dictfile = "/usr/dict/words"; } elseif(file_exists("/usr/share/dict/words")) { $dictfile = "/usr/share/dict/words"; } elseif(file_exists("words")) { $dictfile = "words"; } else { death("Cannot find dictionary file!"); } if(!$fp = fopen($dictfile, "r")) { death("Error opening dictionary file: " . $dictfile); } $file = fread($fp, filesize($dictfile)); fclose($fp); $total_words = 0; $exp_file = explode("\n", $file); foreach($exp_file as $exp_item) { $total_words++; } if(!$fp = fopen($tmp_words_file, "w")) { death("Error opening tmp words file: " . $tmp_words_file); } for($i=1;$i<=$num_cached_words;$i++) { $rand_index = mt_rand(0, $total_words); if($already_taken[$rand_index]) { $i--; } else { $already_taken[$rand_index] = 1; fwrite($fp, $exp_file[$rand_index]); fwrite($fp, "\n"); } } } function read_random_words() { global $tmp_words_file, $randwords; if(!$fp = fopen($tmp_words_file, "r")) { death("Error opening tmp words file: " . $tmp_words_file); } $file = fread($fp, filesize($tmp_words_file)); fclose($fp); $randwords = explode("\n", $file); } function random_word() { global $randwords, $num_cached_words; $word_index = mt_rand(0, $num_cached_words); return $randwords[$word_index]; } function gen_random_words($min, $max) { global $randwords, $num_cached_words; $num_words = $min + (mt_rand(0, $max - $min)); for($i=1;$i<=$num_words;$i++) { $word_index = mt_rand(0, $num_cached_words); $word_list .= $randwords[$word_index]; if($i < $num_words) { $word_list .= " "; } } return $word_list; } function gen_random_color() { $red_color = mt_rand(0,256); $green_color = mt_rand(0,256); $blue_color = mt_rand(0,256); $color_code = '#' . $red_color . 'x' . $green_color . 'x' . $blue_color . 'x'; return $color_code; } function random_letter() { global $abet; $tmp = mt_rand(0, 26); return $abet[$tmp]; } function random_domain() { global $tl_domains_1, $tl_domains_2; if(mt_rand(0,4) == 0) { return $tl_domains_2[mt_rand(0,count($tl_domains_2)-1)]; } else { return $tl_domains_1[mt_rand(0,count($tl_domains_1)-1)]; } } if(!file_exists($tmp_words_file)) { gen_new_random_words_list (); } else { $creation_time = stat($tmp_words_file); $age_in_seconds = time() - $creation_time[9]; if($age_in_seconds > (30 * 60)) { gen_new_random_words_list(); } } print read_random_words(); echo ' '; print gen_random_words(2,6); echo ' '; print gen_random_words (10, 30); echo '

'; $num_addresses = 2 + mt_rand(0, 16); for($i=1;$i<=$num_addresses;$i++) { $email_addr = random_word(); $email_addr .= "@"; if(mt_rand(0,4) == 0) { $email_addr .= random_word() . "."; } $email_addr .= random_word() . random_letter() . "." . random_domain(); echo ' ' . $email_addr . '
'; } echo '

'; print gen_random_words(2, 20); # echo ' #

# '; #$num_links = 1 + mt_rand(0, 16); #for($i=1;$i<=$num_links;$i++) #{ # echo ' # ' # . gen_random_words(1, 9) . # '
# '; #} #echo ' #

# '; print gen_random_words(2, 20); # Sleep for four seconds when finishing each page to avoid server overload. sleep (4); echo ' '; exit; ?>