• Stars
    star
    1,196
  • Rank 39,117 (Top 0.8 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created about 7 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A virtual host scanner that performs reverse lookups, can be used with pivot tools, detect catch-all scenarios, work around wildcards, aliases and dynamic default pages.

VHostScan

A virtual host scanner that can be used with pivot tools, detect catch-all scenarios, aliases and dynamic default pages. First presented at SecTalks BNE in September 2017 (slidedeck).

Build Status Python 3.2|3.6 PEP8 License Twitter Twitter

Key Benefits

  • Quickly highlight unique content in catch-all scenarios
  • Locate the outliers in catch-all scenarios where results have dynamic content on the page (such as the time)
  • Identify aliases by tweaking the unique depth of matches
  • Wordlist supports standard words and a variable to input a base hostname (for e.g. dev.%s from the wordlist would be run as dev.BASE_HOST)
  • Works over HTTP and HTTPS
  • Ability to set the real port of the webserver to use in headers when pivoting through ssh/nc
  • Add simple response headers to bypass some WAF products
  • Identify new targets by using reverse lookups and append to wordlist

Product Comparisons

VHOSTScan Feature Map

Install Requirements

Install using:

$ python3 setup.py install

Dependencies will then be installed and VHostScan will be added to your path. If there is an issue regarding running python3 setup.py build_ext, you will need to reinstall numpy using pip uninstall numpy and pip install numpy==1.12.0. This should resolve the issue as there are sometimes issues with numpy being installed through setup.py.

Usage

Argument Description
-h, --help Display help message and exit
-t TARGET_HOSTS Set the target host.
-b BASE_HOST Set host to be used during substitution in wordlist (default to TARGET).
-w WORDLISTS Set the wordlist(s) to use. You may specify multiple wordlists in comma delimited format (e.g. -w "./wordlists/simple.txt, ./wordlists/hackthebox.txt" (default ./wordlists/virtual-host-scanning.txt).
-p PORT Set the port to use (default 80).
-r REAL_PORT The real port of the webserver to use in headers when not 80 (see RFC2616 14.23), useful when pivoting through ssh/nc etc (default to PORT).
--ignore-http-codes IGNORE_HTTP_CODES Comma separated list of http codes to ignore with virtual host scans (default 404).
--ignore-content-length IGNORE_CONTENT_LENGTH Ignore content lengths of specificed amount.
--prefix PREFIX Add a prefix to each item in the wordlist, to add dev-<word>, test-<word> etc
--suffix SUFFIX Add a suffix to each item in the wordlist, to add <word>dev, <word>dev
--first-hit Return first successful result. Only use in scenarios where you are sure no catch-all is configured (such as a CTF).
--unique-depth UNIQUE_DEPTH Show likely matches of page content that is found x times (default 1).
--ssl If set then connections will be made over HTTPS instead of HTTP.
--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).
--no-lookups Disbale reverse lookups (identifies new targets and append to wordlist, on by default).
--rate-limit Amount of time in seconds to delay between each scan (default 0).
--random-agent If set, each scan will use a random user-agent from a predefined list.
--user-agent Specify a user agent to use for scans.
--waf If set then simple WAF bypass headers will be sent.
-oN OUTPUT_NORMAL Normal output printed to a file when the -oN option is specified with a filename argument.
-oG OUTPUT_GREPABLE Grepable output printed to a file when the -oG is specified with a filename argument.
-oJ OUTPUT_JSON JSON output printed to a file when the -oJ option is specified with a filename argument.
-v VERBOSE Increase the output of the tool to show progress

Usage Examples

Note that a number of these examples reference 10.10.10.29. This IP refers to BANK.HTB, a retired target machine from HackTheBox (https://www.hackthebox.eu/).

Quick Example

The most straightforward example runs the default wordlist against example.com using the default of port 80:

$ VHostScan -t example.com

Quick Example with SSL

If your connection requires SSL, you can use:

$ VHostScan -t example.com --ssl

VHOSTScan Wordlist example

Port forwarding

Say you have an SSH port forward listening on port 4444 fowarding traffic to port 80 on example.com's development machine. You could use the following to make VHostScan connect through your SSH tunnel via localhost:4444 but format the header requests to suit connecting straight to port 80:

$ VHostScan -t localhost -b example.com -p 4444 -r 80

STDIN

VHostScan Supports piping from other applications and will treat information passed to VHostScan as wordlist data, for example:

$ cat bank.htb | VHostScan -t 10.10.10.29

VHOSTScan STDIN Example

STDIN and WordList

You can still specify a wordlist to use along with stdin. In these cases wordlist information will be appended to stdin. For example:

$ echo -e 'a.example.com\b.example.com' | VHostScan -t localhost -w ./wordlists/wordlist.txt

Fuzzy Logic

Here is an example with fuzzy logic enabled. You can see the last comparison is much more similar than the first two (it is comparing the content not the actual hashes):

VHOSTScan Fuzzy Logic Example

Running the tests

This project includes a small battery of tests. It's really simple to run the tests:

pip install -r test-requirements.txt
pytest

Or you can optionally run:

pip install -r test-requirements.txt
python3 setup.py test

If you're thinking of adding a new feature to the project, consider also contributing with a couple of tests. A well-tested codebase is a sane codebase. :)

More Repositories

1

NoSQLMap

Automated NoSQL database enumeration and web application exploitation tool.
Python
2,856
star
2

Reconnoitre

A security tool for multithreaded information gathering and service enumeration whilst building directory structures to store results, along with writing out recommendations for further testing.
Python
2,033
star
3

Interlace

Easily turn single threaded command line applications into a fast, multi-threaded application with CIDR and glob support.
Python
1,204
star
4

DNSCewl

A DNS Bruteforcing Wordlist Generator
C++
347
star
5

BibWord

Microsoft Word and Bibliography Styles extender.
XSLT
280
star
6

dorky

A tool to quickly do keyword searches over Gitlab and Github for OSINT & bug bounty recon
Go
226
star
7

bbr

An open source tool to aid in command line driven generation of bug bounty reports based on user provided templates.
Go
206
star
8

crithit

Takes a single wordlist item and tests it one by one over a large collection of websites before moving onto the next. Create signatures to cross-check vulnerabilities over multiple hosts.
Makefile
205
star
9

Minesweeper

A Burpsuite plugin (BApp) to aid in the detection of scripts being loaded from over 23000 malicious cryptocurrency mining domains (cryptojacking).
Python
196
star
10

Retrieve-Windows-Wifi-Passwords

Retreives the SSID names and passwords in cleartext for each Wifi network stored on the computer running this powershell script and output to JSON.
PowerShell
79
star
11

microsubs

A collection of code for interacting with API sources directly to improve your understanding of those services.
C++
65
star
12

dooked

DNS and Target HTTP History Local Storage and Search
C++
63
star
13

Ransomware-Json-Dataset

Compiles a json dataset using public sources that contains properties to aid in the detection and mitigation of over 1000 variants of ransomware.
Python
61
star
14

fastsub

A custom built DNS bruteforcer with multi-threading, and handling of bad resolvers.
C++
57
star
15

SharePoint-Security

A Github Repository Created to compliment a BSides Canberra 2018 talk on SharePoint Security.
PowerShell
46
star
16

simple

A collection of one off hacks and simple scripts
Go
27
star
17

cracknet

A .net Crackme Challenge made for the SecTalks Brisbane 2017 Capture the Flag Event. Writeup/solution included.
C#
20
star
18

Bugcrowd-Talks

Slide Decks and Supporting Content of talks given for Bugcrowd
16
star
19

guides

A companion repo to accompany detailed guides and YouTube content to allow users to follow along
12
star
20

succinct

A tool to create a text summary of a provided list of websites
Go
9
star
21

codingo

5
star
22

DNSCewl-go

A DNS Bruteforcing Wordlist Generator
5
star
23

RaiderOfTheLostBrowsers

Command line utility to extract passwords from the major browsers (Chrome, Firefox, Edge). Useful in demonstrating to users the importance of using proper password managers instead of saving credentials in browser based accounts which synchronize settings locally.
Python
5
star
24

security-through-obscurity

A reversing challenge made for CrikeyCon 2018
C#
4
star
25

blog

Repository housing codingo-com hugo project
HTML
4
star
26

Google-Phonelib-SQL-CLR

A SQL CLR implementation of GooglePhoneLib allowing it to be used as a Microsoft SQL Function.
C#
4
star
27

CTFs

Code and writeups for a variety of CTF challenges. Links to writeups included where available.
Python
3
star
28

coffee

A repository for snippets of code that make my life easier.
Shell
3
star
29

Simple-Substitution

A CTF challenge for CrikeyCon 2018
Python
2
star
30

2ndOrder

Chrome extension to inspect and find domains that don't resolve or have expired
JavaScript
2
star
31

blog-live

2
star
32

codingo.github.io

Ruby
2
star
33

pyreal

Python scraper for realestate
Python
2
star
34

test2

1
star
35

dooks-air-conditioning

A CTF web challenge built for CrikeyCon 2018
PHP
1
star
36

Hash-Checker

A Powershell script to check a hash against a file script
PowerShell
1
star