Skip to content

Remove need for '-' flag to force stdin #74

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 8 commits into from
Oct 13, 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
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ $ pip install -r requirements.txt
| -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. |
| - | By passing a blank '-' you tell VHostScan to expect input from stdin (pipe). |


## Usage Examples
Expand Down Expand Up @@ -85,7 +84,7 @@ $ cat bank.htb | VHostScan.py -t 10.10.10.29 -
### 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:
```bash
$ echo -e 'a.example.com\b.example.com' | VhostScan.py -t localhost -w ./wordlists/wordlist.txt -
$ echo -e 'a.example.com\b.example.com' | VHostScan.py -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):
Expand Down
5 changes: 3 additions & 2 deletions VHostScan.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ def main():
wordlist = []
word_list_types = []

default_wordlist = DEFAULT_WORDLIST_FILE if not arguments.stdin else None
default_wordlist = DEFAULT_WORDLIST_FILE \
if sys.stdin.isatty() else None

if arguments.stdin:
if not sys.stdin.isatty():
word_list_types.append('stdin')
wordlist.extend(list(line for line in sys.stdin.read().splitlines()))

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.7'
__version__ = '1.7.1'
6 changes: 0 additions & 6 deletions lib/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,6 @@ def setup_parser():
help='If set then simple WAF bypass headers will be sent.'
)

parser.add_argument(
'-', dest='stdin', action='store_true', default=False,
help="By passing a blank '-' you tell VHostScan to expect input "
"from stdin (pipe)."
)

output = parser.add_mutually_exclusive_group()
output.add_argument(
'-oN', dest='output_normal',
Expand Down
5 changes: 1 addition & 4 deletions tests/test_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test_parse_arguments_default_value(tmpdir):
'real_port': False,
'ignore_http_codes': '404',
'ignore_content_length': 0,
'first_hit': False ,
'first_hit': False,
'unique_depth': 1,
'fuzzy_logic': False,
'no_lookup': False,
Expand All @@ -31,7 +31,6 @@ def test_parse_arguments_default_value(tmpdir):
'output_normal': None,
'output_json': None,
'output_grepable' : None,
'stdin': False,
'ssl': False,
}

Expand Down Expand Up @@ -60,7 +59,6 @@ def test_parse_arguments_custom_arguments(tmpdir):
'--user-agent', 'some-user-agent',
'--waf',
'-oN', '/tmp/on',
'-',
]

arguments = cli_argument_parser().parse(argv)
Expand All @@ -85,7 +83,6 @@ def test_parse_arguments_custom_arguments(tmpdir):
'output_normal': '/tmp/on',
'output_json': None,
'output_grepable' : None,
'stdin': True,
}

assert vars(arguments) == expected_arguments
Expand Down