Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

"355/113 -- Not the famous irrational number PI, but an incredible simulation!"


computers / news.admin.net-abuse.usenet / Re: A new script...

SubjectAuthor
* A new script...Adam W.
+- Re: A new script...yamo'
`- Re: A new script...yamo'

1
A new script...

<up740e$9qj$3$arnold@news.chmurka.net>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=4830&group=news.admin.net-abuse.usenet#4830

  copy link   Newsgroups: news.admin.net-abuse.usenet
Path: i2pn2.org!i2pn.org!news.chmurka.net!.POSTED.s.v.chmurka.net!not-for-mail
From: gof-cut-this-news@cut-this-chmurka.net.invalid (Adam W.)
Newsgroups: news.admin.net-abuse.usenet
Subject: A new script...
Date: Mon, 29 Jan 2024 02:54:06 -0000 (UTC)
Organization: news.chmurka.net
Message-ID: <up740e$9qj$3$arnold@news.chmurka.net>
NNTP-Posting-Host: s.v.chmurka.net
Injection-Date: Mon, 29 Jan 2024 02:54:06 -0000 (UTC)
Injection-Info: news.chmurka.net; posting-account="arnold"; posting-host="s.v.chmurka.net:172.24.44.20";
logging-data="10067"; mail-complaints-to="abuse-news.(at).chmurka.net"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/6.1.21-v7+ (armv7l))
Cancel-Lock: sha1:xdCzhyZ68WP7XGKxgD0jKmSOcMQ=
sha1:0E/jWBurTH0Q8fiUTaPc5GK+g7A= sha256:jh8K8atV0dCJNLqM8Y1bYZlIFgwpiPH+pIcCkiOcFSE=
sha1:3u9evX8uD8+PvmQYBvgrnieQkEI= sha256:Nc8C5JooQCalMY9sASCfrDTdFAmopVr6xV6SSbEJE8s=
 by: Adam W. - Mon, 29 Jan 2024 02:54 UTC

....to aid in quickly deleting spams encountered on groups. Useful to me,
after some modifications might be also useful to someone else.

I invoke with an email address of a spammer (optionally only part before
@gmail.com). It greps the overview database for posts from that spammer
(only tradindexed is supported), shows a summary (with subjects, MsgIDs,
and newsgroups) and, if not cancelled at this point, copies these articles
to some location (in my case it's a location from which reposts to local
spam groups and NoCeM reports are generated), cancels them locally, and
adds e-mail to the text file that's used by the inn filter to kill these
articles on entry.

One drawback: if an email of a spammer appears in other headers in the
overview (for example in the Subject line), such article will be cancelled
as well. That's one reason to review the summary before proceeding.

#!/bin/bash

[ $# = 1 ] || { echo "Syntax: spam.sh <email>"; exit 1; }

if [[ "$1" = *@* ]]; then
email="$1"
else
email="$1"@gmail.com
fi

# Some basic paths
base=/usr/local/news
overview="$base"/spool/overview
gh="$base"/bin/grephistory
sm="$base"/bin/sm
ci="$base"/bin/ctlinnd

# Directory to copy cancelled articles to. They're processed later to copy
# articles to chmurka.spam.* groups and create NoCeMs
copydir="$base"/spool/pyother

# File with list of e-mail messages belonging to known spammers
# (inspected by the filter)
spammers="$base"/etc/spammers.txt

tmpfile=$(mktemp)
trap 'rm -f "$tmpfile" "$tmpfile.overview" "$tmpfile.mids"' exit

# Takes some time, might think of something faster
echo "Scanning overview database..."
grep -r "$email" --include '*.DAT' "$overview" > "$tmpfile.overview"

echo
echo "List of subjects follows"
awk -F'\t' '{print $2}' < "$tmpfile.overview" | sort | uniq

echo
echo "List of Message-IDs follows"
awk -F'\t' '{print $5}' < "$tmpfile.overview" | sort | uniq > "$tmpfile.mids"
cat "$tmpfile.mids"

echo
echo "List of newsgroups follows"
sed -e 's/:.*$//' -e 's/^.*\///g' -e 's/\.DAT$//' "$tmpfile.overview" | sort | uniq

echo
echo "Press Enter to continue, Ctrl-C to abort"
read x

echo "$email" >> "$spammers"

for mid in $(cat "$tmpfile.mids"); do
# Let's get the token for the given Message-ID and validate if:
# - it's known (should be)
# - is not already cancelled

token=$("$gh" "$mid")
[ $? -eq 0 ] || { echo "$mid: token not found"; continue; }
[ "$token" = "/dev/null" ] && { echo "$mid: already cancelled"; continue; }

# Create a random filename to copy the article to, and copy it
filename="$copydir"/$(hexdump -C /dev/urandom | head -n 1 | cut -b 11-58 | sed 's/ //g')
"$sm" "$token" > "$filename.tmp" || { echo "$mid: could not retrieve"; rm -f "$filename.tmp"; continue; }
mv "$filename.tmp" "$filename.to-rewrite"

# Finally, let's cancel
"$ci" cancel "$mid"
done

Re: A new script...

<up7jcq$lp$1@rasp.pasdenom.info>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=4831&group=news.admin.net-abuse.usenet#4831

  copy link   Newsgroups: news.admin.net-abuse.usenet
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.gegeweb.eu!gegeweb.org!pasdenom.info!.POSTED.2a01:e0a:21:ea80:1138:ea66:93e:88a9!not-for-mail
From: yamo@beurdin.invalid (yamo')
Newsgroups: news.admin.net-abuse.usenet
Subject: Re: A new script...
Date: Mon, 29 Jan 2024 08:16:42 +0100
Organization: <http://pasdenom.info/news.html>
Message-ID: <up7jcq$lp$1@rasp.pasdenom.info>
References: <up740e$9qj$3$arnold@news.chmurka.net>
Reply-To: yamo@groumpf.org
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 29 Jan 2024 07:16:42 -0000 (UTC)
Injection-Info: rasp.pasdenom.info; posting-account="stephane@usenet"; posting-host="2a01:e0a:21:ea80:1138:ea66:93e:88a9";
logging-data="697"; mail-complaints-to="abuse@pasdenom.info"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.18.1
Cancel-Lock: sha1:u2F5SbJ6fSpx6L7DACtNjEf3dVQ= sha256:LwWpYBAHtfCdDW5BTYHzU07Cndzq5ZVCRZu2sZ9ooG8=
sha1:Nj1/IPa0GfHY6MUufVYpaoSyEXk= sha256:Q1mY/OH30uPQjpXq5x7RZYJn3A1OiMZaqoAIDCdWqKg=
X-Seamonkey: <https://www.seamonkey-project.org/>
In-Reply-To: <up740e$9qj$3$arnold@news.chmurka.net>
 by: yamo' - Mon, 29 Jan 2024 07:16 UTC

Hi,
Adam W. a tapoté le 29/01/2024 03:54:
> ...to aid in quickly deleting spams encountered on groups. Useful to me,
> after some modifications might be also useful to someone else.

Could you generate a list like NoceM Notices?

<mid1> group1
<mid2> group1 group2
<mid3> group3
....

It will be also useful, and could be checked before sending it (and
NoceM may be faster has ctlinnd cancel).

--
Stéphane
UTILISATEURS de GOOGLE GROUPS, vous n'aurez bientôt plus accès à Usenet.
<https://support.google.com/groups/answer/11036538>
Des serveurs gratuits de remplacement : <http://usenet-fr.yakakwatik.org>
Des logiciels : <http://usenet-fr.yakakwatik.org/lecteurs-de-news.html>

Re: A new script...

<AABlt3Qvyx4AAAu-.A3.flnews@yamo.pasdenom.info>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=4835&group=news.admin.net-abuse.usenet#4835

  copy link   Newsgroups: news.admin.net-abuse.usenet
Path: i2pn2.org!i2pn.org!paganini.bofh.team!pasdenom.info!.POSTED.2a01:e0a:21:ea80:bb1e:6b33:fcc1:fa5e!not-for-mail
From: yamo@beurdin.invalid (yamo')
Newsgroups: news.admin.net-abuse.usenet
Subject: Re: A new script...
Date: Mon, 29 Jan 2024 10:47:27 +0100
Organization: <http://pasdenom.info/news.html>
Message-ID: <AABlt3Qvyx4AAAu-.A3.flnews@yamo.pasdenom.info>
References: <up740e$9qj$3$arnold@news.chmurka.net>
Reply-To: yamo' <yamo@groumpf.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=fixed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 29 Jan 2024 09:47:27 -0000
Injection-Info: rasp.pasdenom.info; posting-account="stephane@usenet"; posting-host="2a01:e0a:21:ea80:bb1e:6b33:fcc1:fa5e";
logging-data="19523"; mail-complaints-to="abuse@pasdenom.info"
User-Agent: flnews/1.2.0 (for GNU/Linux)
Cancel-Lock: sha1:pJTNzJ0cSG5w9nSUb6HJ8e1QrmY= sha256:obmgJyedRHk5ecwttTMX4eUHBe8D6G0FTVLMixWmS9U=
sha1:8PE9OuORzQBqfbjEvLHyYBZb/Bg= sha256:8tp9WeVhgWJRk98UACL0Bg6iLuOL0VKuLV+Ze+QmFTM=
sha1:0nThDqMsyz1yDqHjJ59IavqrpQM= sha256:0XS4ZcEfd89/fbPp26pY7I1nXzdHJ7hmtbH5B6RGaOg=
 by: yamo' - Mon, 29 Jan 2024 09:47 UTC

Hi,
Adam W. a tapoté :
>
> # Finally, let's cancel
> "$ci" cancel "$mid"

Thanks a lot!
Very useful!

I've modified here by those lines to have a NoceM Notice :

NEWSGROUPS=$(egrep '^Newsgroups: ' "$filename.to-rewrite" | head -1 | awk '{print $2;}' | sed 's/,/ /g')
# Finally, let's cancel
#"$ci" cancel "$mid"
echo "$mid $NEWSGROUPS"

--
Stéphane

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor