This repository was archived by the owner on Apr 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathsusanoo.py
82 lines (60 loc) · 2.97 KB
/
susanoo.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# @ant4g0nist
import os
import sys
import gzip
import time
import argparse
from app.helpers.utils import TerminalColors
from app.controllers import api as APIController
from app.controllers import smoke as SmokeController
def banner():
ban ="""
,--. ,----.. ,----..
.--.--. .--.--. ,---, ,--.'| / / \ / / \
/ / '. ,--, / / '. ' .' \ ,--,: : | / . : / . :
| : /`. / ,'_ /|| : /`. / / ; '. ,`--.'`| ' : . / ;. \ . / ;. \
; | |--` .--. | | :; | |--` : : \ | : : | |. ; / ` ;. ; / ` ;
| : ;_ ,'_ /| : . || : ;_ : | /\ \ : | \ | :; | ; \ ; |; | ; \ ; |
\ \ `. | ' | | . . \ \ `. | : ' ;. : | : ' '; || : | ; | '| : | ; | '
`----. \| | ' | | | `----. \| | ;/ \ \' ' ;. ;. | ' ' ' :. | ' ' ' :
__ \ \ |: | | : ' ; __ \ \ |' : | \ \ ,'| | | \ |' ; \; / |' ; \; / |
/ /`--' /| ; ' | | ' / /`--' /| | ' '--' ' : | ; .' \ \ ', / \ \ ', /
'--'. / : | : ; ; |'--'. / | : : | | '`--' ; : / ; : /
`--'---' ' : `--' \ `--'---' | | ,' ' : | \ \ .' \ \ .'
: , .-./ `--'' ; |.' `---` `---`
`--`----' '---'
"""
print ban
if __name__ == '__main__':
banner()
parser = argparse.ArgumentParser()
parser.add_argument("-c","--config", help="run api security scan on given config file", required=True)
parser.add_argument("-s","--smoke", help="run smoke scan on the given config file?True/False", action='store_true', default=False)
args = parser.parse_args()
tty_colors = TerminalColors(True)
if not os.path.exists(args.config):
print tty_colors.red()+'Make sure config file exists'+tty_colors.default()
sys.exit(0)
if args.smoke:
smokeSusanoo = SmokeController.SusanooConfig(args.config)
apis = smokeSusanoo.get_apis()
for api in apis:
print tty_colors.cyan()+"testing %s"%(api)+tty_colors.default()
scan = SmokeController.Scans(apis[api], smokeSusanoo)
scan.run()
print tty_colors.cyan()+"*"*100+tty_colors.default()
if not args.smoke:
susanoo = APIController.SusanooConfig(args.config)
apis = susanoo.get_apis()
for api in apis:
name = api
scan = APIController.Scans(apis[api], susanoo)
print tty_colors.cyan()+"*"*100+tty_colors.default()
scan.authentication_check()
scan.authorization_check()
scan.sqlinjection_heuristic_check()
if apis[api].raw_url:
scan.url_param_fuzz()
scan.fuzz()
# scan.ratelimit_check()
print tty_colors.cyan()+"*"*100+tty_colors.default()