Okean Sino-Korea and DShield Top 20 Blocklist for Rocky Arno’s IPtables blockhosts file

By technese - Last updated: Saturday, November 26, 2011 - Save & Share - Leave a Comment
#!/bin/sh
# script created from technese.com
# Download Okean Sino-Korea Block IP list
rm -f /tmp/cnkr_htaccess.txt
rm -f /tmp/top10-2.txt
wget http://www.okean.com/antispam/cnkr_htaccess.txt -P /tmp
file=/tmp/cnkr_htaccess.txt
file2=/tmp/top10-2.txt
tempfile=/etc/arno-iptables-firewall/blocked-hosts
# Remove first and last lines, and "deny from " text
echo '#Okean Sino-Korea Block IP list:' `date`'' > $tempfile
sed -e '1d' -e 's/deny from //' -e '$d' < $file >> $tempfile
# Append DShield Top 20 IPs
echo '#DShield Top 20 IP Block :' `date`'' >> $tempfile
wget http://feeds.dshield.org/top10-2.txt -P /tmp
# print first column and add /24 to DShield IPs
awk '{ print $1 }' < $file2 | sed 's/$/\/24/' >> $tempfile

Download and rename with .sh file type:

blockIPlist.txt

Reference:

http://www.okean.com
http://dshield.org

Posted in General, Network, Security • • Top Of Page