Skip to content

Commit bf35484

Browse files
authored
Merge pull request #74 from codingo/codingo-stdin-improvements
Remove need for '-' flag to force stdin
2 parents 36684c7 + 3b2dcdc commit bf35484

File tree

5 files changed

+6
-15
lines changed

5 files changed

+6
-15
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ $ pip install -r requirements.txt
5151
| -oN OUTPUT_NORMAL | Normal output printed to a file when the -oN option is specified with a filename argument. |
5252
| -oG OUTPUT_GREPABLE | Grepable output printed to a file when the -oG is specified with a filename argument. |
5353
| -oJ OUTPUT_JSON | JSON output printed to a file when the -oJ option is specified with a filename argument. |
54-
| - | By passing a blank '-' you tell VHostScan to expect input from stdin (pipe). |
5554

5655

5756
## Usage Examples
@@ -85,7 +84,7 @@ $ cat bank.htb | VHostScan.py -t 10.10.10.29 -
8584
### STDIN and WordList
8685
You can still specify a wordlist to use along with stdin. In these cases wordlist information will be appended to stdin. For example:
8786
```bash
88-
$ echo -e 'a.example.com\b.example.com' | VhostScan.py -t localhost -w ./wordlists/wordlist.txt -
87+
$ echo -e 'a.example.com\b.example.com' | VHostScan.py -t localhost -w ./wordlists/wordlist.txt
8988
```
9089
### Fuzzy Logic
9190
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.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ def main():
3434
wordlist = []
3535
word_list_types = []
3636

37-
default_wordlist = DEFAULT_WORDLIST_FILE if not arguments.stdin else None
37+
default_wordlist = DEFAULT_WORDLIST_FILE \
38+
if sys.stdin.isatty() else None
3839

39-
if arguments.stdin:
40+
if not sys.stdin.isatty():
4041
word_list_types.append('stdin')
4142
wordlist.extend(list(line for line in sys.stdin.read().splitlines()))
4243

lib/core/__version__.py

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

5-
__version__ = '1.7'
5+
__version__ = '1.7.1'

lib/input.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,6 @@ def setup_parser():
9898
help='If set then simple WAF bypass headers will be sent.'
9999
)
100100

101-
parser.add_argument(
102-
'-', dest='stdin', action='store_true', default=False,
103-
help="By passing a blank '-' you tell VHostScan to expect input "
104-
"from stdin (pipe)."
105-
)
106-
107101
output = parser.add_mutually_exclusive_group()
108102
output.add_argument(
109103
'-oN', dest='output_normal',

tests/test_input.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def test_parse_arguments_default_value(tmpdir):
2020
'real_port': False,
2121
'ignore_http_codes': '404',
2222
'ignore_content_length': 0,
23-
'first_hit': False ,
23+
'first_hit': False,
2424
'unique_depth': 1,
2525
'fuzzy_logic': False,
2626
'no_lookup': False,
@@ -31,7 +31,6 @@ def test_parse_arguments_default_value(tmpdir):
3131
'output_normal': None,
3232
'output_json': None,
3333
'output_grepable' : None,
34-
'stdin': False,
3534
'ssl': False,
3635
}
3736

@@ -60,7 +59,6 @@ def test_parse_arguments_custom_arguments(tmpdir):
6059
'--user-agent', 'some-user-agent',
6160
'--waf',
6261
'-oN', '/tmp/on',
63-
'-',
6462
]
6563

6664
arguments = cli_argument_parser().parse(argv)
@@ -85,7 +83,6 @@ def test_parse_arguments_custom_arguments(tmpdir):
8583
'output_normal': '/tmp/on',
8684
'output_json': None,
8785
'output_grepable' : None,
88-
'stdin': True,
8986
}
9087

9188
assert vars(arguments) == expected_arguments

0 commit comments

Comments
 (0)