From c644424d9d936c6da72414eea0c52a3b40b65484 Mon Sep 17 00:00:00 2001 From: acidvegas Date: Mon, 30 Oct 2023 20:30:44 -0400 Subject: [PATCH] Added support for public suffix list tlds --- README.md | 5 ----- axfrout/aaa.txt | 4 ++++ axfrout/aarp.txt | 4 ++++ axfrout/abb.txt | 4 ++++ axfrout/abbott.txt | 4 ++++ axfrout/abbvie.txt | 4 ++++ axfrout/abc.txt | 4 ++++ axfrout/able.txt | 4 ++++ axfrout/abogado.txt | 4 ++++ axfrout/abudhabi.txt | 4 ++++ axfrout/ac.txt | 4 ++++ axfrout/academy.txt | 4 ++++ axfrout/accenture.txt | 4 ++++ axfrout/accountant.txt | 4 ++++ axfrout/accountants.txt | 4 ++++ axfrout/aco.txt | 4 ++++ dgfjkdh | 2 ++ mdaxfr | 7 +++++++ mdaxfr.py | 23 +++++++++++++++++++++++ 19 files changed, 92 insertions(+), 5 deletions(-) create mode 100644 axfrout/aaa.txt create mode 100644 axfrout/aarp.txt create mode 100644 axfrout/abb.txt create mode 100644 axfrout/abbott.txt create mode 100644 axfrout/abbvie.txt create mode 100644 axfrout/abc.txt create mode 100644 axfrout/able.txt create mode 100644 axfrout/abogado.txt create mode 100644 axfrout/abudhabi.txt create mode 100644 axfrout/ac.txt create mode 100644 axfrout/academy.txt create mode 100644 axfrout/accenture.txt create mode 100644 axfrout/accountant.txt create mode 100644 axfrout/accountants.txt create mode 100644 axfrout/aco.txt create mode 100644 dgfjkdh diff --git a/README.md b/README.md index 1b435c3..5f06f7a 100644 --- 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 new file mode 100644 index 0000000..4606e0b --- /dev/null +++ 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 new file mode 100644 index 0000000..cea8641 --- /dev/null +++ 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 new file mode 100644 index 0000000..51ac044 --- /dev/null +++ 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 new file mode 100644 index 0000000..d32a6e3 --- /dev/null +++ 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 new file mode 100644 index 0000000..3b69db1 --- /dev/null +++ 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 new file mode 100644 index 0000000..115122e --- /dev/null +++ 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 new file mode 100644 index 0000000..1756049 --- /dev/null +++ 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 new file mode 100644 index 0000000..01a5d13 --- /dev/null +++ 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 new file mode 100644 index 0000000..6d6029e --- /dev/null +++ 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 new file mode 100644 index 0000000..ca53b1e --- /dev/null +++ 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 new file mode 100644 index 0000000..e0a6fdc --- /dev/null +++ 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 new file mode 100644 index 0000000..789d096 --- /dev/null +++ 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 new file mode 100644 index 0000000..f1dccb5 --- /dev/null +++ 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 new file mode 100644 index 0000000..9dbd10a --- /dev/null +++ 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 new file mode 100644 index 0000000..d6df9ad --- /dev/null +++ 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 new file mode 100644 index 0000000..d65592d --- /dev/null +++ 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 index bfc496e..baed882 100755 --- 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 index 8df5cdd..fa39152 100644 --- 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. @@ -106,6 +121,14 @@ if __name__ == '__main__': 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_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}') + + 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()