x-way revised this gist . Go to revision
No changes
Andreas Jaggi revised this gist . Go to revision
1 file changed, 27 insertions
makeblacklist.sh(file created)
@@ -0,0 +1,27 @@ | |||
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 |
Newer
Older