diff --git a/opennic b/opennic new file mode 100755 index 0000000..a4c2b30 --- /dev/null +++ b/opennic @@ -0,0 +1,34 @@ +#!/bin/sh +# OpenNIC AXFR - devloped by acidvegas (https://git.acid.vegas/mdaxfr) + +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:]+)') + +tlds=("bbs" "chan" "cyb" "dyn" "epic" "geek" "gopher" "indy" "libre" "neo" "null" "o" "oss" "oz" "parody" "pirate" "opennic.glue" "dns.opennic.glue") +ptlds=("bazar" "bit" "coin" "emc" "lib" "fur" "ku" "te" "ti" "uu" "ko" "rm") + +all_tlds=("${tlds[@]}" "${ptlds[@]}") + +for tld in "${ptlds[@]}"; do + echo "Attempting zone transfer for $tld..." + + success=0 + for server in $servers; do + if ! output=$(dig AXFR "$tld." @"$server" 2>&1); then + echo "Error running dig for $tld at $server." + continue + fi + + if echo "$output" | grep -q '; Transfer failed.'; then + echo "Zone transfer failed for $tld at $server." + else + echo "$output" > "${tld}.txt" + echo "Zone transfer successful for $tld at $server, output written to ${tld}.txt" + success=1 + break + fi + done + + if [ $success -eq 0 ]; then + echo "Zone transfer failed for $tld at all servers." + fi +done