Permalink
Browse files

added useful shell scripts

  • Loading branch information...
1 parent 2896aba commit 08c639736e2bf2b38024d8a55ee61655de647139 @jvehent committed Jan 18, 2012
Showing with 115 additions and 0 deletions.
  1. +23 −0 lasso-update.sh
  2. +27 −0 rbl-check.sh
  3. +65 −0 rbl_list.txt
View
@@ -0,0 +1,23 @@
+#! /bin/sh
+URL=http://www.spamhaus.org/drop/drop.lasso
+DROPLASSO=$(mktemp)
+ACLFILE=$(mktemp)
+POSTSCREEN_ACCESS_FILE=/etc/postfix/postscreen_access.cidr
+DATE=$(date +%Y%m%d)
+
+wget --quiet $URL -O $DROPLASSO
+
+if [ -e $DROPLASSO ]
+then
+ # decoupe le fichier source sur le point virgule
+ # et prepare le fichier de destination
+ for network in $(cat $DROPLASSO | awk '{print $1}' |\
+ grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\/[0-9]{1,2}$")
+ do
+ echo -e "$network\treject" >> $ACLFILE
+ done
+fi
+
+cp $POSTSCREEN_ACCESS_FILE{,.bkp$DATE}
+cp $ACLFILE $POSTSCREEN_ACCESS_FILE
+postfix reload
View
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+DEBUG="$1"
+# replace the SRV list with your own machines
+SRV="mail.example.net mail.example.com"
+RBL="bl.spamcop.net cbl.abuseat.org b.barracudacentral.org dnsbl.invaluement.com ddnsbl.internetdefensesystems.com dnsbl.sorbs.net http.dnsbl.sorbs.net dul.dnsbl.sorbs.net misc.dnsbl.sorbs.net smtp.dnsbl.sorbs.net socks.dnsbl.sorbs.net spam.dnsbl.sorbs.net web.dnsbl.sorbs.net zombie.dnsbl.sorbs.net dnsbl-1.uceprotect.net dnsbl-2.uceprotect.net dnsbl-3.uceprotect.net pbl.spamhaus.org sbl.spamhaus.org xbl.spamhaus.org zen.spamhaus.org bl.spamcannibal.org psbl.surriel.com ubl.unsubscore.com dnsbl.njabl.org combined.njabl.org rbl.spamlab.com dnsbl.ahbl.org ircbl.ahbl.org dyna.spamrats.com noptr.spamrats.com spam.spamrats.com cbl.anti-spam.org.cn cdl.anti-spam.org.cn dnsbl.inps.de drone.abuse.ch httpbl.abuse.ch dul.ru korea.services.net short.rbl.jp virus.rbl.jp spamrbl.imp.ch wormrbl.imp.ch virbl.bit.nl rbl.suresupport.com dsn.rfc-ignorant.org ips.backscatterer.org spamguard.leadmon.net opm.tornevall.org netblock.pedantic.org black.uribl.com grey.uribl.com multi.surbl.org ix.dnsbl.manitu.net tor.dan.me.uk rbl.efnetrbl.org relays.mail-abuse.org blackholes.mail-abuse.org rbl-plus.mail-abuse.org dnsbl.dronebl.org access.redhawk.org db.wpbl.info rbl.interserver.net query.senderbase.org bogons.cymru.com"
+for server in $SRV
+do
+ ip=$(dig +short $server)
+ r_ip=$(echo $ip|awk -F"." '{for(i=NF;i>0;i--) printf i!=1?$i".":"%s",$i}')
+ for rbl in $RBL
+ do
+ if [ ! -z "$DEBUG" ]
+ then
+ echo "testing $server ($ip) against $rbl"
+ fi
+ result=$(dig +short $r_ip.$rbl)
+ if [ ! -z "$result" ]
+ then
+ echo "$server ($ip) is in $rbl with code $result"
+ fi
+ if [[ ! -z "$DEBUG" && -z "$result" ]]
+ then
+ echo "\`->negative"
+ fi
+ done
+done
+
View
@@ -0,0 +1,65 @@
+bl.spamcop.net
+cbl.abuseat.org
+b.barracudacentral.org
+dnsbl.invaluement.com
+ddnsbl.internetdefensesystems.com
+dnsbl.sorbs.net
+http.dnsbl.sorbs.net
+dul.dnsbl.sorbs.net
+misc.dnsbl.sorbs.net
+smtp.dnsbl.sorbs.net
+socks.dnsbl.sorbs.net
+spam.dnsbl.sorbs.net
+web.dnsbl.sorbs.net
+zombie.dnsbl.sorbs.net
+dnsbl-1.uceprotect.net
+dnsbl-2.uceprotect.net
+dnsbl-3.uceprotect.net
+pbl.spamhaus.org
+sbl.spamhaus.org
+xbl.spamhaus.org
+zen.spamhaus.org
+bl.spamcannibal.org
+psbl.surriel.com
+ubl.unsubscore.com
+dnsbl.njabl.org
+combined.njabl.org
+rbl.spamlab.com
+dnsbl.ahbl.org
+ircbl.ahbl.org
+dyna.spamrats.com
+noptr.spamrats.com
+spam.spamrats.com
+cbl.anti-spam.org.cn
+cdl.anti-spam.org.cn
+dnsbl.inps.de
+drone.abuse.ch
+httpbl.abuse.ch
+dul.ru
+korea.services.net
+short.rbl.jp
+virus.rbl.jp
+spamrbl.imp.ch
+wormrbl.imp.ch
+virbl.bit.nl
+rbl.suresupport.com
+dsn.rfc-ignorant.org
+ips.backscatterer.org
+spamguard.leadmon.net
+opm.tornevall.org
+netblock.pedantic.org
+black.uribl.com
+grey.uribl.com
+multi.surbl.org
+ix.dnsbl.manitu.net
+tor.dan.me.uk
+rbl.efnetrbl.org
+relays.mail-abuse.org
+blackholes.mail-abuse.org
+rbl-plus.mail-abuse.org
+dnsbl.dronebl.org
+access.redhawk.org
+db.wpbl.info
+rbl.interserver.net
+query.senderbase.org
+bogons.cymru.com

0 comments on commit 08c6397

Please sign in to comment.