-
Notifications
You must be signed in to change notification settings - Fork 1
/
ApiScript.py
39 lines (28 loc) · 1.02 KB
/
ApiScript.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
from IronWASP import *
def start_log_range(req, res):
GlobalStore.Put("log_start_py_api", Config.LastProxyLogId + 1)
res.BodyString = "OK"
ApiCallHandler.AddHandler("/py/log_range_start", start_log_range)
def end_log_range(req, res):
GlobalStore.Put("log_end_py_api", Config.LastProxyLogId)
res.BodyString = "OK"
ApiCallHandler.AddHandler("/py/log_range_end", end_log_range)
def scan_log_range(req, res):
start_id = GlobalStore.Get("log_start_py_api")
end_id = GlobalStore.Get("log_end_py_api")
for i in range(start_id, end_id + 1):
r = Request.FromProxyLog(i)
s = Scanner(r)
if r.Query.Count > 0 or r.Body.Count > 0:
s.InjectQuery()
s.InjectBody()
s.CheckAll()
s.LaunchScan()
res.BodyString = "OK"
ApiCallHandler.AddHandler("/py/scan_log_range", scan_log_range)
def connection_check(req, res):
res.BodyString = "OK"
ApiCallHandler.AddHandler("connection_check", connection_check)
def passpharse_check(req, res):
res.BodyString = "OK"
ApiCallHandler.AddHandler("passpharse_check", connection_check)