1
1
from argparse import ArgumentParser
2
2
3
+
3
4
class cli_argument_parser (object ):
4
5
def __init__ (self ):
5
6
self ._parser = self .setup_parser ()
6
-
7
+
7
8
def parse (self , argv ):
8
9
return self ._parser .parse_args (argv )
9
10
@@ -18,12 +19,14 @@ def setup_parser():
18
19
19
20
parser .add_argument (
20
21
'-w' , dest = 'wordlists' ,
21
- help = 'Set the wordlists to use (default ./wordlists/virtual-host-scanning.txt)'
22
+ help = 'Set the wordlists to use (default '
23
+ './wordlists/virtual-host-scanning.txt)'
22
24
)
23
25
24
26
parser .add_argument (
25
27
'-b' , dest = 'base_host' , default = False ,
26
- help = 'Set host to be used during substitution in wordlist (default to TARGET).'
28
+ help = 'Set host to be used during substitution in '
29
+ 'wordlist (default to TARGET).'
27
30
)
28
31
29
32
parser .add_argument (
@@ -33,74 +36,92 @@ def setup_parser():
33
36
34
37
parser .add_argument (
35
38
'-r' , dest = 'real_port' , type = int , default = False ,
36
- help = '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).'
39
+ help = 'The real port of the webserver to use in headers when '
40
+ 'not 80 (see RFC2616 14.23), useful when pivoting through '
41
+ 'ssh/nc etc (default to PORT).'
37
42
)
38
43
39
44
parser .add_argument (
40
45
'--ignore-http-codes' , dest = 'ignore_http_codes' , default = '404' ,
41
- help = 'Comma separated list of http codes to ignore with virtual host scans (default 404).'
46
+ help = 'Comma separated list of http codes to ignore with virtual '
47
+ 'host scans (default 404).'
42
48
)
43
49
44
50
parser .add_argument (
45
- '--ignore-content-length' , dest = 'ignore_content_length' , type = int , default = 0 ,
46
- help = 'Ignore content lengths of specificed amount (default 0).'
51
+ '--ignore-content-length' , dest = 'ignore_content_length' , type = int ,
52
+ default = 0 , help = 'Ignore content lengths of specificed amount '
53
+ '(default 0).'
47
54
)
48
55
49
56
parser .add_argument (
50
- '--first-hit' , dest = 'first_hit' , action = 'store_true' , default = False ,
51
- help = 'Return first successful result. Only use in scenarios where you are sure no catch-all is configured (such as a CTF).'
57
+ '--first-hit' , dest = 'first_hit' , action = 'store_true' ,
58
+ default = False ,
59
+ help = 'Return first successful result. Only use in scenarios where '
60
+ 'you are sure no catch-all is configured (such as a CTF).'
52
61
)
53
62
54
63
parser .add_argument (
55
64
'--unique-depth' , dest = 'unique_depth' , type = int , default = 1 ,
56
- help = 'Show likely matches of page content that is found x times (default 1).'
65
+ help = 'Show likely matches of page content that is found x times '
66
+ '(default 1).'
57
67
)
58
68
59
69
parser .add_argument (
60
70
'--ssl' , dest = 'ssl' , action = 'store_true' , default = False ,
61
- help = 'If set then connections will be made over HTTPS instead of HTTP (default http).'
71
+ help = 'If set then connections will be made over HTTPS instead of '
72
+ 'HTTP (default http).'
62
73
)
63
74
64
75
parser .add_argument (
65
- '--fuzzy-logic' , dest = 'fuzzy_logic' , action = 'store_true' , default = False ,
66
- help = 'If set then fuzzy match will be performed against unique hosts (default off).'
76
+ '--fuzzy-logic' , dest = 'fuzzy_logic' , action = 'store_true' ,
77
+ default = False ,
78
+ help = 'If set then fuzzy match will be performed against unique '
79
+ 'hosts (default off).'
67
80
)
68
81
69
82
parser .add_argument (
70
- '--no-lookups' , dest = 'no_lookup' , action = 'store_true' , default = False ,
71
- help = 'Disable reverse lookups (identifies new targets and appends to wordlist, on by default).'
83
+ '--no-lookups' , dest = 'no_lookup' , action = 'store_true' ,
84
+ default = False ,
85
+ help = 'Disable reverse lookups (identifies new targets and appends '
86
+ 'to wordlist, on by default).'
72
87
)
73
88
74
89
parser .add_argument (
75
90
'--rate-limit' , dest = 'rate_limit' , type = int , default = 0 ,
76
- help = 'Amount of time in seconds to delay between each scan (default 0).'
91
+ help = 'Amount of time in seconds to delay between each scan '
92
+ '(default 0).'
77
93
)
78
94
79
95
parser .add_argument (
80
- '--waf' , dest = 'add_waf_bypass_headers' , action = 'store_true' , default = False ,
96
+ '--waf' , dest = 'add_waf_bypass_headers' , action = 'store_true' ,
97
+ default = False ,
81
98
help = 'If set then simple WAF bypass headers will be sent.'
82
99
)
83
100
84
101
parser .add_argument (
85
102
'-' , dest = 'stdin' , action = 'store_true' , default = False ,
86
- help = "By passing a blank '-' you tell VHostScan to expect input from stdin (pipe)."
103
+ help = "By passing a blank '-' you tell VHostScan to expect input "
104
+ "from stdin (pipe)."
87
105
)
88
106
89
107
output = parser .add_mutually_exclusive_group ()
90
108
output .add_argument (
91
109
'-oN' , dest = 'output_normal' ,
92
- help = 'Normal output printed to a file when the -oN option is specified with a filename argument.'
110
+ help = 'Normal output printed to a file when the -oN option is '
111
+ 'specified with a filename argument.'
93
112
)
94
113
95
114
output .add_argument (
96
115
'-oJ' , dest = 'output_json' ,
97
- help = 'JSON output printed to a file when the -oJ option is specified with a filename argument.'
116
+ help = 'JSON output printed to a file when the -oJ option is '
117
+ 'specified with a filename argument.'
98
118
)
99
119
100
120
user_agent = parser .add_mutually_exclusive_group ()
101
121
user_agent .add_argument (
102
- '--random-agent' , dest = 'random_agent' , action = 'store_true' , default = False ,
103
- help = 'If set, then each scan will use random user-agent from predefined list.'
122
+ '--random-agent' , dest = 'random_agent' , action = 'store_true' ,
123
+ default = False , help = 'If set, then each scan will use random '
124
+ 'user-agent from predefined list.'
104
125
)
105
126
106
127
user_agent .add_argument (
0 commit comments