Blocklist
aus MLdonkey, der freien Wissensdatenbank
Inhaltsverzeichnis |
Web blocking List
Der MLDonkey verfügt über einen Automatisierten Mechanismus mit dem man Blocklisten in bestimmten Intervallen aus dem netz Aktualisieren kann. Dazu muss man nur einen entsprechenden Eintrag in den web_infos machen, dieser muss folgende Informationen beinhalten: TYP, INTERVALL, URL Als TYP muss man guarding.p2p eintragen, INTERVALL ist in Stunden anzugeben, und URL bedarf wohl keiner weiteren Erklärung ;)
Beispiel:
TYP INTERVALL URL guarding.p2p 168 http://www.bluetack.co.uk/config/level1.gz guarding.p2p 24 http://www.alpinosoft.net/guarding/guarding.p2p
Die Blocklisten können auch in einem Archiv als gz/bz2 oder zip komprimiert sein, müssen dan aber als guarding.p2p oder guarding_full.p2p vorliegen.
Um in den web_infos Einträge hinzuzufügen oder zu Entfernen benutzt man am besten im Webinterface den Befehl vwi, dieser zeigt euch eine komplette Liste der web_infos Einträge einen ausführlichen Helptext und eine Übersicht der möglichen Dateitypen welche man mit web_infos laden kann.
Um die in den web_infos eingetragenen Listen unabhängig von dem angegebenen Intervall sofort zu Aktualisiseren kann man force_web_infos verwenden.
Local blocking List
Der MLDonkey hat neben der Web blocking List noch die Möglichkeit local gespeicherte Blocklisten (z.b. eigene oder selbst modifizierte) zu laden.
- lege deine guarding.p2p im Verzeichnis vom mldonkey ab - falls du eine Version ab 2.6.4 hast kann die guarding.p2p auch in einem gz/bz2 oder zip komprimierten Archiv liegen.
- verbinde dich mit dem core via Telnet, Http oder einer GUI
- in der Option Ip_blocking wird die local gespeicherte Blockliste angegeben, wenn diese im Arbeitsverzeichniss deines MLDonkey's liegt müssen keine weiteren Pfade angegeben werden:
set ip_blocking guarding.p2p
das wars schon - um zu kontrollieren ob die Liste korrekt geladen wurde verwende block_list.
Um eine neue Liste zu laden muss der MLDonkey nicht gestoppt werden, einfach die guarding.p2p ersetzen und die Option Ip_blocking erneut setzen (set ip_blocking guarding.p2p) dann wird die Liste neu geladen.
Link's zu Blocklisten
Links zu Blocklisten findet ihr unter DownloadLinks
Script's
Dieses Script von mir (spamsuxx) (Forumsbeitrag hier)
erstellt aus verschiedenen Blocklists eine kombinierte Blocklist (doppelte Einträge werden automatisch gefiltert)
und benachrichtigt den Esel über die neue blocklist.
Selbstverständlich kann man auswählen aus welchen Listen die Blocklist zusammengestellt wird.
Aktuelles werdet ihr im entsprechendem Forum Beitrag finden.
Wer aktuellere oder weitere Blocklists kennt, schreibt sie mir im Forum und ich binde sie ein.
#!/bin/bash
#
#--------------------------------------------------------------------------------
#ipguard4mld v1.3, Copyright spamsuxx
#--------------------------------------------------------------------------------
#This program is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2 of the License, or
#(at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#
#To view the license visit
#http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#or write to
#Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#--------------------------------------------------------------------------------
#--------------------------------------------------------------------------------
#
#IP blacklist refresh script
#for mldonkey, to keep spammers, ads, porn
#and other nasty stuff away from the donkey.
#Based on lists from:
#http://peerguardian.sourceforge.net,
#http://www.bluetack.co.uk/forums/index.php
#
#!Don't abuse the P2P network!
#
# Homedir of your mldonkey
DONKEYHOME="/home/p2p/.mldonkey"
# Where in the homedir should the lists be stored?
STORDIR="blocklists"
# Please enter your Admin user and Password for this user
ADMIN="admin"
PASSWORD="PASSWORD"
# IP or hostname on which your donkey is listening
MYHOST="localhost"
# Port your donkey is listening on
MYPORT="4000"
## ##
#No need to edit anything below this#
## ##
##
#Setting all the lists to use (remember to add new lists to FETCHALL and the function MENU
##
#
#PEERGUARDIAN LISTS
#
PGADS="http://peerguardian.sourceforge.net/lists/ads.php"
PGEDU="http://peerguardian.sourceforge.net/lists/edu.php"
PGP2P="http://peerguardian.sourceforge.net/lists/p2p.php"
PGSPY="http://peerguardian.sourceforge.net/lists/spy.php"
#
#BLUETACK LISTS
#
BTTROJAN="http://www.bluetack.nl/bluetack/trojan.zip"
BTADS="http://www.bluetack.info/temp/ads-trackers-and-bad-pr0n.zip"
BTBOGON="http://www.bluetack.info/temp/bogon.zip"
BTDSHIELD="http://www.bluetack.nl/bluetack/dshield.zip"
BTEDU="http://min.midco.net/jinx/bluetack/edu.zip"
BTHIJACK="http://www.bluetack.nl/bluetack/hijacked.zip"
BTLEVEL1="http://www.btack.info/bluetack/level1.zip"
BTLEVEL2="http://min.midco.net/jinx/bluetack/level2.zip"
#BTLEVEL3="http://www.btack.info/bluetack/level3.zip"
BTLEVEL3="http://www.bluetack.co.uk/config/level3.gz"
BTMICROSOFT="http://www.bluetack.nl/bluetack/Microsoft.zip"
#BTRANGETEST="http://www.btack.info/bluetack/rangetest.zip"
BTRANGETEST="http://www.bluetack.co.uk/config/rangetest.gz"
BTSPIDDER="http://www.bluetack.nl/bluetack/spider.zip"
BTSPYWARE="http://www.bluetack.info/temp/spyware.zip"
BTTEMPLIST="http://www.bluetack.info/temp/templist.zip"
#
#Set all URLs for FETCHALL
#
FETCHALL=( "$PGADS" "$PGEDU" "$PGP2P" "$PGSPY" "$BTTROJAN" "$BTADS" "$BTBOGON" "$BTDSHIELD" "$BTDSHIELD" "$BTEDU" "$BTHIJACK" "$BTLEVEL1" "$BTLEVEL2" "$BTLEVEL3" "$BTMICROSOFT" "$BTMICROSOFT" "$BTRANGETEST" "$BTSPIDDER" "$BTSPYWARE" "$BTTEMPLIST" )
# Set path of the required apps
NC=`which nc`
WGET=`which wget`
SEVENZ=`which 7z`
UNZIP=`which unzip`
GUNZIP=`which gunzip`
# Check if the storeage dir for the lists exists or is a file
LISTDIR="$DONKEYHOME/$STORDIR"
if [[ -e $LISTDIR && ! -d $LISTDIR ]] ; then
echo -e "A file with the name \"$LISTDIR\" exist.\n Please choose another name for the lists storage directory"
exit 1
else
mkdir -p $LISTDIR
fi
# Jump to correct location
cd $LISTDIR
if [[ -z "$SEVENZ" ]] ; then
echo "you need to install 7zip"
exit 1
elif [[ -z "$NC" ]] ; then
echo "You need to install NetCat (nc)"
exit 1
elif [[ -z "$WGET" ]] ; then
echo "You need to install wget"
exit 1
fi
# Fetch only the files if they are newer than the local files
function FETCH {
for (( j = 0 ; "$j" < ${#FETCHURLS[@]} ; j++ )) ; do
$WGET -q --no-dns-cache --timeout=20 --tries=3 -N -P $LISTDIR ${FETCHURLS[$j]} || echo "Could not download ${FETCHURLS[$j]}"
done
}
# Unpack everything in the $LISTDIR and compine the selected list into one large list (combined.txt)
function UNPACK {
cd $LISTDIR
test -e combined.txt && rm -f combined.txt
test -e unsorted.txt && rm -f unsorted.txt
for i in *.7z ; do
$SEVENZ e -bd $i -so >> unsorted.txt 2>/dev/null || echo "Could not un7 $i"
done
for i in *.zip ; do
$UNZIP -p $i >> unsorted.txt 2>/dev/null || echo "Could not unzip $i"
done
for i in *.gz ; do
$GUNZIP -dc $i >> unsorted.txt 2>/dev/null || echo "Could not gunzip $i"
done
#remove duplicate lines
sort -u unsorted.txt > combined.txt
# echo "Removed $(( `wc -l unsorted.txt | cut -d " " -f1` - `wc -l combined.txt | cut -d " " -f1` )) duplicate lines"
rm -f unsorted.txt
}
# Notify the donkey of the new blocklist
function UPDATEED {
if $NC -z $MYHOST $MYPORT >/dev/null 2>&1 ; then
$NC $MYHOST $MYPORT >/dev/null 2>&1 <<-EOF
auth $ADMIN $PASSWORD
set ip_blocking $LISTDIR/combined.txt
q
EOF
fi
}
# Cleanout files if user wants it
function CLEANALL {
cd $LISTDIR && rm -f *.7z *.zip *.gz
echo "" > combined.txt
UPDATEED
}
# Check the parameters
function MENU {
CLEAN="NO"
if [[ "$#" == "0" ]] ; then
echo "use --help to get more info"
exit 0
fi
#Set the options which sould be displayed
OPTIONS=( pgads pgedu pgp2p pgspy bttrojan btads btbogon btdshield btedu bthijack btlevel1 btlevel1 btlevel2 btlevel3 btmicrosoft btrangetest btspidder btspyware bttemplist all clean)
while [ $# -gt 0 ]; do
case "$1" in
+pgads) FETCHURLS=( ${FETCHURLS[*]} "$PGADS" ) ;;
-pgads) FETCHURLS=( ${FETCHURLS[*]#"$PGADS"} ) ;;
+pgedu) FETCHURLS=( ${FETCHURLS[*]} "$PGEDU" ) ;;
-pgedu) FETCHURLS=( ${FETCHURLS[*]#"$PGEDU"} ) ;;
+pgp2p) FETCHURLS=( ${FETCHURLS[*]} "$PGP2P" ) ;;
-pgp2p) FETCHURLS=( ${FETCHURLS[*]#"$PGP2P"} ) ;;
+pgspy) FETCHURLS=( ${FETCHURLS[*]} "$PGSPY" ) ;;
-pgspy) FETCHURLS=( ${FETCHURLS[*]#"$PGSPY"} ) ;;
+bttrojan) FETCHURLS=( ${FETCHURLS[*]} "$BTTROJAN" ) ;;
-bttrojan) FETCHURLS=( ${FETCHURLS[*]#"$BTTROJAN"} ) ;;
+btads) FETCHURLS=( ${FETCHURLS[*]} "$BTADS" ) ;;
-btads) FETCHURLS=( ${FETCHURLS[*]#"$BTADS"} ) ;;
+btbogon) FETCHURLS=( ${FETCHURLS[*]} "$BTBOGON" ) ;;
-btbogon) FETCHURLS=( ${FETCHURLS[*]#"$BTBOGON"} ) ;;
+btdshield) FETCHURLS=( ${FETCHURLS[*]} "$BTDSHIELD" ) ;;
-btdshield) FETCHURLS=( ${FETCHURLS[*]#"$BTDSHIELD"} ) ;;
+btedu) FETCHURLS=( ${FETCHURLS[*]} "$BTEDU" ) ;;
-btedu) FETCHURLS=( ${FETCHURLS[*]#"$BTEDU"} ) ;;
+bthijack) FETCHURLS=( ${FETCHURLS[*]} "$BTHIJACK" ) ;;
-bthijack) FETCHURLS=( ${FETCHURLS[*]#"$BTHIJACK"} ) ;;
+btlevel1) FETCHURLS=( ${FETCHURLS[*]} "$BTLEVEL1" ) ;;
-btlevel1) FETCHURLS=( ${FETCHURLS[*]#"$BTLEVEL1"} ) ;;
+btlevel2) FETCHURLS=( ${FETCHURLS[*]} "$BTLEVEL2" ) ;;
-btlevel2) FETCHURLS=( ${FETCHURLS[*]#"$BTLEVEL2"} ) ;;
+btlevel3) FETCHURLS=( ${FETCHURLS[*]} "$BTLEVEL3" ) ;;
-btlevel3) FETCHURLS=( ${FETCHURLS[*]#"$BTLEVEL3"} ) ;;
+btmicrosoft) FETCHURLS=( ${FETCHURLS[*]} "$BTMICROSOFT" ) ;;
-btmicrosoft) FETCHURLS=( ${FETCHURLS[*]#"$BTMICROSOFT"} ) ;;
+btrangetest) FETCHURLS=( ${FETCHURLS[*]} "$BTRANGETEST" ) ;;
-btrangetest) FETCHURLS=( ${FETCHURLS[*]#"$BTRANGETEST"} ) ;;
+btspidder) FETCHURLS=( ${FETCHURLS[*]} "$BTSPIDDER" ) ;;
-btspidder) FETCHURLS=( ${FETCHURLS[*]#"$BTSPIDDER"} ) ;;
+btspyware) FETCHURLS=( ${FETCHURLS[*]} "$BTSPYWARE" ) ;;
-btspyware) FETCHURLS=( ${FETCHURLS[*]#"$BTSPYWARE"} ) ;;
+bttemplist) FETCHURLS=( ${FETCHURLS[*]} "$BTTEMPLIST" ) ;;
-bttemplist) FETCHURLS=( ${FETCHURLS[*]#"$BTTEMPLIST"} ) ;;
all) FETCHURLS=( ${FETCHALL[*]} ) ;;
clean) CLEAN="YES" ;;
*|"") echo -e "USAGE: peerguardian.sh [all|clean] [+|-][listname] ...\n\nAvailable lists:\n${OPTIONS[*]}\n\nall\nSelects all lists at once (you can exclude one or more lists with -[listname])\n\nclean\nRemoves all previously downloaded lists, emties blocklists and notifies the donkey about the empty list [clean will not take any further arguments]. (use this if you installed 2 or more lists and now want to use another combination of list or if you want remove all IP-blocking.)\n\n+[listname]\nSelects a single list. This option can be used more than once to pull in various lists [+list1 +list2 ...]\n\n-[listname]\nOnly usefull in conjunction with \"all\". Excludes the specified list from the \"all\" option\n\nDuplicate IP-Ranges are stripped from the combined.txt file" ; exit 0 ;;
esac
shift # Check next set of parameters.
done
if [[ "$CLEAN" == "YES" ]] ; then
CLEANALL
else
FETCH
UNPACK
UPDATEED
fi
}
# Let's get it running.
MENU $@
siehe auch
- vwi - web_infos optionen anzeigen
- urladd - Eintrag in web_infos hinzufügen
- urlremove - Eintrag aus web_infos entfernen
- block_list - zeigt eine Liste der geblockten IP Ranges und deren bisherige Treffer
- force_web_infos - Einträge in web_infos unabhängig des Intervall's sofort laden
- ip_blocking - Option für die local Blocklist
- ip_blocking_countries - Option für das blocken ganzer Länder
- ip_blocking_countries_block - umschalten zwischen blacklist/whitelist von ip_blocking_countries
