🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #2972

Re: Spam detection -- methods?

#2972
From: Krishna Kunchithapadam
Date: Sat, 22 Oct 1994 01:04
90 lines
5327 bytes
In article <387pmq$blt@harbinger.cc.monash.edu.au>
acbul1@penfold.cc.monash.edu.au (Andrew Bulhak) writes:
:
: [notes about edit-distance comparisons deleted]
:
: This brings up the issue of comparing posts. Clearly, comparing each
: post on the system with each other post has O(n^2) time complexity, and
: would be inefficient, especially if edit distance is calculated each
: time.
:


Udi Manber (U. Arizona) had a paper in the Winter-93 Usenix on a
tool called `sif' (_s_imilarity _i_n _f_iles), which does a fast
hashing of text files to allow O(n.log(n)) similarity tests.

The essential idea is that if a text file is "sufficiently"
large, some continuous sequence of characters in it will hash (in
the checksum sense, as an example) to 0 (modulo some pre-chosen
integer).  It does not matter what checksumming strategy you use,
how many contiguous characters you plan to checksum (as long as
you checksum only a fixed-length string, and not the whole file)
and what integer you choose to perform modulo-checks.

Large files will yield _many_ different signatures and two files
that have many shared signatures are increasingly likely to be
similar (save editing changes).  The degree of similarity is
often a good measure of the edit-distance that Andrew mentions in
his posting.

Spam detectors using this approach might look like this:

(1) Sample the world (or at least that part of the world in your
    news spool).  Strip all headers from articles and run through
    the signature generator.  The generated information will be
    records of the form "signature filename/article-id".  The
    cost of doing this is O(n) where n is the size of the spool-
    --each byte in each article will be seen once (and only
    once).

(2) Sort the signature records (by signature).  This step
    requires O(n.log(n))) in the size of the signature file---
    there is obviously a trade-off: you want lots of signatures
    so that spams do not slip through, but you do not want so
    many that this step becomes a bottle-neck.

(3) Scan through the file and build your edit-distance matrix.
    Alternatively, if you have a fast hash-table implementation
    of multi-sets, you can do away with the sort and generate the
    edit-distance matrix at the cost of iterating through the
    multi-set.

All entries of the matrix whose value is more than a threshold
(90% say) are candidates for a spam---time to fire the ARMM (or
your favorite spam-killer).  Manber's paper also makes for
interesting reading, so it is worth a look.

The main reason why I think this approach has some merit is that
it has no fixed concept of a signature (as checksums do) or a
fixed concept of edit distance in terms of additions and
deletions.  Therefore, McElwaine spams (where each article had a
subtly different promo-message) and Dave Rhodes spams (where the
10 current recipient list changes with every successive
sucker/net-abuser) will still be caught.  It is almost trivial to
catch the Green-card lottery spams since all articles had
identical bodies.

There are lots of weeding that one can do to reduce the
population of the signature file.  Andrew points out many in his
post.  For a start, we can immediately ignore all moderated
newsgroups from consideration.  Secondly, we can watch out
specifically for articles posted to defunct newsgroups in the alt
hierarchy---the only traffic that these groups have seen in their
lifetimes is spam---and signature test them (and alert the
sysadmins or trigger the execution of an edit-distance comparator
as above).  Thirdly, we can (and probably should) ignore all the
*binaries* groups (by using a simple heuristic to identify those
articles that seem to be uuencoded).  All the above should
drastically reduce the number of articles that get passed on to
the signature generator, in which case it might even make sense
to run the program on every candidate article as it arrives (and
drop the results into a database).

Finally, I would like the final act of the metaphorical "pulling
the trigger" to be done by a human---it is easy to write code
that helps in detecting potential spams, but I am less sure about
having the program also act as a cancel-bot.

--Krishna
Technical Details
Message-ID: <389ofp$6ee@spool.cs.wisc.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.unix.programmer.mbox.zip!bga.com!news.sprintlink.net!howland.reston.ans.net!news.moneng.mei.com!uwm.edu!uwvax!cham.cs.wisc.edu!krisna
References: <387pmq$blt@harbinger.cc.monash.edu.au>

Show Full Headers
Complete Article Headers
Message-ID: <389ofp$6ee@spool.cs.wisc.edu>
Subject: Re: Spam detection -- methods?
Date: Sat, 22 Oct 1994 01:04:57 +0000
From: Krishna Kunchithapadam <krishna@cs.wisc.edu>
References: <387pmq$blt@harbinger.cc.monash.edu.au>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.unix.programmer.mbox.zip!bga.com!news.sprintlink.net!howland.reston.ans.net!news.moneng.mei.com!uwm.edu!uwvax!cham.cs.wisc.edu!krisna
Newsgroups: news.admin.misc,alt.current-events.net-abuse,comp.programming,news.software.nntp,comp.unix.programmer,news.future
Organization: University of WI, Madison -- Computer Sciences Dept.
Lines: 89
Distribution: inet
NNTP-Posting-Host: cham.cs.wisc.edu
X-Newsreader: NN version 6.5.0 #4 (NOV)
Originator: krisna@cham.cs.wisc.edu