Created
March 19, 2023 20:52
-
-
Save felipecaon/d99c7cf2c75c62c4d6f5b6fbea1f51fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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