Code cleanup & README cleanup

This commit is contained in:
Dionysus 2023-11-01 17:02:39 -04:00
parent 605c44c767
commit b441bf9e96
Signed by: acidvegas
GPG Key ID: EF4B922DB85DC9DE
4 changed files with 101 additions and 105 deletions

View File

@ -3,7 +3,7 @@
###### This script will attempt a [Zone Transfer](https://en.wikipedia.org/wiki/DNS_zone_transfer) on all of the [Root Nameservers](https://en.wikipedia.org/wiki/Root_name_server) and [Top-level Domains](https://en.wikipedia.org/wiki/Top-level_domain) *(TLDs)*.
## Expectations & Legalities
Please set realistic expectations when using this tool. In contemporary network configurations, AXFR requests are typically restricted, reflecting best practices in DNS security. While many nameservers now disallow AXFR requests, there may still be occasional instances where configurations permit them. Always exercise due diligence and ensure ethical use.
It is expected to set *realistic* expectations when using this tool. In contemporary network configurations, AXFR requests are typically restricted, reflecting best practices in DNS security. While many nameservers now disallow AXFR requests, there may still be occasional instances where configurations permit them. Always exercise due diligence and ensure ethical use.
## Requirements
- [dnspython](https://pypi.org/project/dnspython/) *(`pip install dnspython`)*

2
mdaxfr
View File

@ -1,5 +1,5 @@
#!/bin/sh
# Mass DNS AXFR - developed by acidvegas in posix shell script (https://git.acid.vegas/mdaxfr)
# Mass DNS AXFR (POSIX version) - developed by acidvegas (https://git.acid.vegas/mdaxfr)
OUTPUT_DIR="axfrout"
mkdir -p "$OUTPUT_DIR"

View File

@ -61,9 +61,9 @@ def get_tld_nameservers(tld: str) -> list:
try:
return [str(nameserver) for nameserver in dns.resolver.resolve(tld+'.', 'NS', lifetime=60)]
except dns.exception.Timeout:
logging.warning(f"Timeout fetching nameservers for TLD: {tld}")
logging.warning(f'Timeout fetching nameservers for TLD: {tld}')
except dns.resolver.NoNameservers:
logging.warning(f"No nameservers found for TLD: {tld}")
logging.warning(f'No nameservers found for TLD: {tld}')
return []

View File

@ -2,15 +2,12 @@
# 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
@ -27,7 +24,6 @@ for tld in "${ptlds[@]}"; do
break
fi
done
if [ $success -eq 0 ]; then
echo "Zone transfer failed for $tld at all servers."
fi