Skip to content

Commit

Permalink
Corrected bad import of DNS for exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
codingo committed Oct 10, 2017
1 parent 2b15f1d commit ead2e6e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions VHostScan.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import os
import sys
import dns.resolver
from argparse import ArgumentParser
from dns.resolver import Resolver
from socket import gethostbyaddr
from lib.core.virtual_host_scanner import *
from lib.helpers.output_helper import *
Expand Down Expand Up @@ -88,14 +88,14 @@ def main():
if not arguments.no_lookup:
try:
print("[+] Resolving DNS for additional wordlist entries")
for ip in Resolver().query(arguments.target_hosts, 'A'):
for ip in dns.resolver.query(arguments.target_hosts, 'A'):
host, aliases, ips = gethostbyaddr(str(ip))
wordlist.append(str(ip))
wordlist.append(host)
wordlist.extend(aliases)
except (NXDOMAIN):
except (dns.resolver.NXDOMAIN):
print("[!] Couldn't find any records (NXDOMAIN)")
except (NoAnswer):
except (dns.resolver.NoAnswer):
print("[!] Couldn't find any records (NoAnswer)")

scanner_args = vars(arguments)
Expand Down

0 comments on commit ead2e6e

Please sign in to comment.