Skip to content

Commit f58319a

Browse files
author
Diogo Osório
committed
Make the lib/input.py file adhere to the PEP8 convention
1 parent cc518ba commit f58319a

File tree

1 file changed

+43
-22
lines changed

1 file changed

+43
-22
lines changed

lib/input.py

Lines changed: 43 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
from argparse import ArgumentParser
22

3+
34
class cli_argument_parser(object):
45
def __init__(self):
56
self._parser = self.setup_parser()
6-
7+
78
def parse(self, argv):
89
return self._parser.parse_args(argv)
910

@@ -18,12 +19,14 @@ def setup_parser():
1819

1920
parser.add_argument(
2021
'-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)'
2224
)
2325

2426
parser.add_argument(
2527
'-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).'
2730
)
2831

2932
parser.add_argument(
@@ -33,74 +36,92 @@ def setup_parser():
3336

3437
parser.add_argument(
3538
'-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).'
3742
)
3843

3944
parser.add_argument(
4045
'--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).'
4248
)
4349

4450
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).'
4754
)
4855

4956
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).'
5261
)
5362

5463
parser.add_argument(
5564
'--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).'
5767
)
5868

5969
parser.add_argument(
6070
'--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).'
6273
)
6374

6475
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).'
6780
)
6881

6982
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).'
7287
)
7388

7489
parser.add_argument(
7590
'--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).'
7793
)
7894

7995
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,
8198
help='If set then simple WAF bypass headers will be sent.'
8299
)
83100

84101
parser.add_argument(
85102
'-', 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)."
87105
)
88106

89107
output = parser.add_mutually_exclusive_group()
90108
output.add_argument(
91109
'-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.'
93112
)
94113

95114
output.add_argument(
96115
'-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.'
98118
)
99119

100120
user_agent = parser.add_mutually_exclusive_group()
101121
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.'
104125
)
105126

106127
user_agent.add_argument(

0 commit comments

Comments
 (0)