Spam Hunter

Viagra, penis enhancements, porn, mortgage rates, and much more are shoved into my inbox everyday. I'm not trying to win the spam war. I just like to vent by choosing one email a day, tracing down the jerk who sent it and publishing any antics that ensue.

Saturday, September 11, 2004

my methods

I wanted to spend some time documenting my methods. I only use freeware tools at this point such as perl, outlook express and vim.
Outlook Express is my collector, it is cofigured for the catch all address of my domain. For every oddball site I've ever gone to I would enter a custom email. In one case MPCMag who offered free magazine subscriptions the spam would get sent to MPCMag@mydomain.com
Once the spams are in my inbox (with previewing turned off of course) I would simply click on the file and hold, drag it onto my desktop and then edit the file using vim. Vim is VI improved for those who don't know and is a great free text editor.
The non free tool I use to speed things up are Komodo a fantastic perl IDE I purchased a year ago from Activestate (now Sophos). I could do without it but I really love the tool and it is nice when I'm coding to have an interactive debugger like this handy.

The normal mode of operation here is to find a page of entry which is usually in the email itself and then download the page in my perl script. This prevents any nasty activeX or other surprises from infecting me. In linux I would use curl for this of course.
Here is a sample perl script I use.

#!/usr/bin/perl
use strict;

use LWP::UserAgent;

# Create a user agent object
my $ua = LWP::UserAgent->new;
# $ua->agent("$0/0.1 " . $ua->agent);
$ua->agent("Mozilla/8.0"); # pretend we are very capable browser :)
my $counter;
# Initialize proxy settings from environment variables
$ua->env_proxy;
my @dictionary;
# Create a request

# this is an actual spammer URL that was sent to a troll account
my $baseURL='http://www.ad0u.com/maildeny.php';

sub getPage
{
my $req = HTTP::Request->new(GET => $baseURL);
$req->header('Accept' => 'text/html');

# Pass request to the user agent and get a response back
my $res = $ua->request($req);

# Check the outcome of the response
if ($res->is_success) {
print $res->content;
}
else {
print "Error: " . $res->status_line . "\n" if ($res->status_line!~/404/);
}
}

getPage();

0 Comments:

Post a Comment

<< Home