mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 12:41:30 +00:00
added first methods to interact with sqlmap core, it is now possible to launch a scan from the API, hurray! (issue #297)
This commit is contained in:
@@ -45,6 +45,7 @@ from lib.core.testing import smokeTest
|
||||
from lib.core.testing import liveTest
|
||||
from lib.parse.cmdline import cmdLineParser
|
||||
from lib.utils.restapi import restAPIrun
|
||||
from lib.utils.restapi import restAPIsetup
|
||||
|
||||
def modulePath():
|
||||
"""
|
||||
@@ -58,13 +59,14 @@ def restApiServe():
|
||||
logger.setLevel(logging.INFO)
|
||||
cmdLineOptions.batch = True
|
||||
cmdLineOptions.disableColoring = True
|
||||
restAPIrun(port=cmdLineOptions.restApiPort or RESTAPI_SERVER_PORT)
|
||||
restAPIsetup(port=cmdLineOptions.restApiPort or RESTAPI_SERVER_PORT)
|
||||
def emit(self, record):
|
||||
message = stdoutencode(FORMATTER.format(record))
|
||||
sys.stdout.write("%s\n" % message.strip('\r'))
|
||||
LOGGER_HANDLER.emit = types.MethodType(emit, LOGGER_HANDLER, type(LOGGER_HANDLER))
|
||||
sys.stdout = StringIO.StringIO()
|
||||
sys.stderr = StringIO.StringIO()
|
||||
#sys.stderr = StringIO.StringIO()
|
||||
restAPIrun(port=cmdLineOptions.restApiPort or RESTAPI_SERVER_PORT)
|
||||
|
||||
def main():
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user