From 62f6463fd32045e22aa5511c29362b1e2ece73a2 Mon Sep 17 00:00:00 2001 From: acidvegas Date: Mon, 30 Oct 2023 10:38:10 -0400 Subject: [PATCH] Added OpenNIC AXFR script --- opennic | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 opennic 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