kayo77

AntiHazard with CertPL

Apr 1st, 2020
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.73 KB | None | 0 0
  1. #!/bin/bash
  2. curl -k --silent -H "Accept: application/xml" -H "Content-Type: application/xml" -X GET https://hazard.mf.gov.pl/api/Register | \
  3.      grep "AdresDomeny" | awk -F "<AdresDomeny>" '{print $2}' | \
  4.      idn2 | awk -F "</adresdomeny>" '{print  "zone \""$1"\" {type master; file \"/etc/bind/hazard.hosts\";};" }' > /tmp/hazard.zones
  5.  
  6. /usr/sbin/named-checkzone /tmp/hazard.zones /etc/bind/hazard.hosts
  7. if [ $? -eq 0 ]
  8. then
  9.     cp -u --preserve=mode,ownership /tmp/hazard.zones /etc/bind/hazard.zones
  10.     /usr/sbin/rndc reload
  11.     rm /tmp/hazard.zones
  12. else
  13.     echo "ERROR hazard!"
  14. fi
  15.  
  16.  
  17.  
  18. curl -sS http://malware-domains.com/files/spywaredomains.zones.zip > spywaredomains.zones.zip && unzip -o spywaredomains.zones.zip -d /tmp && rm spywaredomains.zones.zip
  19. cat /tmp/spywaredomains.zones | grep master > /tmp/spywaredomains2.zones
  20. /usr/sbin/named-checkzone /tmp/spywaredomains2.zones /etc/bind/blockeddomain.hosts
  21. if [ $? -eq 0 ]
  22. then
  23.     cp -u --preserve=mode,ownership /tmp/spywaredomains2.zones /etc/bind/spywaredomains.zones
  24.     /usr/sbin/rndc reload
  25.     rm /tmp/spywaredomains.zones
  26. else
  27.     echo "ERROR spywarezone!"
  28. fi
  29.  
  30.  
  31.  
  32. curl -k --silent -H "Accept: application/xml" -H "Content-Type: application/xml" -X GET https://hole.cert.pl/domains/domains.xml | \
  33.      grep "AdresDomeny" | awk -F "<AdresDomeny>" '{print $2}' | \
  34.      idn2 | awk -F "</adresdomeny>" '{print  "zone \""$1"\" {type master; file \"/etc/bind/certplbh.hosts\";};" }' > /tmp/certplbh.zones
  35. /usr/sbin/named-checkzone /tmp/certplbh.zones /etc/bind/certplbh.hosts
  36. if [ $? -eq 0 ]
  37. then
  38.     cp -u --preserve=mode,ownership /tmp/certplbh.zones /etc/bind/certplbh.zones
  39.     /usr/sbin/rndc reload
  40.     rm /tmp/certplbh.zones
  41. else
  42.     echo "ERROR cert!"
  43. fi
Advertisement
Add Comment
Please, Sign In to add comment