Skip to content

Commit dbf3b90

Browse files
authored
Merge pull request #45 from xuvez/master
Closes #43 - Added reverse lookup support for new targets
2 parents 255e44a + d9b2a3d commit dbf3b90

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ A virtual host scanner that can be used with pivot tools, detect catch-all scena
1212
* Work over HTTP and HTTPS
1313
* Ability to set the real port of the webserver to use in headers when pivoting through ssh/nc
1414
* Add simple response headers to bypass some WAF products
15+
* Identify new targets by using reverse lookups and append to wordlist
1516

1617
## Product Comparisons
1718

@@ -40,6 +41,7 @@ $ pip install -r requirements.txt
4041
| --unique-depth UNIQUE_DEPTH | Show likely matches of page content that is found x times (default 1). |
4142
| --ssl | If set then connections will be made over HTTPS instead of HTTP. |
4243
| --fuzzy-logic | If set then all unique content replies are compared and a similarity ratio is given for each pair. This helps to isolate vhosts in situations where a default page isn't static (such as having the time on it). |
44+
| --no-lookups | Disbale reverse lookups (identifies new targets and append to wordlist, on by default). |
4345
| --rate-limit | Amount of time in seconds to delay between each scan (default 0). |
4446
| --waf | If set then simple WAF bypass headers will be sent. |
4547
| -oN OUTPUT_NORMAL | Normal output printed to a file when the -oN option is specified with a filename argument. |

VHostScan.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import os
44
import sys
55
from argparse import ArgumentParser
6+
from dns.resolver import Resolver
7+
from socket import gethostbyaddr
68
from lib.core.virtual_host_scanner import *
79
from lib.helpers.output_helper import *
810
from lib.core.__version__ import __version__
@@ -28,11 +30,12 @@ def main():
2830
parser.add_argument('--unique-depth', dest='unique_depth', type=int, help='Show likely matches of page content that is found x times (default 1).', default=1)
2931
parser.add_argument("--ssl", dest="ssl", action="store_true", help="If set then connections will be made over HTTPS instead of HTTP (default http).", default=False)
3032
parser.add_argument("--fuzzy-logic", dest="fuzzy_logic", action="store_true", help="If set then fuzzy match will be performed against unique hosts (default off).", default=False)
33+
parser.add_argument("--no-lookups", dest="no_lookup", action="store_true", help="Disable reverse lookups (identifies new targets and appends to wordlist, on by default).", default=False)
3134
parser.add_argument("--rate-limit", dest="rate_limit", type=int, help='Amount of time in seconds to delay between each scan (default 0).', default=0)
3235
parser.add_argument("--waf", dest="add_waf_bypass_headers", action="store_true", help="If set then simple WAF bypass headers will be sent.", default=False)
3336
parser.add_argument("-oN", dest="output_normal", help="Normal output printed to a file when the -oN option is specified with a filename argument." )
3437
parser.add_argument("-", dest="stdin", action="store_true", help="By passing a blank '-' you tell VHostScan to expect input from stdin (pipe).", default=False)
35-
38+
3639
arguments = parser.parse_args()
3740
wordlist = list()
3841

@@ -78,6 +81,13 @@ def main():
7881
if(arguments.ignore_content_length > 0):
7982
print("[>] Ignoring Content length: %s" % (arguments.ignore_content_length))
8083

84+
if not arguments.no_lookup:
85+
for ip in Resolver().query(arguments.target_hosts, 'A'):
86+
host, aliases, ips = gethostbyaddr(str(ip))
87+
wordlist.append(str(ip))
88+
wordlist.append(host)
89+
wordlist.extend(aliases)
90+
8191
scanner_args = vars(arguments)
8292
scanner_args.update({'target': arguments.target_hosts, 'wordlist': wordlist})
8393
scanner = virtual_host_scanner(**scanner_args)

lib/core/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# |V|H|o|s|t|S|c|a|n| Developed by @codingo_ & @__timk
33
# +-+-+-+-+-+-+-+-+-+ https://github.com/codingo/VHostScan
44

5-
__version__ = '1.1'
5+
__version__ = '1.2'
66

0 commit comments

Comments
 (0)