Jesse Thompson wrote:
> A word of caution.  Be very careful how you use the list.  The
> intended usage for the list is to prevent (or monitor) local users
> from sending email to the listed addresses.  The phishers
> frequently use compromised end-user accounts to receive the
> phishing replies, so there is a high risk of false positives,
> especially if you attempt to classify messages containing one these
> addresses as spam.

That might just mean that the SpamAssassin rule that uses it should
require some other phishing-detection rule(s) to hit as well.

Rob McEwen wrote:
> OK. I was wrong. Due to this discussion, I'm convinced that MD5 of
> the whole (lower case!) e-mail address is best, with the entire
> e-mail address still showing up in plain text in the DNS txt
> record.

Okay, back to using the second half of the MD5 (simple enough, since
that was my original implementation).  Relevant code:

$hash =~ s/@.*//;
$hash =~ tr [A-Z] [a-z];
$hash = substr(Digest::MD5::md5_hex($hash),16); # 2nd 16 of 32 chars

You can look up an address by hash by pretending its domain is "hash"
(note the collision in the example).

I've added support for a new type, Z.  Z means the email address
should not be revealed (perhaps this should always be the case?).  The
TXT record for hash lookup will return "@hidden@" ... see the test for
hidden@ example.com below.

David B Funk recommended SURBL's merged results as a bandwidth-saver:
> EG: A == 127.0.0.2
>     B == 127.0.0.4
>     C == 127.0.0.8
>     D == 127.0.0.16
> 
> thus AB == 127.0.0.6
>     AC == 127.0.0.10
> 
> etc.

I like it!  Why not start at one? A=1 B=2 C=4 D=8 Z=n/a.  This
facilitates:

  $type_list =~ s/.*,([A-IZ]+),.*/$1/;
  if ($type_list =~ /Z/) {
    $email =~ s/\t".*"/\t"\...@hidden\@"/; # hide the email address
    $type_list =~ s/Z//g;
  }
  $type_list =~ s/(?=.)/+/g;
  $type_list =~ tr [ABCD] [1248]; # rewrite when we get an E!
  $type_list = eval 0 . $type_list;


Here are some tests:

$ eblhash() { perl -MDigest::MD5 -e \
  'print substr(Digest::MD5::md5_hex(q('$1')),16)."\n"'; }
$ eblhash test
cade4e832627b4f6
$ host -t txt `eblhash test`.hash.emailbl.khopesh.com.
cade4e832627b4f6.hash.emailbl.khopesh.com descriptive text
"[email protected]"
cade4e832627b4f6.hash.emailbl.khopesh.com descriptive text
"[email protected]"
$ host `eblhash test`.example.com.emailbl.khopesh.com.
cade4e832627b4f6.example.com.emailbl.khopesh.com has address 127.0.0.15
$ host -t txt `eblhash hidden`.hash.emailbl.khopesh.com.
e8238a6c0be92190.hash.emailbl.khopesh.com descriptive text "@hidden@"

For test purposes, "text" and "hidden" are also included as their own
hashes.  For legacy purposes, the truncated username model used
earlier is still there.  I'll remove it in time.


I should also mention that this index is updated regularly and will
stay up until it suffers from its success or misuse.

The last-seen date stamp on [email protected] serves as the last day it
was updated, and the SOA record for my khopesh.com domain shows the
last DNS update (the last two digits are the EDT hour or higher if
I've been toying with it).  My sa-channels update every four hours.


-----

I'm also toying with the idea of making the khop-sc-neighbors list
(currently an sa-update channel) a DNSBL with return codes indicating
its networks' rank on an inverse scale from 1-100 (though not
necessarily with a hundred entries), so 127.0.0.100 means the
top-ranked spamming network and 127.0.0.1 is the lowest noted spamming
network.  This becomes a percent to apply a plugin configuration
option's multiplier, so a multiplier of 3 would give the top-ranked
network (127.0.0.100) a score of 3 and a network in the middle
(127.0.0.50) a score of 1.5, etc.  The khop-sc-neighbors channel
examines /24 CIDRs (x in a.b.c.x) and /8 CIDRs (x.y.z in a.x.y.z),
which would be 127.0.CIDR.PERCENT, so 127.0.24.100 would be the top
/24 offender and 127.0.8.100 would be the top /8 offender.


-- 
Adam Katz
khopesh on irc://irc.freenode.net/#spamassassin
http://khopesh.com/Anti-spam

Reply via email to