sugarplum-0.9.10/0040755000076400007640000000000007642302247012302 5ustar aquaaquasugarplum-0.9.10/sample-spammers0100644000076400007640000000476007642302247015337 0ustar aquaaqua# $Id: sample-spammers 44 2003-02-01 22:56:20Z aqua $ # # Edit this file to your liking. Add your favorite spammers. # Since most spammers change addresses rapidly, keep in mind that # the list will go out of date rapidly. # # Lines beginning with # are ignored as comments. # owner-calypsocash-l@trinidad.kiteva.com jai15@prodigy.com herbalpc@ix.netcom.com biz-ness@mailexcite.com mmok9@yahoo.com brgt@yahoo.com prospace@hadron.prospace.org cheekk@ols.com tur818r@yahoo.com Siamand@aol.com RNYOGI@aol.com info@harris-marketing.com sales@trafficboost.com ARGOS06@aol.com WToler5973@aol.com saetm@hotbot.com ralabes@ta.telecom.com.ar JACKSHFR@aol.com WiseFolk@yahoo.com hnet1@usa.net SeeInfoBelow@yahoo.com srt122a@yahoo.com 4988756@earthlink.net kpang@cyberslice.com notifier@cyberslice.com bermendon@mailexcite.com lycosnews@tripod.com info@inexchange.net notifier@cybermeals.com 41552492@ix.netcom.com poiyutty@ytrfbpe.concentric.com hosting@ns.falconsoft.com gamingcorp@hotmail.com info@inexchange.net 7272259@mcimail.com hunterlm@csn.org sweetp@dash.com gwrld@xoom.com rokk2@newmail.net notifier@cyberslice.com gwrld@xoom.com Proapro@ibm.net info@kcsmarketing.com pcfactoryoutlet.com sweetp@dash.com maxrad@RVMS.COM barnes&noble@appliedinfogroup.com download@infobyte.com sysop@infobyte.com vwxgfmtckq@msn.com igmimpaeeu@aol.com merchant995@association.as staff@appwatch.com jdrowell@mail.jdrowell.com marketing29@uole.com mortgageLoans@ns.fsps-mo.ru info0104@whiteraintime.com info0305@myboobear.com money072@amnet.net james979@usa.net clustnw@cip.es Katherine@dwp.co.kr off394l@mail.redhot.com.tw janet6906@usa.net o3418@flashmail.com ebiziness2000@verizonmail.com xva@int.2ndmail.com asd43k@space.com qaxx81@techpointer.com yuffbazf@sunpoint.net netcitizen@worldnet.att.net qzcr@dog.com superman67@hotmail.com info7@reply-svcs.net joe454@hongkong.com yobes@mail7.e-specials-network.com iceman427@earthlink.net dfbn@123india.com wlovene@sccoast.net streambiz2001@aol.com dwlc@mindspring.com getterx@emails.com sendme@earth.com money00d@fol.net jamses8097@msn.com holye101@aol.com real-estate-center26@excite.com robert@contextcapital.com mrtravel5@excite.com moneyacg@amnet.net envios_correo1@hotmail.com tradecj@amnet.net kr21g@ragingbull.com wantmail900@soon.com joe454@hongkong.com dyrd@deseretmail.com rent1hkaz@amnet.net belots@cin.net # legitimate addresses, but belonging to spam-friendly ISPs &c abuse@psi.net sales@psi.net abuse@aol.com abuse@dialsprint.net abuse@pbi.net abuse@mindspring.net abuse@teleline.es usenet@terra.es sugarplum-0.9.10/install.sh0100755000076400007640000000243307642302247014306 0ustar aquaaqua#! /bin/bash # $Id: install.sh 44 2003-02-01 22:56:20Z aqua $ # Edit the following to suit your system PREFIX=/usr/local/ PERL=`which perl` SED=`which sed` CONFDIR=/etc/sugarplum LOGFILE=/var/log/sugarplum.log BINDIR=$PREFIX/bin CGIDIR=/home/httpd/cgi-bin WEBGROUP=root # The rest shouldn't need editing, but do so anyway if you feel the need for dir in $PREFIX $PREFIX/bin $PREFIX/etc $CGIDIR ; do if [ ! -d $dir ] ; then echo $dir is not a directory, please edit $0 exit fi done if [ ! -e "$PERL" ] ; then echo Can\'t find perl at $PERL, please edit $0 exit fi if [ ! -e "$SED" ] ; then echo Can\'t find sed at $SED, please edit $0 exit fi if ( ! grep -q "^$WEBGROUP:" /etc/group ) ; then echo "Group $WEBGROUP does not exist, please edit $0" exit fi if [ ! -d "$CONFDIR" ] ; then install -m 0750 -d $CONFDIR install -m 0710 -d $CONFDIR/attacks fi if [ ! -e "$LOGFILE" ] ; then touch "$LOGFILE" chgrp $WEBGROUP "$LOGFILE" chmod 0620 "$LOGFILE" fi if [ ! -d "$CGIDIR/sugarplum" ] ; then install -m 0755 -d $CGIDIR/sugarplum fi if [ "X$PERL" = "X/usr/bin/perl" ] ; then install -m 0755 poison $CGIDIR/sugarplum/ else $SED "s:^#\!/usr/bin/perl:#\!$PERL:" < poison > $CGIDIR/sugarplum/poison chmod 0755 $CGIDIR/sugarplum/poison fi sugarplum-0.9.10/sample.conf0100644000076400007640000001132507642302247014431 0ustar aquaaqua# Sugarplum configuration # # The format is name:value (perl pattern \w+:\s*(\S.*)), # and is subject to machine-translatable change in future revisions. Blank # lines and lines beginning with # (leading whitespace permitted) are ignored. # # Values presented here are the defaults. # log level (0 for no logging besides the webserver's own) # # loglevel: 0 # log file (if loglevel set true) # # logfile: /var/log/sugarplum.log # Should sugarplum work deterministically? If set true, a given URL # will always seed perl's RNG with a consistent value (sum of the ordinal # values of the bytes in the PATH_INFO variable) -- consequently the same # random values will be picked, so multiple reloads of any given URL in # sugarplum will produce identical output. Hence if a harvester were to # check for poison by comparing data on subsequent loads, they won't be # tipped off. # # deterministic: 1 # If set, the system hostname will be included in the seed in # deterministic mode. This introduces variance into different # sugarplum installations with identical paths (e.g. /sugarplum/), # thus preventing an attacker from doing hash-based poison # avoidance. This is desirable in all cases other than when # using sugarplum on sites run on clustered servers, where the # hostname may not be consistent across multiple loads of the # same URI. # deterministic_by_hostname: 1 # If set, the HTTP server name will be rolled into the seed # in deterministic mode. This yields differing sugarplum # output across different virtualhosts, or indeed across # different servers. A possible drawback is that it may be # possible for an attacker to detect the poison programmatically # on sites using wildcard-matched vhosts. # deterministic_by_httphost: 1 # path to the dictionary # # dictfile: /usr/share/dict/words # Path to a list of predefined addresses to be included in output. # Not needed if use_spammerlist is set false. # # spammerfile: /etc/sugarplum/spammers ## Address balances # If true, randomly generated email addresses will be # included in the output. See poison_address_frequency. # # use_poison_addresses: 0 # If true, generated addresses will be used based on those # inside your teergrube -- see address_teergrube_frequency. # # use_teergrube_addresses: 1 # If true, entries from 'spammerfile' will be be included as addresses. See # poison_spammer_frequency. # # use_spammerlist: 0 ## HTML output characteristics # How many paragraphs of poisoned output? # # poison_paragraphs: 4 # Should the background be randomized? (arguably improves # page plausibility, but often looks wonky to humans) # # poison_random_background: 1 # How deep should the URLs recurse (remember, this is # an exponential factor) # # poison_maxdepth: 4 # Minimum number of words per paragraph? # # poison_paragraph_wordcount_base: 50 # Random range of words beyond the base? # # poison_paragraph_wordcount_range: 75 # Column before which lines in output should have newlines # appended; simulates editor linewrap. Set very high to # disable linewrap. # # poison_paragraph_linewrap_col: 78 # What percentage of email addresses should be derived from a # dictionary word? (range 0 to 1 inclusive) # # poison_word_username_frequency: 0.6 # and of those, what percentage should have numbers attached to the # end (as with AOL and similar providers)? (0-1 inclusive) # # poison_wordnumber_username_frequency: 0.3 # ...and if so, up to how many digits? # # poison_wordnumber_username_maxdigits: 4 # The below should add up to 1 in any combination. # poison_spammer_frequency has been renamed -- poison_address_frequency # now specifies the frequency of all addresses, while # address_spammer_frequency (below) denotes the portion of addresses # taken from known spammers. # Percentage of words which should be poisoned addresses (see below) # # poison_address_frequency: 0.02 # Percentage of words which should be normal words # # poison_dictword_frequency: 0.98 # Settings regulating what proportions of address types will be # emitted -- should add up to 1. Any zero value disables the feature. # Percentage of addresses emitted which should be taken from # the list of known spammers (0 to disable) # # address_spammer_frequency: 0.2 # Percentage of addresses emitted which should be generated in # the teergrube (randomuser@teergrube.domain.tld): # # address_teergrube_frequency: 0.4 # Percentage of addresses emitted which should simply be totally # random (0 to disable): # # address_random_frequency: 0.4 ## Teergrube configuration # A fully-qualified hostname to be used in teergrube addresses. This # should be the address of your teergrube host if you have one, or a suitable # invalid address if not. # # teergrube_address_fqdn: thick-sticky-stuff.invalid.tld sugarplum-0.9.10/decode_teergrube.pl0100755000076400007640000000234707642302247016134 0ustar aquaaqua#!/usr/bin/perl # $Id: decode_teergrube.pl 44 2003-02-01 22:56:20Z aqua $ # # Decodes teergrube-bait addresses emitted by sugarplum. Addresses will be # decoded either from the commandline or stdin. # grep($_ eq '-h',@ARGV) and do { print "usage: $0 addr1 addr2 ...\n", "Run without arguments, accepts a list of addresses on stdin,", " one per line.\n"; exit; }; if (@ARGV) { for (@ARGV) { print &decode_teergrube_address($_) || 'not a teergrube address', "\n"; } exit; } while (<>) { chomp; print &decode_teergrube_address($_) || 'not a teergrube address',"\n"; } sub decode_teergrube_address { my $uname = shift || return undef; $uname = lc $uname; $uname =~ /^([a-z])([a-z])([a-z]{8,})/ or return undef; my $permutation = ((ord($1)-97)<<4) | ord($2)-97; $uname = $3; my @addr; for (0..7) { if ($permutation & 1<<$_) { $uname = substr($uname,0,$_).substr($uname,$_+1); } } @addr = (); for (0..3) { push @addr, ((ord(substr($uname,$_,1))-97<<4) | (ord(substr($uname,$_+4,1))-97)); } wantarray and return @addr; join('.',@addr); } sugarplum-0.9.10/ChangeLog0100644000076400007640000001107107642302247014051 0ustar aquaaquav0.9.10, Tue Apr 1 03:51:36 PST 2003 - Revised the seeding of deterministic mode. Added seeding based on hostname, to vary sugarplum instances installed on identical paths. Added seeding based on HTTP_HOST for variance across different virtualhosts, suggested by Robert Loomans . - The "cowardly refusal to go 1.0" release v0.9.9, Sat Feb 1 14:57:43 PST 2003 - Minor bugfix release; comments from the spammerlist (or the dictionary, if any happened to be there) were being used as valid address lines. Sugarplum now reseeks when it finds such a line. Reported by Eric Bischoff . v0.9.8, Fri Sep 27 04:07:38 PDT 2002 - Major revisions after an extended dormancy, during which time various spammer tactics had gone out of fashion. - Removed DoS counterattack facility removed. All significant operating systems now have sufficiently robust IP stacks as to make this pointless. - Cycling agent detection removed, since without counterattacks it's no longer useful. - GDBM dictionaries are no longer used -- flat dictionary and spammer lists are now obtained by way of random seeks within their original files. This saves space, is more maintainable, and according to my benchmarks is slightly faster. - The poison CGI is now configured by way of an external config file, not by editing the code itself. - All configuration options may now be adjusted on the commandline. - Sample configurations no longer match "Teleport" as a harvester; Teleport and Teleport Pro are now giving the impression of legitimate offline cache bots. - Teergrube addressing is now the default. This is a response to criticism of random address generation's potential to collide with legitimate addresses. Random address generation is still available, but disabled in the interest of producing a "safe by default" install. - Deterministic mode is now the default. - The ratio of addresses to normal words has been decreased slightly (0.02-0.98 vs 0.05-0.95). v0.8.4, Thu Dec 28 03:19:24 PST 2000 - Added teergrube baiting. Sugarplum can now generate addresses for a teergrube (tarpit) or other deliberately-provided spam target. The IP address of the address harvester is encoded into the "bait" addresses. - Added "deterministic" mode, where the Perl RNG is seeded with a number computed from the PATH_INFO variable -- hence the same URL, requested twice, will generate the same output. This makes the poison difficult to detect by hitting a URL twice and comparing the output. Suggested by Dominique Quatravaux , though this is a tiny crude version of her much better suggestion. This will only work assuming a deterministic RNG. - A few output bugfixes. Thanks to several Slashdot readers who observed occasional double-link tags on the recursive links. - The frequency of conjunctions has been pushed up by 20% of absolute content, though some refinement should be done (e.g. the word 'and' is much more common in real speech than 'either'). - Added WN (web) Server configuration instructions contributed by Jasper Jongmans v0.8.3, Wed Nov 22 13:20:47 PST 2000 - Added the Last-Modified header computation contributed by Eric Eisenhart . This helps conceal that the output is CGI-generated, and should help also with legitimate spiders with broken robots.txt parsing who wander in and then try to keep the poion up to date. - Added code contributed by Richard Balint to generate usernames from dictionary words, sometimes with appended numbers. Such usernames will appear in addresses a configurable portion of the time. - Added doctype and tags appearing randomly. Also by Richard Balint, with some expansion on the theme. - Elevated conjunction frequency. v0.8.2, Fri Jun 4 16:15:34 PDT 1999 - Fixed bug where mailto: links from word() were sometimes being re-linked as href links by paragraph(); thanks to Alexander Kourakos for the rpeort (and patch) - Added additional document components, all appearing randomly; tag with background/text colors, section with variable contents including robots, keyword, description meta headings. - Fixed bug wherein leading

would occasionally be much longer than expected. - Added distributors of the CherryPicker spambot software to the sample-spammers file. - Added Teleport-28 to apache rewrite rules and known-spambot DoS patterns v0.8, Tue Jun 1 17:22:46 PDT 1999 - Initial release. sugarplum-0.9.10/INSTALL0100644000076400007640000001533307642302247013335 0ustar aquaaqua$Id: INSTALL 44 2003-02-01 22:56:20Z aqua $ Installing Sugarplum -------------------- The basic steps are these: 1) Program installation 2) Webserver configuration 3) CGI configuration 4) Teergrube baiting (optional) 5) HTML trapping 6) Testing -- 1. Program Installation The automated way: Edit install.sh, and adjust the various settings to suit your system. Run ./install.sh. This should be done as a user with write permissions to the ETCDIR (/usr/local/etc/ by default) and CGIDIR (/home/httpd/cgi-bin/ by default). It need not be done by root, and indeed should not. install.sh will create /usr/local/etc/sugarplum/ and /home/httpd/cgi-bin/sugarplum/; in the former it will create blank agentlog.gdbm and poison.log files with permissions suitable to allow the CGI user to edit them (write-only for the logfile). The manual way: a. Copy the 'poison' CGI into a directory where your webserver can execute it. b. Copy sample.conf to /etc/sugarplum/config. Go through and change the settings to suit your system and desires. c. Ensure that your local language dictionary is at /usr/share/dict/words, or configure /etc/sugarplum/config to point to the real location. d. If you enable logging (it's off by default) in the config file, create a file/var/log/sugarplum.log (or wherever you configured the log to be), writable by the webserver. 2. Webserver Configuration These instructions apply to Apache 1.3, the only one I have readily available that supports URL rewriting. If anyone has configuration instructions for other webservers, I'd be delighted to see them. Jasper Jonhmans has contributed webserver configuration instructions for the WN webserver -- see INSTALL.WN. Add the following mod_rewrite rules to your httpd.conf file (or wherever else is appropriate to your configuration). Remember that rewrite rules are not inherited by virtualhosts by default, so if you wish them to apply to all virtualhosts, you'll need to turn on rule inheritance; see the Apache documentation at http://www.apache.org/docs/ for the correct syntax; indeed, a preparatory reading of the mod_rewrite documentation would be a good idea anyway. You'll also need a 'RewriteEngine on' directive in the same scope as the rewrite rules. RewriteCond %{HTTP_USER_AGENT} email.?(magnet|reaper|siphon|harvest|collect|wolf) [NC,OR] RewriteCond %{HTTP_USER_AGENT} floodgate [NC,OR] RewriteCond %{HTTP_USER_AGENT} web(bandit|snake|collector|mole|miner|weasel) [NC,OR] RewriteCond %{HTTP_USER_AGENT} cherry.?picker [NC,OR] RewriteCond %{HTTP_USER_AGENT} extractor.?pro [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^crescent [NC,OR] RewriteCond %{HTTP_USER_AGENT} nicerspro [NC] RewriteCond %{REQUEST_URI} !^/sugarplum/ RewriteRule .* /sugarplum/visions [PT] ScriptAlias /sugarplum/ /home/httpd/cgi-bin/sugarplum/poison/ The ScriptAlias at the end, and the RewriteRule that points to it should have the /sugarplum/ portion adjusted to some randomly selected innocuous path. I suggest picking a random dictionary word that has no relation to the content on the rest of your site. You might also consider changing the word(s) on a fairly regular basis. Remember to assume that the spammers are as smart as you are; as of the first release of sugarplum, the ScriptAlias /sugarplum/ wouldn't be one that a spambot would be instructed to avoid, but that will almost certainly change as soon as the first spambot author/operator reads this. For webservers other than Apache 1.3, at least put in the ScriptAlias line, changing the /sugarplum/ alias as per above. This will work on at least NCSA HTTPd and Apache 1.2 that I know of. It's important also to prevent legitimate spiders from wandering into the poison -- it wastes search engine space. A legitimate spider will generally respect the Robot Exclusion Standard (RES); for this, create or add to the file served as http://www.yoursite.tld/robots.txt: User-agent: * Disallow: /sugarplum/ 3. CGI Configuration As of v0.9.8, configuration should be done by editing the configuration file, stored as /etc/sugarplum/config. All runtime configuration options are documented there. The default settings should be generally usable and safe for normal installations. 4. Teergrube Baiting (optional) As of v0.9.8, teergrube baiting is the only address generation method used by default. The default teergrube address is unresolvable. If you'd like to use sugarplum to lay bait for a teergrube, first enable teergrube address generation in Step 3. By default, the usernames in the "bait" addresses will have the IP address of the requesting host encoded in them -- use decode_teergrube.pl (included) to extract the IP address back out. Note that at present, address encoding can only handle IPv4 addresses. To point sugarplum at your teergrube, edit the configuration setting 'teergrube_address_fqdn' to the teergrube's FQDN. 5. Testing With any suitable web browser, open http://www.yoursite.tld/sugarplum/; you should receive the poison code's output, suitably random but structurally resembling normal HTML by/for humans. Also try http://www.yoursite.tld/sugarplum/1/2/3/4/5/6/7/8/9/0/, adding enough extra stuff to the end of the URL to exceed the max_depth configuration in the CGI -- here, you should see no recursive links, only mailto: links. Restart the webserver if you haven't already (apachectl graceful, et al). Telnet to your machine on port 80, and enter: GET /foo HTTP/1.0 User-Agent: EmailSiphon No matter what URL you selected for /foo, you should receive the output from the poison code. 6. HTML Trapping Spambots are spiders, and like an spider, to find a page they must be given a link to it. Somewhere on your site, ideally on several pages near or on the root page, include a link to the /sugarplum/ scriptalias (adjust as necessary). Here, again, you need to be smarter than the spambots. Assume they can identify any trap that you can -- hence, making your links the same color as the background in a zero-sized table cell, while it's discrete, may not be effective. Use a variety of tactics -- my suggestion is to use a small (not ridiculously or invisibly small) font, and to employ the specific formatting characteristics of the pages to hide it somewhere, rather than applying formatting to the link itself. Remember that the poisoner won't hurt a normal browser -- it may confuse people, but no worse than that. Even if they wander through it endlessly, the worst thing that will happen is that they'll fill up their local cache with it. Remember, the only way to trigger the DoS attack is to enter it with a known-spammer User-Agent or to make too many requests from the same IP with multiple agents in the configured time period, so it should be nearly impossible for normal uses to trigger an attack accidentally. sugarplum-0.9.10/INSTALL.WN0100644000076400007640000000202007642302247013645 0ustar aquaaqua Contributed by Jasper Jongmans : First create a file that contains the list of "bad" user-agents (eg. /usr/local/etc/sugarplum/badagents). The format of this file is one grep(1)-like regexp per line. Next insert the following text at the top of all your HTML files you want to "protect": Note that the file specified in the #if directive's file attribute is relative to the WN server root dir (e.g. /var/www). It is important that you do not have any lines (also no blank lines) above this. The last step is telling WN to parse the HTML files. Add Attributes=parse for each file record or Default-Attributes=parse in the directory record of index.wn. Make sure that the badagents file is readable by the user as which WN server runs (try something like: echo '[ -r /usr/local/etc/sugarplum/badagents ] && echo good || echo bad' | su -m wn). $Id: INSTALL.WN 44 2003-02-01 22:56:20Z aqua $ sugarplum-0.9.10/poison0100755000076400007640000004544407642302247013547 0ustar aquaaqua#!/usr/bin/perl -Tw # $Id: poison 116 2003-04-01 12:21:57Z aqua $ # sugarplum poison CGI # Copyright (c) 1999 by Devin Carraway # Freely distributable under terms of the GPL. # The poison CGI does the actual dealings with spam spiders. # It has the job of giving them something realistic to # peruse, including valid-looking addresses with which to # poison the spammer's database. # For the obvious reason, this script should either be named # innocuously, or else ScriptAliased in such a way as to hide # its name. Pick something suitably random. # See http://www.devin.com/sugarplum/ for the rest. # The user should adjust the configuration options below to # suit their particular whims. Also it may be desirable to # alter the subroutine fake_address() if a particular spam # collection system is in place on the site already. use strict; use Getopt::Long; use Sys::Hostname; use IO::File; my $VERSION = 0.9.10; # American TLDs for use generating random addresses. Non-US TLDs omitted, # on the presumption that it will reduce international bandwidth costs. my @TLDs = ( 'com', 'org', 'net', 'edu', 'gov', 'mil', 'tv', 'to', 'info', 'biz' ); my %opts = ( # log level (0 for no logging besides the webserver's own) loglevel => 0, # log file (if loglevel set true) logfile => '/var/log/sugarplum.log', # Should sugarplum work deterministically? If set true, a given # URL will always seed perl's RNG with a consistent value (sum of # the ordinal values of the bytes in the PATH_INFO variable) -- # consequently the same random values will be picked, so multiple # reloads of any given URL in sugarplum will produce identical # output. Hence if a harvester were to check for poison by # comparing data on subsequent loads, they won't be tipped off. deterministic => 1, # If set, the system hostname will be included in the seed in # deterministic mode. This introduces variance into different # sugarplum installations with identical paths (e.g. /sugarplum/), # thus preventing an attacker from doing hash-based poison # avoidance. This is desirable in all cases other than when # using sugarplum on sites run on clustered servers, where the # hostname may not be consistent across multiple loads of the # same URI. deterministic_by_hostname => 1, # If set, the HTTP server name will be rolled into the seed # in deterministic mode. This yields differing sugarplum # output across different virtualhosts, or indeed across # different servers. A possible drawback is that it may be # possible for an attacker to detect the poison programmatically # on sites using wildcard-matched vhosts. deterministic_by_httphost => 1, # path to the dictionary dictfile => '/usr/share/dict/words', # if true, entries from the above spammer email list will # be included as addresses. See poison_spammer_frequency. use_spammerlist => 0, # path to the known-spammer list, one email address per line. # not needed if use_spammerlist is set false. spammerfile => '/etc/sugarplum/spammers', # if true, randomly generated email addresses will be # included in the output. See poison_address_frequency. use_poison_addresses => 0, # if true, generated addresses will be used based on those # inside your teergrube -- see address_teergrube_frequency. use_teergrube_addresses => 1, # how many paragraphs of poisoned output? poison_paragraphs => 4, # should the background be randomized? (arguably improves # page plausibility, but often looks wonky to humans) poison_random_background => 1, # How deep should the URLs recurse (remember, this is # an exponential factor) poison_maxdepth => 4, # Minimum number of words per paragraph? poison_paragraph_wordcount_base => 50, # Random range of words beyond the base? poison_paragraph_wordcount_range => 75, # Column before which lines in output should have newlines # appended; simulates editor linewrap. Set very high to # disable linewrap. poison_paragraph_linewrap_col => 78, # What percentage of email addresses should be derived from a # dictionary word? (range 0 to 1 inclusive) poison_word_username_frequency => 0.6, # and of those, what percentage should have numbers attached to the # end (as with AOL and similar providers)? (0-1 inclusive) poison_wordnumber_username_frequency => 0.3, # and if so, up to how many digits? poison_wordnumber_username_maxdigits => 4, # The below should add up to 1 in any combination. # poison_spammer_frequency has been renamed -- # poison_address_frequency now specifies the frequency of all # addresses, while address_spammer_frequency (below) denotes the # portion of addresses taken from known spammers. # Percentage of words which should be poisoned addresses (see # below) poison_address_frequency => 0.02, # Percentage of words which should be normal words poison_dictword_frequency => 0.98, # Settings regulating what proportions of address types will be # emitted -- should add up to 1. Any zero value disables the # feature. # percentage of addresses emitted which should be taken from # the list of known spammers (0 to disable) address_spammer_frequency => 0.2, # percentage of addresses emitted which should be generated in # the teergrube (randomuser@teergrube.domain.tld): address_teergrube_frequency => 0.4, # percentage of addresses emitted which should simply be totally # random (0 to disable): address_random_frequency => 0.4, # give a fully-qualified hostname, which will be # used in generating tarpit addresses. teergrube_address_fqdn => 'thick-sticky-stuff.invalid.tld', ); sub read_config { my $fn = shift || return undef; my $f = new IO::File($fn) || die "$fn: $!"; my $l = 0; while (<$f>) { $l++; next if /^(\s*#|\s*$)/; chomp; if (/^(\w+):\s+(\S.*)/) { $opts{$1} = $2; } else { die "malformed config '$_' in $fn:$l\n"; } } 1; } sub usage { print "usage: $0\n", "\t-h : help\n", "\t-c | --config : specify config file\n", "output options:\n", map { tr/_/-/; "\t--$_ \n" } sort keys %opts; exit 0; } $ENV{PATH} = '/bin:/usr/bin'; $ENV{IFS} = ' '; delete $ENV{ENV}; delete $ENV{CDPATH}; ## work out a runtime configuration my $config_fn; GetOptions('config=s' => \$config_fn, 'c=s' => \$config_fn, 'h' => \&usage, (map { my $k = $_; $k =~ tr/_/-/; ("$k=s" => \$opts{$_}) } keys %opts)) || &usage; unless ($config_fn) { for ('/etc/sugarplum/config', '/usr/local/etc/sugarplum/config') { if (-e $_) { $config_fn = $_; last } } } $config_fn and &read_config($config_fn); my ($dict,$dict_size,$spammers,$spammers_size); my $uri = $ENV{REQUEST_URI} || 'http://localhost.test/sugarplum/'; $uri .= '/' unless $uri =~ /\/$/; my $depth = !$ENV{PATH_INFO} || ($ENV{PATH_INFO} =~ tr:/:/:); my $okrecurse = ($depth < $opts{poison_maxdepth}); $dict = new IO::File($opts{dictfile}) || die "dictfile $opts{dictfile}: $!"; $dict_size = (stat($dict))[7] || die "dictfile $opts{dictfile} is empty"; if ($opts{use_spammerlist}) { $spammers = new IO::File($opts{spammerfile}) || die "spammerfile $opts{spammerfile}: $!"; $spammers_size = (stat($spammers))[7] || die "spammerfile $opts{spammerfile} is empty"; } print "Content-Type: text/html\n", "Last-Modified: ".scalar localtime(((stat($0))[9]-65536)+ length($ENV{PATH_INFO} || $0)*1280), "\n\n"; if ($opts{deterministic}) { my $seed = 0; if ($opts{deterministic_by_hostname}) { $seed += $_ for (unpack('C*',hostname || '')); } if ($opts{deterministic_by_httphost}) { $seed += $_ for (unpack('C*',$ENV{HTTP_HOST} || $ENV{SERVER_NAME} || '')); } $seed += $_ for (unpack('C*',$ENV{PATH_INFO} || $0)); srand($seed); } ## HTML generation thus commences if (!int rand 2) { if (!int rand 3) { my @dt = ('', ''); print $dt[int rand ($#dt+1)],"\n"; } print int rand 2 ? '' : '',"\n"; } if (!int rand 2) { # sometimes have a head of varying elaboration print "\n"; my $indent = int rand 2 ? "\t" : ' ' x int rand 10; print $indent,¶graph(1 + int rand 10,2,'title'),"\n"; !int rand 3 and print $indent,"\n"; # irony? !int rand 4 and print $indent,"\n"; !int rand 4 and print $indent,"\n"; print "\n"; } elsif (int rand(1)<0.9) { # _almost_ always have a title. :) print ¶graph(1 + int rand 10,2,'title'),"\n"; } $opts{poison_random_background} and !int rand 2 and printf "\n", int rand 0x100,int rand 0x100, int rand 0x100, int rand 0x100,int rand 0x100, int rand 0x100; !int rand 2 and print ¶graph(1 + int rand 8,2,'h1'),"\n\n"; !int rand 3 and $okrecurse and do { my $x; print '

[ '; for (0..1+int rand 8) { $x = &random_word; print "$x | "; } $x = &random_word; print "$x ]

"; }; for (1..$opts{poison_paragraphs}) { print ¶graph($opts{poison_paragraph_wordcount_base} + int rand $opts{poison_paragraph_wordcount_range},int rand 2); } if ($opts{loglevel}) { my $log = new IO::File('>>'.$opts{logfile}) || die "$opts{logfile}: $!"; print $log join("\t",scalar localtime, $ENV{REMOTE_HOST} || 'unknown host', $ENV{REMOTE_ADDR} || 'unknown addr', $ENV{HTTP_USER_AGENT} || 'unknown agent', $uri),"\n"; } exit 0; sub paragraph { my $wordcount = shift; my $format = shift; my ($i,$i1,$x,$word,$capnext); my $buf = ''; my $ll = 0; $wordcount ||= 50 + int rand 75; if (!$format) { # simple words, no formatting $buf = '

'; $capnext = 1; for $i (1..$wordcount) { $word = &word; substr($word,0,1) =~ tr/a-z/A-Z/, $capnext=0 if $capnext; $buf .= $word.".",next if $i==$wordcount; $x = rand 1; if ($x<0.35 || $word =~ tr/$word "; } elsif ($x < 0.50) { # end of sentence $word .= (('.') x 20, '.','.','!','?','?')[int rand 25].' '; $capnext = 1; } elsif ($x < 0.56) { $word .= ', '; } elsif ($x < 0.58) { $word .= ': '; } elsif ($x < 0.60) { $word .= ' -- '; } elsif ($x < 0.97) { $word .= ' '.&conjunction.' '; } else { $word .= '; '; } if ($ll+length($word)>$opts{poison_paragraph_linewrap_col}) { $buf .= "\n"; $ll = length($word); } else { $ll += length($word); } $buf .= $word; } $buf .= "

\n\n"; } elsif ($format == 1) { # unordered list $buf = '
  • '; $capnext = 1; for $i (1..$wordcount) { $word = &word; substr($word,0,1) =~ tr/a-z/A-Z/, $capnext=0 if $capnext; $buf .= $word.".",next if $i==$wordcount; $x = rand 1; if ($x<0.50 || $word =~ tr/\n
  • "; } if ($ll+length($word)>$opts{poison_paragraph_linewrap_col}) { $buf .= "\n"; $ll = length($word); } else { $ll += length($word); } $buf .= $word; } $buf .= "
\n\n"; } elsif ($format == 2) { # heading, e.h. h1; almost no punctuation, no line breaks, short $_[0] and $buf = "<$_[0]>"; $capnext = 1 if rand(1) >= 0.5; for $i (0..$wordcount-1) { $word = &word(1); substr($word,0,1) = uc substr($word,0,1) if $capnext || !$i; $buf .= ' ' if $i; $buf .= $word; } $_[0] and $buf .= ""; } $buf; } sub conjunction { # no, these are not all conjunctions. conjunction() provides an increased frequency # of those parts of speech which occur as primary connectors in English, and should # therefore appear also in convincing poison. my @words = ( 'is', 'was', 'are', 'am', 'be', 'has', 'had', 'having', 'and', 'not', 'nor', 'neither', 'either', 'or', 'will', 'may', 'might','would','could','should','ought', 'do', 'did', 'done', 'doing','does', 'if', 'when', 'after', 'before', 'unless', 'until' ); $words[int rand ($#words + 1)]; } sub random_line { my $fh = shift || return undef; my $size = shift || return undef; my $l; until ($l) { seek($fh, int rand $size, 0) || die "seek: $!"; <$fh>; $l = <$fh>; # re-seek on comment lines if ($l) { chomp $l; $l =~ s/\s*#.*//; } } $l; } sub random_word { &random_line($dict, $dict_size) } sub random_spammer { &random_line($spammers, $spammers_size) } sub word { my ($i1,$x); my $word; my $realword_only = shift; $i1 = rand 1; if (!$realword_only && $i1<$opts{poison_address_frequency}) { $x = &address; $word = "$x"; } else { $word = &random_word; } $word; } sub address { my $n = rand 1; if ($opts{use_spammerlist} && $n<$opts{address_spammer_frequency}) { return &random_spammer; } elsif ($opts{use_teergrube_addresses} && $n<($opts{address_spammer_frequency}+ $opts{address_teergrube_frequency})) { return &teergrube_username . '@' . $opts{teergrube_address_fqdn}; } &fake_address; } sub fake_address { my @charset = ( 'a'..'z', 'a'..'z', 'a'..'z', 'A'..'Z', '0'..'9','-','.' ); my ($i,$s); my $addr = &fake_username.'@'; for ($i=0; $i<1+int rand 4; $i++) { $s = &random_word; $s =~ tr/a-z//cd; $addr .= $s; $addr .= '.'; } $addr .= $TLDs[int rand @TLDs]; $addr; } sub fake_username { my $un = ''; my @charset = ( 'a'..'z', 'a'..'z', 'a'..'z', 'A'..'Z', '0'..'9','-','.' ); if (rand 1 <= $opts{poison_word_username_frequency}) { $un = &random_word; $un .= ('a'..'z')[int rand 26] for (length($un)..int rand 14-length($un)); if (rand 1 <= $opts{poison_wordnumber_username_frequency}) { $un .= (0..9)[int rand 10] for (0..int rand $opts{poison_wordnumber_username_maxdigits}); } } else { $un = ('a'..'z')[int rand 26]; for (0..1+int rand 14) { $un .= $charset[int rand($#charset+1)]; } } $un; } # encode $ENV{REMOTE_ADDR} in a reversible, random-looking hash. # # The general issue: encode the 32 bits of an IPv4 address in a printable, # reversible hash with enough randomization to produce many permutations, and # which doesn't look too obviously like it has an IP address encoded in it. # # This approach could be improved, but does the job adequately while # accomplishing the above goals. # # A teergrube-bait username splits each byte of the IP address into high # and low-order nybbles, placing the four high-order nybbles before the # four low-order ones (8 characters sofar). It then selects a random # 8-bit permutation value, and for every true bit in that value, inserts # a random letter into the corresponding spot in the encoded address. # The permutation value is then encoded in the same fashion as the address, # with its high and low nybble encoded into two characters which are then # prepended to the address. In each case, nybbles are added to 97 ('a') # to render them printable. # # hence, the result: # # {p.h + 'a'}{p.l + 'a'} # [{0,25} + 'a']{(a1>>4) + 'a'} # [{0,25} + 'a']{(a2>>4) + 'a'} # ... # [{0,25} + 'a']{(a1&0xf) + 'a'} # [{0,25} + 'a']{(a2&0xf) + 'a'} # ... # @teergrubehost.domain.tld # # Where a1,a2,a3,a4 are the four octets of the IPv4 address, and the presence # of the character in [] brackets is dictated by whether a 1 is present in # the permutation value. # # This hash may be reversed with decode_teergrube.pl, included with sugarplum. sub teergrube_username { my @addr = split(/\./,shift || $ENV{REMOTE_ADDR} || '127.0.0.1'); my $packed = pack('c*', map { $_+97 } ((map { $_ >> 4 } @addr), (map { $_ & 0xf } @addr))); my $permutation = int rand 255; my $uname = pack('cc', 97+($permutation>>4),97+($permutation&0xf)). $packed; my $offset = 2; for (0..7) { if (($permutation & 1<<$_)) { my $rc = chr(97 + int rand 25); $uname = substr($uname,0,$_+$offset) . $rc. substr($uname,$_+$offset); $offset++; } } $uname; } # $Log: poison,v $ # Revision 1.13 2002/09/27 11:16:29 aqua # *** empty log message *** # # Revision 1.12 2000/12/28 11:11:34 aqua # - added teergrube address generation (default off) # - added deterministic mode (default off) # - adjusted frequency of conjunction()-inserted words upward # - cleaned up a few C-style for loops to perl list style # # Revision 1.11 2000/11/22 21:20:05 aqua # increment version for release. # # Revision 1.10 2000/11/22 21:14:09 aqua # Added Last-Modified header computation contributed by # Eric Eisenhart # # Added a variation on dictionary-word username generation contributed # by Richard Balint # # Adjusted conjunction frequency upward. # # Added duly-randomized and tags that should correlate # with the HTML produced by sugarplum. # # Added UID/GID reporting to dict-open failure. # # Revision 1.9 1999/06/04 23:20:28 aqua # added teleport-28 to dos_agent_patterns # # Revision 1.8 1999/06/04 23:14:19 aqua # Added background randomization option # # Revision 1.7 1999/06/04 22:51:54 aqua # Er, maybe _now_ the link-in-link is fixed. Found a better # way, and the old way wasn't working anyway. # # Revision 1.6 1999/06/04 22:42:37 aqua # Fixed mailto: in href problem (reported by Alexander Kourakos), # added head section, some randomly-chosen meta headers, fixed # problem with h1 headings getting lines broken and making a mess. # # Revision 1.5 1999/06/01 23:53:04 aqua # Added $VERSION # # Revision 1.4 1999/06/01 22:37:23 aqua # Added spambot agent patterns # # Revision 1.3 1999/06/01 21:59:11 aqua # Added env sanitizing to satisfy -T # # Revision 1.2 1999/06/01 21:44:56 aqua # Changed default loglevel # # Revision 1.1 1999/06/01 11:06:05 aqua # Initial revision # sugarplum-0.9.10/COPYING0100644000076400007640000004311007642302247013331 0ustar aquaaqua GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. sugarplum-0.9.10/md5sums0100644000076400007640000000133007642302247013614 0ustar aquaaqua-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 94d55d512a9ba36caa9b7df079bae19f COPYING c82528dcbcd5a14d9e4fccdbd69a409f ChangeLog 61829d1af1d67fb652a96980efa3c0c7 INSTALL 9cbfb387730fc3edb862bc6a1b0859cf INSTALL.WN 0371376618272393eca51567ba1d07ba README 6df94eaa8bbcc23418de1b4348b8c5e2 decode_teergrube.pl cc81bf1ee6343bef5b2f083dc5dcd92e install.sh aa644909e140d214cf9fba96714205f8 md5sums 4bca3ef0acf739def24ebef85bc89f0b poison 71593c509852d06b22705e4cda56df9d sample-spammers 9fbb27f03d5c93618eed8a99438c1092 sample.conf -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+iYSDU5XKDemr/NIRAvKHAJ46ri12NcOWweYQNTbYqiVaHjJTvACg81zS 544gfhtvjTjT/uetUhPBr6k= =phZo -----END PGP SIGNATURE----- sugarplum-0.9.10/README0100644000076400007640000001657007642302247013170 0ustar aquaaqua$Id: README 44 2003-02-01 22:56:20Z aqua $ This is sugarplum, a spam-bot database poisoner utility. The specific usage of a spam poisoner is to provide a spammer's email spider with bad data -- ideally lowering the database's usefulness so much that the database must be reverted, discarded or manually edited. Installation instructions may be found in the INSTALL file. Some background: A web spider (many terms have been used, including 'bot,' 'web scanner,' 'web bot,' etc; I'll use spider or web spider herein) is a program whose job is to wander through web pages, either in search of some specific data or a general set of data. Spiders are how search engines are built, and are involved in autonomous info-spider agents by various terms. They're good tools, and useful for many things. In particular, they're supposed to obey the Robot Exclusion Standard (RES), which instructs the spider where it may not go, and what it may not do (index, follow links) with a URL. Most any technology has the potential for abuse, however, and a lot of e-mail spammers now employ specialized spiders for the purpose of harvesting email addresses for their various unpleasant purposes. Such spiders work more or less like any other spider, crawling around looking for email addresses to add to their database. Spam spiders, needless to say, ignore the RES spec, and many attempt to appear as innocuous as possible via unusual search patterns, randomly changing User-Agent: settings, etc. While working for a regional ISP in 1998-99, I came across a homemade poisoner called "dauber," hacked up by the head sysadmin, Scott Doty . At the time, dauber simply printed out a page of random words, containing a few email addresses in which the remote spider's IP address was encoded. The addresses were invalid, but spammers who sent mail to those addresses left log entries which could then be decoded to identify what spider had generated the traffic, and in some cases, identified a netblock which would then have their packets routed into oblivion, world without end. A neat trick. Sugarplum is an amalgam of several ideas for opposing spam via interfering with the use of collection spiders. I can only lay a claim to three, both notions that have no doubt occurred to many others also: 1. Poison spam bots by provding them with a randomly generated tree of bad data, usually in great quantity. [credit to Scott Doty as per above, and many others] 2. Encode the harvester's IP address in teergrube (tarpit) addresses, to identify where they came from. [credit to the teergrube FAQ, slashdot.org discussion, dauber, etc.] 3. Amongst the various bad addresses, include an assortment of addresses belonging to known spammers, so that they may spam each other. [credit to soc.subculture.bondage-bdsm, circa 1997] 4. Adjust one's webserver configuration such that no matter what page a spam bot requests, it transparently receives the poison. 5. If a spambot wanders into the poison, identify it as a spambot by noting whether its User-Agent: header value changes in an un-human like fashion. [ n.b.: this functionality has been obviated in v0.9.8 ] 6. Avoid counterdetection (letting the spambot know it's being poisoned) by rendering output in a fashion as close to normal human output as automatically feasible (even repeatable output, if deterministic mode is used). This involves variable HTML syntax and content, extensive randomization, vague attempts at grammar, etc. The primary assumption in this respect is to assume that the author of the spambot is at least as smart as you are -- and that it will notice any tricks obvious enough that you yourself could pick them up. 5. Upon positive identification of a spambot, launch out-of-band protective measures against it, such as adding its IP to a firewall deny-rule, or making point-target denial of service attacks against it. [ n.b.: this has been removed in v0.9.8 ] Historical changes: Sugarplum was written in 1999, according to the observed habits of spammers at the time. These have changed some since. Address harvesting, while still very common, is no longer the most prevalent method of obtaining addresses for bulk mailing (at present dictionary attacks against large hosts seem to be the favorite approach.) Early releases of Sugarplum gained some slight notoriety for including hooks with which it could be configured to launch denial of service attacks against harvesters. While this was arguably workable at the time, as of this writing all major OS vendors have spent enough energy hardening their TCP/IP stacks as to make "ping of death"-style attacks largely unviable. As of v0.9.8, this facility has been removed from sugarplum. It may reappear in some later version if a new class of viable counterattack against a single harvester becomes feasible. For some time it was possible to identify some spambot harvesters by their proclivity for randomizing their user-agent headers, returning a different agent on each HTTP request. This was an obvious error on part of the spambot authors and has not been seen in some time. Sugarplum's facility for recognizing this behavior, which in any case was useful only for confidently launching a counterattack, has been removed. How it works: The mechanisms that make up sugarplum are: A pair of dictionaries, one with words in the local language, the other with the addresses of known spammers, A set of Apache mod_rewrite rules for spambots that identify themselves as such, and maps their requests back into the poison, A CGI to perform the actual poisoning. Etiquette and ethical considerations: The ethical/moral/legal implications of spam are relatively straightforward, but should nonetheless be considered all the way through before making use of sugarplum. I won't go into the various arguments here -- make up your own mind, and see the net-abuse newsgroups and related resources if you need more data. There are legitimate reasons for using address harvesters, though their utility has (indirectly) been destroyed by widespread use of harvesters for abusive purposes. Sugarplum is capable of producing entirely random addresses, some percentage of which will coincide with legitimate addresses, or with legitimate domains having universal "blanket" delivery. Since the addresses are random, the odds of intersection with an address that cannot simply be deactivated without cost are very low, but the possibility still concerns some people. While I don't agree that it's a significant problem, as of v0.9.8 this form of randomization is disabled by default, to try to provide the safest possible default configuration. Assorted random gibberish: The name "sugarplum" is an appealing little irony; most poisons (substances poisonous to humans, anyway) taste bitter. According to the dictionary, a sugarplum is any of a number of small candies or rolled sweetmeats. A sugarplum that involves actual plums is made by carmelizing the fruit syrup and sugar in a pan. The whole point of feeding poison to the unwary is either to make it invisible and indistinguishable from normal food/drink, or else to make it deliberately tantalizing, with its poisonous nature well concealed until after copious consumption. Sugarplum may be freely distributed, modified, etc. under terms of the GNU General Public License (GPL) v2, or at your option, any later version. Devin Carraway $Date: 2002/09/27 11:07:06 $