🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #2964

Spam detection -- methods?

#2964
From: Andrew Bulhak
Date: Fri, 21 Oct 1994 07:13
65 lines
4358 bytes
Since the frequency of spams (identical messages posted separately to
many unrelated newsgroups)  on the net is increasing, and the C&S
how-to book is coming out soon, it may be a good time to give some
thought to efficient ways of detecting and cancelling spams. I have been
thinking about the problem and have come up with some ideas.

Firstly, it should be kept in mind that any spam-exclusion software
should err on the side of caution; it would be a more grevious mistake
to cancel legitimate (non-spam) posts than to not cancel spams.

My first idea for a spam-detection technique would be to compare
messages by using an edit-distance function. This function would be
applied to the message body only (as headers would be different for each
copy). Because a wily spammer could chance a few minute details
(spacing, etc.) to defeat strcmp() or something similar, edit distance
would be used.* Any two posts with a distance below a certain threshold
would be classified as a spam. The threshold would be set low enough as
not to trigger on two follow-ups to the same post.

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.

A simple way of reducing this complexity would be to only compare recent
articles, say, those which arrived in the same 24 hours. There is,
however, a trade-off between complexity and vulnerability; if the
"statute of limitations" is too short, some spams will be undetected.

Another technique would be to firstly have an inexpensive screening test
to weed out posts which are unlikely to be copies of a post. Comparing
the From: and Path: headers of two posts may be one way of doing this.
Iff they match, the edit-distance procedure is applied; otherwise, they
are known to probably not be a spam.

If this software is built into the news site software, it could reduce
computation required by placing articles in a hash table by site of origin.
When a new article arrives, its origin (inferred from headers) would be
looked up in the hash table and it would be screened against other
articles in that hash group. If the screening test returns a positive,
the new article's edit distance from the previous article would be
computed. If they are below the spam threshold, the new article is
dropped.

This would result in only one copy of each spam arriving at each site,
in the first group to which the spam is posted. If this is
inappropriate, the spam can be moved into junk by the software. This
would also allow the software to search against posts in junk first,
making it more efficient against large spams.


* The edit distance between two strings is the number of insertions,
deletions or transpositions required to transform one into the other.


If you have any ideas concerning ways of detecting multiple posts
efficiently, or any comments/corrections/suggestions concerning the 
above post, please follow up to this post.

--
Andrew Bulhak            | "Not everything in a cup is a drink. I would 
acb@yoyo.cc.monash.edu.au| argue that simply putting spaghetti in a cup 
Monash Uni, Clayton,     | does not make it a drink."
Victoria, Australia      |	-- pt@acl.icnet.uk, on Mornington Crescent
Technical Details
Message-ID: <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!vixen.cso.uiuc.edu!uwm.edu!msuinfo!harbinger.cc.monash.edu.au!penfold.cc.monash.edu.au!acbul1

Show Full Headers
Complete Article Headers
Message-ID: <387pmq$blt@harbinger.cc.monash.edu.au>
Subject: Spam detection -- methods?
Date: Fri, 21 Oct 1994 07:13:30 +0000
From: acbul1@penfold.cc.monash.edu.au (Andrew Bulhak)
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!vixen.cso.uiuc.edu!uwm.edu!msuinfo!harbinger.cc.monash.edu.au!penfold.cc.monash.edu.au!acbul1
Newsgroups: news.admin.misc,alt.current-events.net-abuse,comp.programming,news.software.nntp,comp.unix.programmer,news.future
Organization: The Information Supercollider
Lines: 64
Distribution: inet
NNTP-Posting-Host: penfold.cc.monash.edu.au
X-NNTP-Posting-User: acbul1
X-Newsreader: TIN [version 1.2 PL2]