mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-07-12 03:23:27 +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:
parent
f52d81c834
commit
27906f388f
2 changed files with 82 additions and 16 deletions
|
|
@ -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():
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue