diff --git a/VHostScan.py b/VHostScan.py index e36702a..de9cdce 100644 --- a/VHostScan.py +++ b/VHostScan.py @@ -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 * @@ -86,11 +86,17 @@ def main(): print("[>] First hit is set.") if not arguments.no_lookup: - for ip in Resolver().query(arguments.target_hosts, 'A'): - host, aliases, ips = gethostbyaddr(str(ip)) - wordlist.append(str(ip)) - wordlist.append(host) - wordlist.extend(aliases) + try: + print("[+] Resolving DNS for additional wordlist entries") + 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 (dns.resolver.NXDOMAIN): + print("[!] Couldn't find any records (NXDOMAIN)") + except (dns.resolver.NoAnswer): + print("[!] Couldn't find any records (NoAnswer)") scanner_args = vars(arguments) scanner_args.update({ diff --git a/lib/core/__version__.py b/lib/core/__version__.py index 27ab71c..38339fd 100644 --- a/lib/core/__version__.py +++ b/lib/core/__version__.py @@ -2,4 +2,4 @@ # |V|H|o|s|t|S|c|a|n| Developed by @codingo_ & @__timk # +-+-+-+-+-+-+-+-+-+ https://github.com/codingo/VHostScan -__version__ = '1.6.2' +__version__ = '1.6.3'