@@ -104,9 +104,7 @@ def execute(self, statement, arguments=None):
104104
105105 def init (self ):
106106 self .execute ("CREATE TABLE logs(id INTEGER PRIMARY KEY AUTOINCREMENT, taskid INTEGER, time TEXT, level TEXT, message TEXT)" )
107-
108107 self .execute ("CREATE TABLE data(id INTEGER PRIMARY KEY AUTOINCREMENT, taskid INTEGER, status INTEGER, content_type INTEGER, value TEXT)" )
109-
110108 self .execute ("CREATE TABLE errors(id INTEGER PRIMARY KEY AUTOINCREMENT, taskid INTEGER, error TEXT)" )
111109
112110class Task (object ):
@@ -199,7 +197,6 @@ def engine_get_returncode(self):
199197 def engine_has_terminated (self ):
200198 return isinstance (self .engine_get_returncode (), int )
201199
202-
203200# Wrapper functions for sqlmap engine
204201class StdDbOut (object ):
205202 def __init__ (self , taskid , messagetype = "stdout" ):
@@ -573,7 +570,6 @@ def scan_data(taskid):
573570 logger .debug ("[%s] Retrieved scan data and error messages" % taskid )
574571 return jsonize ({"success" : True , "data" : json_data_message , "error" : json_errors_message })
575572
576-
577573# Functions to handle scans' logs
578574@get ("/scan/<taskid>/log/<start>/<end>" )
579575def scan_log_limited (taskid , start , end ):
@@ -601,7 +597,6 @@ def scan_log_limited(taskid, start, end):
601597 logger .debug ("[%s] Retrieved scan log messages subset" % taskid )
602598 return jsonize ({"success" : True , "log" : json_log_messages })
603599
604-
605600@get ("/scan/<taskid>/log" )
606601def scan_log (taskid ):
607602 """
@@ -621,7 +616,6 @@ def scan_log(taskid):
621616 logger .debug ("[%s] Retrieved scan log messages" % taskid )
622617 return jsonize ({"success" : True , "log" : json_log_messages })
623618
624-
625619# Function to handle files inside the output directory
626620@get ("/download/<taskid>/<target>/<filename:path>" )
627621def download (taskid , target , filename ):
@@ -648,7 +642,6 @@ def download(taskid, target, filename):
648642 logger .warning ("[%s] File does not exist %s" % (taskid , target ))
649643 return jsonize ({"success" : False , "message" : "File does not exist" })
650644
651-
652645def server (host = RESTAPI_DEFAULT_ADDRESS , port = RESTAPI_DEFAULT_PORT , adapter = RESTAPI_DEFAULT_ADAPTER , username = None , password = None ):
653646 """
654647 REST-JSON API server
0 commit comments