makeblacklist.sh
· 1.1 KiB · Bash
Raw
#!/bin/sh
cd /etc/havp
OUTFILE=/etc/havp/blacklist
ADSERVERLIST=/etc/havp/adserverlist
PHISHTANK=/etc/havp/phishtank
MYBLACKLIST=/etc/havp/myblacklist
wget -q -N "http://pgl.yoyo.org/adservers/serverlist.php?hostformat=webwasher;showintro=0;mimetype=plaintext"
sed -e 's_^//_#_g' serverlist.php* | sort | uniq > $ADSERVERLIST
wget -q -N http://data.phishtank.com/data/<PhishTank API key>/online-valid.csv.bz2
bzcat online-valid.csv.bz2|sed -e 's/^[0-9]*,//' -e 's@,http://www.phishtank.com/phish_detail.php?phish_id=[0-9]*,.*$@@' -e 's/^"\(.*\)"$/\1/' -e 's_^https\?://__' -e 's/#.*//' -e 's_/$_/*_' -e 's_^\([^/]*\)$_\1/*_' -e 's/?.*/*/' -e 's_^\([^/]*\)\*$_\1/*_' -e 's/\*.*/*/'| grep -vF 'phish_id,url,phish_detail_url,submission_time,verified,verification_time,online,target' | iconv -f utf8 -t ascii -c - | sort | uniq > $PHISHTANK
echo "# blacklist file generated by $0, `date`" > $OUTFILE
echo "\n# MYBLACKLIST:" >> $OUTFILE
cat $MYBLACKLIST >> $OUTFILE
echo "\n# ADSERVERLIST:" >> $OUTFILE
cat $ADSERVERLIST >> $OUTFILE
echo "\n# PHISHTANK:" >> $OUTFILE
cat $PHISHTANK >> $OUTFILE
| 1 | #!/bin/sh |
| 2 | |
| 3 | cd /etc/havp |
| 4 | |
| 5 | OUTFILE=/etc/havp/blacklist |
| 6 | |
| 7 | ADSERVERLIST=/etc/havp/adserverlist |
| 8 | PHISHTANK=/etc/havp/phishtank |
| 9 | MYBLACKLIST=/etc/havp/myblacklist |
| 10 | |
| 11 | wget -q -N "http://pgl.yoyo.org/adservers/serverlist.php?hostformat=webwasher;showintro=0;mimetype=plaintext" |
| 12 | sed -e 's_^//_#_g' serverlist.php* | sort | uniq > $ADSERVERLIST |
| 13 | |
| 14 | wget -q -N http://data.phishtank.com/data/<PhishTank API key>/online-valid.csv.bz2 |
| 15 | bzcat online-valid.csv.bz2|sed -e 's/^[0-9]*,//' -e 's@,http://www.phishtank.com/phish_detail.php?phish_id=[0-9]*,.*$@@' -e 's/^"\(.*\)"$/\1/' -e 's_^https\?://__' -e 's/#.*//' -e 's_/$_/*_' -e 's_^\([^/]*\)$_\1/*_' -e 's/?.*/*/' -e 's_^\([^/]*\)\*$_\1/*_' -e 's/\*.*/*/'| grep -vF 'phish_id,url,phish_detail_url,submission_time,verified,verification_time,online,target' | iconv -f utf8 -t ascii -c - | sort | uniq > $PHISHTANK |
| 16 | |
| 17 | |
| 18 | echo "# blacklist file generated by $0, `date`" > $OUTFILE |
| 19 | |
| 20 | echo "\n# MYBLACKLIST:" >> $OUTFILE |
| 21 | cat $MYBLACKLIST >> $OUTFILE |
| 22 | |
| 23 | echo "\n# ADSERVERLIST:" >> $OUTFILE |
| 24 | cat $ADSERVERLIST >> $OUTFILE |
| 25 | |
| 26 | echo "\n# PHISHTANK:" >> $OUTFILE |
| 27 | cat $PHISHTANK >> $OUTFILE |