Added support for public suffix list tlds

This commit is contained in:
Dionysus 2023-10-30 20:30:44 -04:00
parent 18f1fe96c1
commit c644424d9d
Signed by: acidvegas
GPG Key ID: EF4B922DB85DC9DE
19 changed files with 92 additions and 5 deletions

View File

@ -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

4
axfrout/aaa.txt Normal file
View File

@ -0,0 +1,4 @@
; <<>> DiG 9.16.22 <<>> AXFR aaa @37.209.192.9
;; global options: +cmd
; Transfer failed.

4
axfrout/aarp.txt Normal file
View File

@ -0,0 +1,4 @@
; <<>> DiG 9.16.22 <<>> AXFR aarp @192.42.176.30
;; global options: +cmd
; Transfer failed.

4
axfrout/abb.txt Normal file
View File

@ -0,0 +1,4 @@
; <<>> DiG 9.16.22 <<>> AXFR abb @65.22.113.41
;; global options: +cmd
; Transfer failed.

4
axfrout/abbott.txt Normal file
View File

@ -0,0 +1,4 @@
; <<>> DiG 9.16.22 <<>> AXFR abbott @65.22.158.41
;; global options: +cmd
; Transfer failed.

4
axfrout/abbvie.txt Normal file
View File

@ -0,0 +1,4 @@
; <<>> DiG 9.16.22 <<>> AXFR abbvie @103.49.83.41
;; global options: +cmd
; Transfer failed.

4
axfrout/abc.txt Normal file
View File

@ -0,0 +1,4 @@
; <<>> DiG 9.16.22 <<>> AXFR abc @192.42.175.30
;; global options: +cmd
; Transfer failed.

4
axfrout/able.txt Normal file
View File

@ -0,0 +1,4 @@
; <<>> DiG 9.16.22 <<>> AXFR able @156.154.144.3
;; global options: +cmd
; Transfer failed.

4
axfrout/abogado.txt Normal file
View File

@ -0,0 +1,4 @@
; <<>> DiG 9.16.22 <<>> AXFR abogado @156.154.174.82
;; global options: +cmd
; Transfer failed.

4
axfrout/abudhabi.txt Normal file
View File

@ -0,0 +1,4 @@
; <<>> DiG 9.16.22 <<>> AXFR abudhabi @37.209.192.10
;; global options: +cmd
; Transfer failed.

4
axfrout/ac.txt Normal file
View File

@ -0,0 +1,4 @@
; <<>> DiG 9.16.22 <<>> AXFR ac @65.22.161.1
;; global options: +cmd
; Transfer failed.

4
axfrout/academy.txt Normal file
View File

@ -0,0 +1,4 @@
; <<>> DiG 9.16.22 <<>> AXFR academy @161.232.12.37
;; global options: +cmd
; Transfer failed.

4
axfrout/accenture.txt Normal file
View File

@ -0,0 +1,4 @@
; <<>> DiG 9.16.22 <<>> AXFR accenture @192.42.173.30
;; global options: +cmd
; Transfer failed.

4
axfrout/accountant.txt Normal file
View File

@ -0,0 +1,4 @@
; <<>> DiG 9.16.22 <<>> AXFR accountant @156.154.159.195
;; global options: +cmd
; Transfer failed.

4
axfrout/accountants.txt Normal file
View File

@ -0,0 +1,4 @@
; <<>> DiG 9.16.22 <<>> AXFR accountants @65.22.32.31
;; global options: +cmd
; Transfer failed.

4
axfrout/aco.txt Normal file
View File

@ -0,0 +1,4 @@
; <<>> DiG 9.16.22 <<>> AXFR aco @194.0.24.12
;; global options: +cmd
; Transfer failed.

2
dgfjkdh Normal file
View File

@ -0,0 +1,2 @@
curl https://www.internic.net/domain/root.zone | awk '$4=="NS" {print $NF}'

7
mdaxfr
View File

@ -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

View File

@ -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.
@ -111,3 +126,11 @@ if __name__ == '__main__':
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}')