mdaxfr- Mass DNS AXFR |
git clone git://git.acid.vegas/mdaxfr.git |
Log | Files | Refs | Archive | README | LICENSE |
opennic (1293B)
1 #!/bin/sh 2 # OpenNIC AXFR - devloped by acidvegas (https://git.acid.vegas/mdaxfr) 3 # Todo: Find a better way to retrieve the TLDs so we don't have to hardcode them 4 5 servers=$(curl -s 'https://api.opennicproject.org/geoip/?list&ipv=all&res=100' | grep -oE '([0-9]{1,3}(\.[0-9]{1,3}){3}|[0-9a-fA-F:]+:[0-9a-fA-F:]+)') 6 tlds=("bbs" "chan" "cyb" "dyn" "epic" "geek" "gopher" "indy" "libre" "neo" "null" "o" "oss" "oz" "parody" "pirate" "opennic.glue" "dns.opennic.glue") 7 ptlds=("bazar" "bit" "coin" "emc" "lib" "fur" "ku" "te" "ti" "uu" "ko" "rm") 8 all_tlds=("${tlds[@]}" "${ptlds[@]}") 9 10 for tld in "${ptlds[@]}"; do 11 echo "Attempting zone transfer for $tld..." 12 success=0 13 for server in $servers; do 14 if ! output=$(dig AXFR "$tld." @"$server" 2>&1); then 15 echo "Error running dig for $tld at $server." 16 continue 17 fi 18 19 if echo "$output" | grep -q '; Transfer failed.'; then 20 echo "Zone transfer failed for $tld at $server." 21 else 22 echo "$output" > "${tld}.txt" 23 echo "Zone transfer successful for $tld at $server, output written to ${tld}.txt" 24 success=1 25 break 26 fi 27 done 28 if [ $success -eq 0 ]; then 29 echo "Zone transfer failed for $tld at all servers." 30 fi 31 done