Skip to content

Commit

Permalink
Merge pull request #69 from codingo/codingo-dns-resolution-hotfix
Browse files Browse the repository at this point in the history
Closes #68 - Add exceptions for missing PTR records
  • Loading branch information
timkent authored Oct 10, 2017
2 parents 0f8b7ed + ead2e6e commit 7697201
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
18 changes: 12 additions & 6 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 @@ -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({
Expand Down
2 changes: 1 addition & 1 deletion lib/core/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'

0 comments on commit 7697201

Please sign in to comment.