Skip to content

Closes #68 - Add exceptions for missing PTR records #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'