Thread View: news.software.nntp
13 messages
13 total messages
Started by Justin M. Streiner
Sat, 19 Jul 1997 00:00
Re: Posting sux!! so does INN
Author: Justin M. Streiner
Date: Sat, 19 Jul 1997 00:00
Date: Sat, 19 Jul 1997 00:00
9 lines
804 bytes
804 bytes
On Sat, 19 Jul 1997 04:51:18 GMT, curly <thedink@nowhere.net> wrote: > Thanks for that insightful comment - I'm sure that can be worked into future releases of INN :-) jms
Re: Filtering message body (was Re: Posting sux!! so does INN)
Author: Michael Hucka
Date: Sat, 19 Jul 1997 00:00
Date: Sat, 19 Jul 1997 00:00
30 lines
2090 bytes
2090 bytes
>>>>> On 19 Jul 1997, Jeff Garzik <jeff.garzik@spinne.com> wrote: >> Can anyone think of a reason not to drop silently posts with no body? JG> heh. Here's patch to INN 1.5.1 that will make the message body JG> accessible to the Perl filter. To drop no-body messages, you would JG> just need to amend the Perl filter to include Making the article body accessible to the perl filter is an excellent addition; thank you. I've been wishing for the same, but haven't had time to do anything about it. With the article body accessible, one can now do more effective EMP filtering. Your (Jeff) current Perl-based filter tracks only the From + Subject + Lines fields. It works very nicely, but many spammers use different From and/or Subject fields with identical article bodies. If it were possible to create a short summary of the article body, that could be added as another field for EMP filtering. The obvious technical problem is finding a body signature that is (1) sufficiently unique while being (2) quick to compute and (3) very, very small in terms of storage requirements. -- Mike Hucka hucka@umich.edu http://www.eecs.umich.edu/~hucka University PhD to be, computational models of human visual processing (AI Lab) of UNIX systems administrator & programmer/analyst (EECS DCO) Michigan
Filtering message body (was Re: Posting sux!! so does INN)
Author: Jeff Garzik
Date: Sat, 19 Jul 1997 00:00
Date: Sat, 19 Jul 1997 00:00
92 lines
3548 bytes
3548 bytes
This is a multi-part message in MIME format.
--------------7A00B2704EE9D3FC423DF9B5
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
(cc'd to author)
Ian Stirling wrote:
> Justin M. Streiner <streiner@remove-to-mail-me.sgi.net> wrote:
> : Thanks for that insightful comment - I'm sure that can be worked into future
> : releases of INN :-)
> Can anyone think of a reason not to drop silently posts with no body?
heh. Here's patch to INN 1.5.1 that will make the message body
accessible to the Perl filter. To drop no-body messages, you would just
need to amend the Perl filter to include
"Blank message rejected" if ($hdr{"__BODY__"} = /^\s*$/m);
--
Jeff Garzik Quality news feeds
News Administrator INN Technical info, Consulting
Spinne, Inc. http://www.spinne.com/usenet/
--------------7A00B2704EE9D3FC423DF9B5
Content-Type: text/plain; charset=us-ascii; name="perl-filter-body.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="perl-filter-body.patch"
diff --context -r ../inn-1.5.1/innd/art.c innd/art.c
*** ../inn-1.5.1/innd/art.c Tue Dec 17 09:40:40 1996
--- innd/art.c Fri Jul 18 23:58:36 1997
***************
*** 1794,1800 ****
#if defined(DO_PERL)
pathForPerl = HeaderFind(article->Data, "Path", 4) ;
! if ((perlrc = (char *)HandleArticle()) != NULL) {
(void)sprintf(buff, "%d %s", NNTP_REJECTIT_VAL, perlrc);
syslog(L_NOTICE, "rejecting[perl] %s %s", HDR(_message_id), buff);
ARTlog(&Data, ART_REJECT, buff);
--- 1794,1800 ----
#if defined(DO_PERL)
pathForPerl = HeaderFind(article->Data, "Path", 4) ;
! if ((perlrc = (char *)HandleArticle(Data.Body)) != NULL) {
(void)sprintf(buff, "%d %s", NNTP_REJECTIT_VAL, perlrc);
syslog(L_NOTICE, "rejecting[perl] %s %s", HDR(_message_id), buff);
ARTlog(&Data, ART_REJECT, buff);
diff --context -r ../inn-1.5.1/innd/perl.c innd/perl.c
*** ../inn-1.5.1/innd/perl.c Tue Dec 17 09:40:40 1996
--- innd/perl.c Sat Jul 19 00:01:37 1997
***************
*** 34,40 ****
extern char *pathForPerl ;
char *
! HandleArticle()
{
dSP;
ARTHEADER *hp;
--- 34,41 ----
extern char *pathForPerl ;
char *
! HandleArticle(artBody)
! char *artBody;
{
dSP;
ARTHEADER *hp;
***************
*** 53,58 ****
--- 54,63 ----
if (hp->Found && hp->Value && strcmp (hp->Name,"Path") != 0)
hv_store(hdr, (char *) hp->Name, strlen(hp->Name), newSVpv(hp->Value, 0), 0);
}
+
+ /* store article body */
+ if (artBody != NULL)
+ hv_store(hdr, (char *) "__BODY__", 4, newSVpv(artBody, 0), 0) ;
if (pathForPerl != NULL)
{
--------------7A00B2704EE9D3FC423DF9B5--
Re: Filtering message body (was Re: Posting sux!! so does INN)
Author: Jeff Garzik
Date: Sun, 20 Jul 1997 00:00
Date: Sun, 20 Jul 1997 00:00
25 lines
1917 bytes
1917 bytes
Michael Hucka wrote: > With the article body accessible, one can now do more effective EMP > filtering. Your (Jeff) current Perl-based filter tracks only the From + > Subject + Lines fields. It works very nicely, but many spammers use > different From and/or Subject fields with identical article bodies. If it > were possible to create a short summary of the article body, that could be > added as another field for EMP filtering. Even though Perl is excellent at optimizing statements at compile time (when it builds its syntax tree), I have a feeling an internal INN body hash written in C would use less CPU time. A patch along the same lines as the one I just posted could hash the article body, then pass that value to Perl as __BODY_HASH__ or something similar. Or just keep a body hash cache completely internal to INN. The problem with this is that you have to recompile to turn the body hash off, instead of simply commenting out a line in the Perl filter. -- Jeff Garzik Quality news feeds News Administrator INN Technical info, Consulting Spinne, Inc. http://www.spinne.com/usenet/
Re: Filtering message body (was Re: Posting sux!! so does INN)
Author: Ian Stirling
Date: Sun, 20 Jul 1997 00:00
Date: Sun, 20 Jul 1997 00:00
26 lines
2140 bytes
2140 bytes
Greg Andrews <gerg@netcom.com> wrote: : Michael Hucka <hucka@eecs.umich.edu> writes: : > : >The obvious technical problem is finding a body signature that is : >(1) sufficiently unique while being (2) quick to compute and (3) very, very : >small in terms of storage requirements. : Here's an idea I've been kicking around for about a year now: : 1. Strip header lines (except perhaps for NNTP-Posting-Host), 5.5 Strip all lines containing "[Nn]ewsgroup" or the name of the current newsgroup. : 6. Generate a 128-bit MD4 hash of the text. Would CRC be quicker? -- Ian Stirling. Designing a linux PDA, see http://www.mauve.demon.co.uk/ -----******* If replying by email, check notices in header *******------- What a wonderfull world it is that has girls in it! Robert A Heinlein.
Re: Filtering message body (was Re: Posting sux!! so does INN)
Author: Andrew Gierth
Date: Sun, 20 Jul 1997 00:00
Date: Sun, 20 Jul 1997 00:00
19 lines
1342 bytes
1342 bytes
>>>>> "Jeff" == Jeff Garzik <jeff.garzik@spinne.com> writes:
Jeff> To drop no-body messages, you would just
Jeff> need to amend the Perl filter to include
Jeff> "Blank message rejected" if ($hdr{"__BODY__"} = /^\s*$/m);
Ahemm. I don't think that means what you think it means....
Use
if ($hdr{"__BODY__"} =~ /^\s*$/s);
instead, unless you want to lose every article containing a blank line.
--
Andrew.
Re: Posting sux!! so does INN
Author: Ian Stirling
Date: Sun, 20 Jul 1997 00:00
Date: Sun, 20 Jul 1997 00:00
23 lines
2089 bytes
2089 bytes
Justin M. Streiner <streiner@remove-to-mail-me.sgi.net> wrote: : On Sat, 19 Jul 1997 04:51:18 GMT, curly <thedink@nowhere.net> wrote: : > : Thanks for that insightful comment - I'm sure that can be worked into future : releases of INN :-) Can anyone think of a reason not to drop silently posts with no body? : jms -- Ian Stirling. Designing a linux PDA, see http://www.mauve.demon.co.uk/ -----******* If replying by email, check notices in header *******------- The fight between good and evil, an epic battle. Darth vader and Luke, suddenly in the middle of the fight, Darth pulls Luke to him, and whispers "I know what you'r getting for christmas!" Luke exclaims "But how ??!?" "It's true Luke, I know what you'r getting for christmas" Luke tries to ignore this, but wrenches himself free, yelling "How could you know this?", Vader replies "I felt your presents"
Re: Filtering message body (was Re: Posting sux!! so does INN)
Author: Andrew Gierth
Date: Sun, 20 Jul 1997 00:00
Date: Sun, 20 Jul 1997 00:00
12 lines
1154 bytes
1154 bytes
>>>>> "Jeff" == Jeff Garzik <jeff.garzik@spinne.com> writes: Jeff> Don't forget to use the multi-line regex modifier when Jeff> doing string matching on the body (/pattern/m). That's not correct in all cases. -- Andrew.
Re: Filtering message body (was Re: Posting sux!! so does INN)
Author: Jeff Garzik
Date: Sun, 20 Jul 1997 00:00
Date: Sun, 20 Jul 1997 00:00
29 lines
1857 bytes
1857 bytes
Jeremy wrote: > Jeff Garzik <jeff.garzik@spinne.com> wrote: > >heh. Here's patch to INN 1.5.1 that will make the message body > >accessible to the Perl filter. > How is it on resources? *shrug* It hasn't blown up my test server, but I haven't tested it on my news hub (which runs Diablo). The principle is simple enough -- pass a pointer to the article body from INN to Perl, which simply references it (instead of copying). There don't seem to be memory leaks on my test server, but it only has a partial feed (news.*). Two comments. Don't forget to use the multi-line regex modifier when doing string matching on the body (/pattern/m). And what happens when an 8-bit article, with possible embedded NULLs, comes along? Your guess is as good as mine. If you come up with some cool duplicate-body code and don't see any memory leaks in my patch, post it here, or maybe let me incorporate it into my Perl filter. -- Jeff Garzik Quality news feeds News Administrator INN Technical info, Consulting Spinne, Inc. http://www.spinne.com/usenet/
Re: Filtering message body (was Re: Posting sux!! so does INN)
Author: Jeremy
Date: Sun, 20 Jul 1997 00:00
Date: Sun, 20 Jul 1997 00:00
15 lines
1038 bytes
1038 bytes
Jeff Garzik <jeff.garzik@spinne.com> wrote: >heh. Here's patch to INN 1.5.1 that will make the message body >accessible to the Perl filter. I love you. :) How is it on resources? -- Jeremy | jeremy@exit109.com "Everything you think you know is wrong." --Jack Chalker
Re: Filtering message body (was Re: Posting sux!! so does INN)
Author: Greg Andrews
Date: Sun, 20 Jul 1997 00:00
Date: Sun, 20 Jul 1997 00:00
41 lines
2138 bytes
2138 bytes
Michael Hucka <hucka@eecs.umich.edu> writes:
>
>The obvious technical problem is finding a body signature that is
>(1) sufficiently unique while being (2) quick to compute and (3) very, very
>small in terms of storage requirements.
Here's an idea I've been kicking around for about a year now:
1. Strip header lines (except perhaps for NNTP-Posting-Host),
2. Strip signature lines,
3. Strip all punctuation and whitespace except perhaps for
end-of-line characters (\n),
4. Strip blank lines (not necessary if end-of-line chars stripped),
5. Force remainder to lowercase,
6. Generate a 128-bit MD4 hash of the text.
Now you have a signature that accurately represents the text in the
article body, yet won't be fooled by insignificant changes to the
article like different capitalization, extra whitespace or blank lines,
or the use of different quoting characters.
MD4 is took weak for cryptography, but it's probably fine for this
application, and the descriptions I've seen (like the Tripwire docs)
say the calculation is very fast on 32-bit RISC architectures.
-Greg
--
::::::::::::::::::: Greg Andrews gerg@netcom.com :::::::::::::::::::
ObGuindon: Caution: This jacket has 37 Velcro(tm) closures.
Do not hug a moose with the flaps open.
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Re: Filtering message body (was Re: Posting sux!! so does INN)
Author: Jan Hrdonka
Date: Mon, 21 Jul 1997 00:00
Date: Mon, 21 Jul 1997 00:00
19 lines
1498 bytes
1498 bytes
[...] : heh. Here's patch to INN 1.5.1 that will make the message body : accessible to the Perl filter. To drop no-body messages, you would just : need to amend the Perl filter to include [...] An anti-spam tool checking the article body looks very nice for me. But, I've seen a spam posts made by a posting tool which randomly changed article headers. It's really very simple to add an extra random word to the article body and MD4 signature (CRC etc.) will be completely different. I think, the need is a way how to compare bodies more cleverly - `close to be the same' or `completely different' instead of simple - `the same' or `different'. Of course, I know, it wouldn't be so easy to do it and it will probably `eat' more resources than the method like mentioned in this thread. H. <hrd@eunet.cz>
Re: Filtering message body (was Re: Posting sux!! so does INN)
Author: Ian Stirling
Date: Mon, 21 Jul 1997 00:00
Date: Mon, 21 Jul 1997 00:00
64 lines
3919 bytes
3919 bytes
Greg Andrews <gerg@netcom.com> wrote: : Ian Stirling <000033D24C9E.NO_UCE@mauve.demon.co.uk> writes: : >Greg Andrews <gerg@netcom.com> wrote: : >: Michael Hucka <hucka@eecs.umich.edu> writes: : >: > : >: >The obvious technical problem is finding a body signature that is : >: >(1) sufficiently unique while being (2) quick to compute and (3) very, very : >: Here's an idea I've been kicking around for about a year now: : >: 1. Strip header lines (except perhaps for NNTP-Posting-Host), : >5.5 Strip all lines containing "[Nn]ewsgroup" or the name of the : >current newsgroup. : Certainly. I haven't kept in touch with current multi-posting : techniques, so I wasn't aware that the culprits inserted the : newsgroup name in the posts to each group. Few do, but it's dead easy for spammer software to include it, hence.... : I would amend "the name of the current newsgroup" to read "the names : of any newsgroups in the Newsgroups: header". The nntp "POST" command : can be made outside a newsgroup context, and some newsreaders make : separate connections to post articles so nothing interrupts the read : connection. : > : >: 6. Generate a 128-bit MD4 hash of the text. : >Would CRC be quicker? : > : Not according to the speed comparisons published in Tripwire 1.2's : README file. Their performance tests showed CRC had a top speed of : Besides, CRC-16 and CRC-32 would have a much higher risk of signature : collisions for this kind of application. (different articles could : generate the same CRC) If you're going to refuse articles based on : their hash signatures, you want to make sure the signature is unique : to that article. CRC-32 would certainly collide, CRC-64 is better, though 128 would be preferred. Unfortunately this sort of thing will only work for one generation of spamming software, it's dead easy to get round, simply because for every little you change the body, much more work has to be done to counter it. I still think there are a few ways to get round spamming, A) convicts scanning for spam, would need about a thousand of them in rotation. Two thousand, and have each crosschecked. B) Contracts on new users "I won't spam, and am liable for cleanup charges if I do" C) Contracts of another sort. D) make spamming a criminal offence, (this helps with A) -- Ian Stirling. Designing a linux PDA, see http://www.mauve.demon.co.uk/ -----******* If replying by email, check notices in header *******------- My inner child can beat up your inner child. Alex Greenbank
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads