Skip to content

Instantly share code, notes, and snippets.

@felipecaon
Created March 19, 2023 20:52
Show Gist options
  • Save felipecaon/d99c7cf2c75c62c4d6f5b6fbea1f51fd to your computer and use it in GitHub Desktop.
Save felipecaon/d99c7cf2c75c62c4d6f5b6fbea1f51fd to your computer and use it in GitHub Desktop.
import socket
import dns.resolver
with open('domainlist.txt') as f:
domain_list = [line.strip() for line in f.readlines()]
for domain in domain_list:
resolver = dns.resolver.Resolver()
nameservers = resolver.query(domain, 'NS')
for ns in nameservers:
resolver.nameservers=[socket.gethostbyname(str(ns))]
try:
q = resolver.query(domain, 'A')
except dns.resolver.NoNameservers as NN:
print(f'{domain}: VULNERÁVEL - {str(ns)}')
except dns.resolver.NoAnswer as NA:
print(f'{domain}: não vulnerável')
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment