Created
February 22, 2024 20:59
-
-
Save joshfinley/257490524fec4dda9f2e6d4d2ff476d6 to your computer and use it in GitHub Desktop.
Take a list of domain names and try dnsenum against them all
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 subprocess | |
import sys | |
def run_dnsenum(wordlist, dns_server, domain_file): | |
with open(domain_file, 'r') as file: | |
domains = file.readlines() | |
for domain in domains: | |
domain = domain.strip() | |
command = [ | |
"dnsenum", | |
"--dnsserver", dns_server, | |
"--enum", | |
"-p", "0", | |
"-s", "0", | |
"-f", wordlist, | |
domain | |
] | |
print(f"Running dnsenum for domain: {domain}") | |
subprocess.run(command) | |
if __name__ == "__main__": | |
if len(sys.argv) != 4: | |
print("Usage: python script.py <wordlist> <dns server IP> <domain file>") | |
sys.exit(1) | |
wordlist = sys.argv[1] | |
dns_server_ip = sys.argv[2] | |
domain_file = sys.argv[3] | |
run_dnsenum(wordlist, dns_server_ip, domain_file) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment