Skip to content

Instantly share code, notes, and snippets.

@wavvs
Created August 7, 2020 13:56
Show Gist options
  • Save wavvs/552926f5811ddb617ba3c4fa3ff21dca to your computer and use it in GitHub Desktop.
Save wavvs/552926f5811ddb617ba3c4fa3ff21dca to your computer and use it in GitHub Desktop.
Get reliable resolvers for DNS recon and subdomain enumeration
import requests
import csv
PUBDNS_URL = 'https://public-dns.info/nameservers.csv'
def fetch_valid_resolvers():
r = requests.get(PUBDNS_URL)
d = csv.DictReader(r.content.decode().splitlines(),delimiter=',')
valid = [row['ip_address'] for row in d if row['reliability'] == '1.00' and ':' not in row['ip_address']]
for i in valid:
print(i)
if __name__ == '__main__':
# run dnsvalidator after
fetch_valid_resolvers()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment