mdaxfr

- Mass DNS AXFR
git clone git://git.acid.vegas/mdaxfr.git
Log | Files | Refs | Archive | README | LICENSE

commit c644424d9d936c6da72414eea0c52a3b40b65484
parent 18f1fe96c111a9e172f517ef4dcb2ac544f26545
Author: acidvegas <acid.vegas@acid.vegas>
Date: Mon, 30 Oct 2023 20:30:44 -0400

Added support for public suffix list tlds

Diffstat:
MREADME.md | 5-----
Aaxfrout/aaa.txt | 4++++
Aaxfrout/aarp.txt | 4++++
Aaxfrout/abb.txt | 4++++
Aaxfrout/abbott.txt | 4++++
Aaxfrout/abbvie.txt | 4++++
Aaxfrout/abc.txt | 4++++
Aaxfrout/able.txt | 4++++
Aaxfrout/abogado.txt | 4++++
Aaxfrout/abudhabi.txt | 4++++
Aaxfrout/ac.txt | 4++++
Aaxfrout/academy.txt | 4++++
Aaxfrout/accenture.txt | 4++++
Aaxfrout/accountant.txt | 4++++
Aaxfrout/accountants.txt | 4++++
Aaxfrout/aco.txt | 4++++
Adgfjkdh | 2++
Mmdaxfr | 7+++++++
Mmdaxfr.py | 23+++++++++++++++++++++++

19 files changed, 92 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md
@@ -20,11 +20,6 @@ I only wrote this to shit on **[this bozo](https://github.com/flotwig/TLDR-2/tre
 
 This repostiory also contains a [pure POSIX version](./mdaxfr) for portability, aswell as a [script](./opennic) to do zone transfers on [OpenNIC TLDs](https://wiki.opennic.org/opennic/dot).
 
-## Todo
-- Add [Public Suffix List](https://publicsuffix.org/list/) support
-- Loop mode to run 24/7 for monitoring new TLD's
-- NSEC3 Walking features
-
 ___
 
 ###### Mirrors
diff --git a/axfrout/aaa.txt b/axfrout/aaa.txt
@@ -0,0 +1,4 @@
+
+; <<>> DiG 9.16.22 <<>> AXFR aaa @37.209.192.9
+;; global options: +cmd
+; Transfer failed.
diff --git a/axfrout/aarp.txt b/axfrout/aarp.txt
@@ -0,0 +1,4 @@
+
+; <<>> DiG 9.16.22 <<>> AXFR aarp @192.42.176.30
+;; global options: +cmd
+; Transfer failed.
diff --git a/axfrout/abb.txt b/axfrout/abb.txt
@@ -0,0 +1,4 @@
+
+; <<>> DiG 9.16.22 <<>> AXFR abb @65.22.113.41
+;; global options: +cmd
+; Transfer failed.
diff --git a/axfrout/abbott.txt b/axfrout/abbott.txt
@@ -0,0 +1,4 @@
+
+; <<>> DiG 9.16.22 <<>> AXFR abbott @65.22.158.41
+;; global options: +cmd
+; Transfer failed.
diff --git a/axfrout/abbvie.txt b/axfrout/abbvie.txt
@@ -0,0 +1,4 @@
+
+; <<>> DiG 9.16.22 <<>> AXFR abbvie @103.49.83.41
+;; global options: +cmd
+; Transfer failed.
diff --git a/axfrout/abc.txt b/axfrout/abc.txt
@@ -0,0 +1,4 @@
+
+; <<>> DiG 9.16.22 <<>> AXFR abc @192.42.175.30
+;; global options: +cmd
+; Transfer failed.
diff --git a/axfrout/able.txt b/axfrout/able.txt
@@ -0,0 +1,4 @@
+
+; <<>> DiG 9.16.22 <<>> AXFR able @156.154.144.3
+;; global options: +cmd
+; Transfer failed.
diff --git a/axfrout/abogado.txt b/axfrout/abogado.txt
@@ -0,0 +1,4 @@
+
+; <<>> DiG 9.16.22 <<>> AXFR abogado @156.154.174.82
+;; global options: +cmd
+; Transfer failed.
diff --git a/axfrout/abudhabi.txt b/axfrout/abudhabi.txt
@@ -0,0 +1,4 @@
+
+; <<>> DiG 9.16.22 <<>> AXFR abudhabi @37.209.192.10
+;; global options: +cmd
+; Transfer failed.
diff --git a/axfrout/ac.txt b/axfrout/ac.txt
@@ -0,0 +1,4 @@
+
+; <<>> DiG 9.16.22 <<>> AXFR ac @65.22.161.1
+;; global options: +cmd
+; Transfer failed.
diff --git a/axfrout/academy.txt b/axfrout/academy.txt
@@ -0,0 +1,4 @@
+
+; <<>> DiG 9.16.22 <<>> AXFR academy @161.232.12.37
+;; global options: +cmd
+; Transfer failed.
diff --git a/axfrout/accenture.txt b/axfrout/accenture.txt
@@ -0,0 +1,4 @@
+
+; <<>> DiG 9.16.22 <<>> AXFR accenture @192.42.173.30
+;; global options: +cmd
+; Transfer failed.
diff --git a/axfrout/accountant.txt b/axfrout/accountant.txt
@@ -0,0 +1,4 @@
+
+; <<>> DiG 9.16.22 <<>> AXFR accountant @156.154.159.195
+;; global options: +cmd
+; Transfer failed.
diff --git a/axfrout/accountants.txt b/axfrout/accountants.txt
@@ -0,0 +1,4 @@
+
+; <<>> DiG 9.16.22 <<>> AXFR accountants @65.22.32.31
+;; global options: +cmd
+; Transfer failed.
diff --git a/axfrout/aco.txt b/axfrout/aco.txt
@@ -0,0 +1,4 @@
+
+; <<>> DiG 9.16.22 <<>> AXFR aco @194.0.24.12
+;; global options: +cmd
+; Transfer failed.
diff --git a/dgfjkdh b/dgfjkdh
@@ -0,0 +1,2 @@
+curl https://www.internic.net/domain/root.zone | awk '$4=="NS" {print $NF}'
+
diff --git a/mdaxfr b/mdaxfr
@@ -40,3 +40,10 @@ for tld in $(curl -s 'https://data.iana.org/TLD/tlds-alpha-by-domain.txt' | tail
 		attempt_axfr "$tld" "$ns" "$OUTPUT_DIR/$tld.txt"
 	done
 done
+
+# For Public Suffix List TLD nameservers
+for tld in $(curl -s https://publicsuffix.org/list/public_suffix_list.dat | grep -vE '^(//|.*[*!])' | grep '\.' | awk '{print $1}'); do
+	for ns in $(dig +short "$tld" NS); do
+		attempt_axfr "$tld" "$ns" "$OUTPUT_DIR/$tld.txt"
+	done
+done
diff --git a/mdaxfr.py b/mdaxfr.py
@@ -67,6 +67,21 @@ def get_tld_nameservers(tld: str) -> list:
     return []
 
 
+def get_psl_tlds() -> list:
+    '''Download the Public Suffix List and return its contents.'''
+    data = urllib.request.urlopen('https://publicsuffix.org/list/public_suffix_list.dat').read().decode()
+    domains = []
+    for line in data.split('\n'):
+        if line.startswith('//') or not line:
+            continue
+        if '*' in line or '!' in line:
+            continue
+        if '.' not in line:
+            continue
+        domains.append(line)
+    return domains
+
+
 def resolve_nameserver(nameserver: str) -> str:
     '''
     Resolve a nameserver to its IP address.
@@ -110,4 +125,12 @@ if __name__ == '__main__':
             try:
                 future.result()
             except Exception as e:
+                logging.error(f'Error in TLD task: {e}')
+
+    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_psl_tlds() for ns in get_tld_nameservers(tld) if ns]
+        for future in concurrent.futures.as_completed(futures):
+            try:
+                future.result()
+            except Exception as e:
                 logging.error(f'Error in TLD task: {e}')
 \ No newline at end of file