mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-01-06 06:39:02 +00:00
added initial support (hidden from -hh and not yet usable) for REST-JSON API
This commit is contained in:
@@ -485,6 +485,9 @@ LIMITED_ROWS_TEST_NUMBER = 15
|
||||
# Default TCP port used for XML-RPC server instance
|
||||
XMLRPC_SERVER_PORT = 8776
|
||||
|
||||
# Default TCP port used for REST API server instance
|
||||
RESTAPI_SERVER_PORT = 8775
|
||||
|
||||
# Regular expression for SOAP-like POST data
|
||||
SOAP_RECOGNITION_REGEX = r"(?s)\A(<\?xml[^>]+>)?\s*<([^> ]+)( [^>]+)?>.+</\2.*>\s*\Z"
|
||||
|
||||
|
||||
@@ -682,6 +682,12 @@ def cmdLineParser():
|
||||
parser.add_option("--run-case", dest="runCase", type="int",
|
||||
help=SUPPRESS_HELP)
|
||||
|
||||
parser.add_option("--restapi", dest="restApi", action="store_true",
|
||||
help=SUPPRESS_HELP)
|
||||
|
||||
parser.add_option("--restApi-port", dest="restApiPort", type="int",
|
||||
help=SUPPRESS_HELP)
|
||||
|
||||
parser.add_option("--xmlrpc", dest="xmlRpc", action="store_true",
|
||||
help=SUPPRESS_HELP)
|
||||
|
||||
@@ -761,7 +767,7 @@ def cmdLineParser():
|
||||
|
||||
if not any((args.direct, args.url, args.logFile, args.bulkFile, args.googleDork, args.configFile, \
|
||||
args.requestFile, args.updateAll, args.smokeTest, args.liveTest, args.wizard, args.dependencies, \
|
||||
args.xmlRpc, args.purgeOutput)):
|
||||
args.restApi, args.xmlRpc, args.purgeOutput)):
|
||||
errMsg = "missing a mandatory option (-d, -u, -l, -m, -r, -g, -c, --wizard, --update, --purge-output or --dependencies), "
|
||||
errMsg += "use -h for basic or -hh for advanced help"
|
||||
parser.error(errMsg)
|
||||
|
||||
@@ -66,6 +66,7 @@ class XMLRPCServer:
|
||||
return retval
|
||||
|
||||
def run(self):
|
||||
print "CALLING RUN"
|
||||
if not self.is_busy():
|
||||
init(self.options, True)
|
||||
thread = threading.Thread(target=start)
|
||||
|
||||
Reference in New Issue
Block a user