Advertisement
kosuke_

ads

Apr 29th, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.11 KB | None | 0 0
  1. wget http://malc0de.com/bl/ZONES -O /etc/blackhole/malcode.tmp
  2. cat /etc/blacklist/malcode.tmp | cut -d'"' -f2 | grep -v -E "//|^$|#"| cut -d'?' -f1 | sed -e '/^M/d' >> /etc/blacklist/master.list
  3. wget http://dns-bh.sagadc.org/domains.txt -O /etc/blacklist/dns-bh.sagadc.org.tmp
  4. cat /etc/blacklist/dns-bh.sagadc.org.tmp | grep -v '#' | awk '$1 ~ /^20/ {print}' | awk '$6 ~ /^20/ {print $2}' | sort -u | sed -e '/^M/d' >> /etc/blacklist/master.list
  5. cat /etc/blacklist/master.list | grep -v '<' | grep -v '>' | grep -v '#' | grep -v '//' \
  6. | sed '/^$/d' | grep -v -E "\.$" | sort -u > /etc/blacklist/master.list.tmp
  7. rm -rf /etc/blacklist/master.list
  8. dos2unix /etc/blacklist/master.list.tmp
  9. cat /etc/blacklist/master.list.tmp | sort | uniq > /etc/blacklist/master.list
  10. for a in `cat /etc/blacklist/master.list | grep -v '#'`; do
  11. echo 'local-data: "'$a' A 172.16.40.226"' >> /etc/blacklist/blacklisted_domains.tmp
  12. done
  13. curl -sS -L --compressed "http://pgl.yoyo.org/adservers/serverlist.php…" > /etc/blacklisted/ad_servers
  14. cat /etc/blacklisted/ad_servers >> /etc/blacklist/blacklisted_domains.tmp
  15. cat /etc/blacklisted/blacklisted_domains.tmp | sort | uniq > /etc/blacklisted/blacklisted
  16. malc0de.com
  17. // This bind zone is intended to be included in a running dns server for a local net // It will return 127.0.0.1 for domains serving malicious executables observed by malc0de.com/database/ // This file will be automatically updated daily and populated with the last 30 days of malicious domains. // A…
  18. malc0de.com
  19. 11:25AM
  20. blocked
  21.  
  22. Joko
  23. #### unbound DNS filtering buat ads dan malware ####
  24. #!/bin/bash
  25. today=`date "+%Y-%m-%d-%H-%M-%S"`
  26.  
  27. mv /etc/unbound/blackhole/blacklisted /etc/unbound/blackhole/backup/blacklisted.$today
  28. wget -t 3 http://malc0de.com/bl/ZONES -O /etc/unbound/blackhole/malcode.tmp
  29. cat /etc/unbound/blackhole/malcode.tmp | cut -d'"' -f2 | grep -v -E "//|^$|#"| cut -d'?' -f1 | sed -e '/^M/d' >> /etc/unbound/blackhole/master.list
  30. wget http://dns-bh.sagadc.org/domains.txt -O /etc/unbound/blackhole/dns-bh.sagadc.org.tmp
  31. cat /etc/unbound/blackhole/dns-bh.sagadc.org.tmp | grep -v '#' | awk '$1 ~ /^20/ {print}' | awk '$6 ~ /^20/ {print $2}' | sort -u | sed -e '/^M/d' >> /etc/unbound/blackhole/master.list
  32. cat /etc/unbound/blackhole/master.list | grep -v '<' | grep -v '>' | grep -v '#' | grep -v '//' \
  33. | sed '/^$/d' | grep -v -E "\.$" | sort -u > /etc/unbound/blackhole/master.list.tmp
  34. rm -rf /etc/unbound/master.list
  35. dos2unix /etc/unbound/blackhole/master.list.tmp
  36. cat /etc/unbound/blackhole/master.list.tmp | sort | uniq > /etc/unbound/blackhole/master.list
  37. for a in `cat /etc/unbound/blackhole/master.list | grep -v '#'`; do
  38. echo 'local-data: "'$a' A 127.0.0.1"' >> /etc/unbound/blackhole/blacklisted_domains.conf
  39. done
  40. curl -sS -L --compressed "http://pgl.yoyo.org/adservers/serverlist.php?hostformat=unbound&showintro=0&mimetype=plaintext" > /etc/unbound/unbound_ad_servers
  41. cat /etc/unbound/unbound_ad_servers >> /etc/unbound/blackhole/blacklisted_domains.conf
  42. cat /etc/unbound/blackhole/blacklisted_domains.conf | sort | uniq > /etc/unbound/blackhole/blacklisted
  43. rm -rf /etc/unbound/unbound_ad_servers
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement