-
Notifications
You must be signed in to change notification settings - Fork 7
/
shellhunter.py
66 lines (51 loc) · 3.25 KB
/
shellhunter.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# !/usr/bin/python3
import argparse
from os import _exit
from src.scanner import scanner
__version__ = "1.1.0"
class ShellFinder():
def __init__(self, version: str) -> None:
"""
Parse user info to Scanner
:param version:
"""
self.parser = argparse.ArgumentParser()
self.group = self.parser.add_mutually_exclusive_group(required=True)
self.group.add_argument('--url', '-u', action='store', dest='URL', help='URL to scan', default=False)
self.group.add_argument('--file', '-f', action='store', dest='File', help='Phishings URL file', default=False)
self.parser.add_argument('--proxy', '-p', action='store', dest='proxy',
help='proxy country to use ( look user_files/config.txt)', default=False)
self.parser.add_argument('--shell-list', '-sf', action='store', dest='shellfile',
help='Shell File, default: src/shell_list.lst', default="src/shell_list.lst")
self.parser.add_argument('--save', '-s', action='store', dest='Save', help='Save to...', default=False)
self.parser.add_argument('--threads', '-t', action='store', dest='threads', help='Threads to run, default 20',
type=int, default=20)
self.parser.add_argument('--hide-code', '-hc', action='store', dest='hidecode',
help='Do not show responses w/ this code', nargs="+", type=int, default=[])
self.parser.add_argument('--show-code', '-sc', action='store', dest='showonly',
help='Do not show responses w/o this code', nargs="+", type=int, default=[200, 302])
self.parser.add_argument('--show-string', '-ss', action='store', dest='string',
help='show responses w/ this string', default=False)
self.parser.add_argument('--hide-string', '-hs', action='store', dest='notstring',
help='Do not show responses w/o this string', default=False)
self.parser.add_argument('--show-regex', '-sr', action='store', dest='regex',
help='Do not show responses w this regex', default=False)
self.parser.add_argument('--hide-regex', '-hr', action='store', dest='notregex',
help='Do not show responses w/o this regex', default=False)
self.parser.add_argument('--greater-than', '-gt', action='store', dest='showChars',
help='show responses with a number of characters greater than X', type=int,
default=False)
self.parser.add_argument('--smaller-than', '-st', action='store', dest='hideChars',
help='Do not show responses with a number of characters greater than X', type=int,
default=False)
scanner(version,
self.parser.parse_args()).start() # scanner create Target object, which store all session options
if __name__ == "__main__":
try:
main = ShellFinder(__version__)
except KeyboardInterrupt:
print()
print("bye")
_exit(1)
except Exception as e:
print("\033[91m\nunexpected Exception:\033[0m " + str(e))