Charles Nadeau's Radio Weblog : A weblog about technology, tools and knowledge management
Updated: 2007-02-01; 08:37:55.

 

Subscribe to "Charles Nadeau's Radio Weblog" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.


Categories: (Check them too. My content isn't all on the main page)

Knowledge Management
Technology
My Hardware
My Software
En français!
Top 20 topics!


Currently reading:

The Second World War, Volume 1: The Gathering Storm by Winston S. Churchill

Beginning Linux Programming (Programmer to Programmer) by Richard Stones and Neil Matthew



www.blogwise.com

Male/31-35. Lives in Canada/Ontario/Ottawa/Manor Park, speaks French and English. Spends 80% of daytime online. Uses a Faster (1M+) connection. And likes Cooking/Reading.
This is my blogchalk:
Canada, Ontario, Ottawa, manor Park, French, English, Male, 31-35, Cooking, Reading.


The Political Compass: Economic Left/Right: -3.50
Authoritarian/ Libertarian:
-2.26


Technorati Profile
Popdex Citations



 
 

16 novembre 2003

In an article on his web site, Paul Graham discusses about filters that fights back. Filters that fights back are filters that simply fetch all the URL of the spam messages, artificially increasing the traffic on the spammers sites and their cost of operation. Graham says:
"...following all the urls in a spam would have an amusing side-effect. If popular email clients did this in order to filter spam, the spammer's servers would take a serious pounding. The more I think about this, the better an idea it seems. This isn't just amusing; it would be hard to imagine a more perfectly targeted counterattack on spammers."

I decided to rudimentarily implement that idea with a perl script triggered by a cron job.
On my main Linux box running Gentoo, I am using Eric Raymond's bogofilter to filter out spam. This program put all the spam I am receiving in a maildir named "spam". The script parses the body of these e-mails and extract all the URLs they contain and fetch them, creating "dummy traffic" for these sites. If thousands of people do it, it will mean that spammers will be "victims" of an uncoordinated distributed denial of service attack (uDDoS).

The perl script is:

#! /usr/bin/perl -w

use lib '..', '.';

use Mail::Box::Manager 2.00;
use LWP::Simple;

# Open the folder

my $mgr=Mail::Box::Manager->new;

my $folder = $mgr->open
       ( "/root/Mail/spam"
       , extract => 'ALWAYS' # Take the body
       );

die "Cannot open '/root/Mail/spam': $!\n"
       unless defined $folder;

# Process all messages in this folder.

my @messages = $folder->messages;

foreach my $message (@messages)
{

       my @match=($message->decoded=~/\bhref="(http[^>"]*)">.*/gi);
       foreach my $match(@match)
       {
              print $match,"\n";
              my $content="";
              my $rc=getstore($match,$content);
       }

}

# Finish

$folder->close;


Use it as you see fit. If you modify it, please drop me a line to let me know the modifications you made.
12:18:34 AM Google It!    comment []   - See Also:  Programming  Trackback: trackback []

© Copyright 2007 Charles Nadeau.



Click here to visit the Radio UserLand website.
 



-->
November 2003
Sun Mon Tue Wed Thu Fri Sat
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30            
Oct   Dec


Google
Search the whole web!
Search Charles radio!


www.flickr.com


Top 5 artists I listen to the most often during the last week:


I subscribe to:

Here's how this works.


Weather in Ottawa:
The WeatherPixie
Weather in Fukuoka:
The WeatherPixie