diff --git a/mdaxfr.py b/mdaxfr.py
@@ -39,9 +39,10 @@ def attempt_axfr(tld: str, nameserver: str, filename: str):
os.rename(temp_file, filename)
break
except Exception as ex:
+ # Most zone transfers are blocked, so we don't want to log them
+ #logging.error(f'Failed to perform zone transfer from {nameserver} ({ns}) for {tld}: {ex}')
if os.path.exists(temp_file):
os.remove(temp_file)
- logging.error(f'Failed to perform zone transfer from {nameserver} ({ns}) for {tld}: {ex}')
def get_nameservers(target: str) -> list:
@@ -67,7 +68,7 @@ def get_root_tlds() -> list:
if rndroot:
tlds = sorted(set([item.split()[0][:-1] for item in open(rndroot).read().split('\n') if item and 'IN' in item and 'NS' in item]))
else:
- logging.warning('Failed to find root nameserver list, using IANA list')
+ logging.warning('Failed to find root nameserver list...fallback to using IANA list')
tlds = urllib.request.urlopen('https://data.iana.org/TLD/tlds-alpha-by-domain.txt').read().decode('utf-8').lower().split('\n')[1:]
random.shuffle(tlds)
return tlds
@@ -114,10 +115,12 @@ if __name__ == '__main__':
parser.add_argument('-t', '--timeout', type=int, default=15, help='DNS timeout (default: 15)')
args = parser.parse_args()
+ logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
+
os.makedirs(args.output, exist_ok=True)
dns.resolver._DEFAULT_TIMEOUT = args.timeout
- # Grab the root nameservers
+ logging.info('Fetching root nameservers...')
os.makedirs(os.path.join(args.output, 'root'), exist_ok=True)
with concurrent.futures.ThreadPoolExecutor(max_workers=args.concurrency) as executor:
futures = [executor.submit(attempt_axfr, '', root, os.path.join(args.output, f'root/{root}.txt')) for root in get_nameservers('')]
@@ -127,7 +130,7 @@ if __name__ == '__main__':
except Exception as e:
logging.error(f'Error in root server task: {e}')
- # Get the root TLDs
+ logging.info('Fetching root TLDs...')
with concurrent.futures.ThreadPoolExecutor(max_workers=args.concurrency) as executor:
futures = [executor.submit(attempt_axfr, tld, ns, os.path.join(args.output, tld + '.txt')) for tld in get_root_tlds() for ns in get_nameservers(tld) if ns]
for future in concurrent.futures.as_completed(futures):
@@ -136,7 +139,7 @@ if __name__ == '__main__':
except Exception as e:
logging.error(f'Error in TLD task: {e}')
- # Get the Public Suffix List
+ logging.info('Fetching PSL TLDs...')
os.makedirs(os.path.join(args.output, 'psl'), exist_ok=True)
with concurrent.futures.ThreadPoolExecutor(max_workers=args.concurrency) as executor:
futures = [executor.submit(attempt_axfr, tld, ns, os.path.join(args.output, f'psl/{tld}.txt')) for tld in get_psl_tlds() for ns in get_nameservers(tld) if ns]
diff --git a/ozones b/ozones
@@ -1,31 +1,29 @@
#!/bin/sh
# Mass DNS AXFR (other zones) - developed by acidvegas (https://git.acid.vegas/mdaxfr)
-```bash
curl -s https://www.internic.net/domain/root.zone | awk '$4=="NS" {gsub(/\.$/, "", $NF); print $NF}'
curl -s https://www.internic.net/domain/root.zone | awk '$4=="A" || $4=="AAAA" {print $5}'
-```
-```bash
# https://portal.switch.ch/pub/open-data/#tab-fccd70a3-b98e-11ed-9a74-5254009dc73c-3
dig @zonedata.switch.ch ch. AXFR -y hmac-sha512:tsig-zonedata-ch-public-21-01:stZwEGApYumtXkh73qMLPqfbIDozWKZLkqRvcjKSpRnsor6A6MxixRL6C2HeSVBQNfMW4wer+qjS0ZSfiWiJ3Q== > ch.txt
-
dig @zonedata.switch.ch li. AXFR -y hmac-sha512:tsig-zonedata-li-public-21-01:t8GgeCn+fhPaj+cRy1epox2Vj4hZ45ax6v3rQCkkfIQNg5fsxuU23QM5mzz+BxJ4kgF/jiQyBDBvL+XWPE6oCQ== > li.txt
dig @zonedata.iis.se se AXFR > se.txt
dig @zonedata.iis.se nu AXFR > nu.txt
+
dig @zone.internet.ee ee. AXFR > ee.txt
+
dig @ns1.gov.ps xn--ygbi2ammx. AXFR > xn--ygbi2ammx.txt
wget -O sk.txt https://sk-nic.sk/subory/domains.txt
wget -O gov.txt https://raw.githubusercontent.com/cisagov/dotgov-data/main/gov.txt
+
wget -O nc.txt https://www.domaine.nc/whos?who=A*
# https://www.afnic.fr/produits-services/services-associes/donnees-partagees/
-# not sure about this one....
-curl -s -H 'Accept: application/json' 'https://odata.domain.fi/OpenDomainData.svc/Domains?$inlinecount=allpages'
+curl -s -H 'Accept: application/json' 'https://odata.domain.fi/OpenDomainData.svc/Domains?$inlinecount=allpages' # not sure about this one....
-wget -O dn42.txt http://ix.ucis.nl/dn42/dnszone2.php?
+wget -O dn42.txt http://ix.ucis.nl/dn42/dnszone2.php? # Darknet
```
| |