mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-01-24 00:04:23 +03:00
cleanup from XML-RPC related stuff
This commit is contained in:
parent
3d9779ffd4
commit
a2a71bb37b
17
_sqlmap.py
17
_sqlmap.py
|
@ -41,12 +41,10 @@ from lib.core.option import init
|
|||
from lib.core.profiling import profile
|
||||
from lib.core.settings import LEGAL_DISCLAIMER
|
||||
from lib.core.settings import RESTAPI_SERVER_PORT
|
||||
from lib.core.settings import XMLRPC_SERVER_PORT
|
||||
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.xmlrpc import XMLRPCServer
|
||||
|
||||
def modulePath():
|
||||
"""
|
||||
|
@ -68,19 +66,6 @@ def restApiServe():
|
|||
sys.stdout = StringIO.StringIO()
|
||||
sys.stderr = StringIO.StringIO()
|
||||
|
||||
def xmlRpcServe():
|
||||
logger.setLevel(logging.INFO)
|
||||
cmdLineOptions.batch = True
|
||||
cmdLineOptions.disableColoring = True
|
||||
server = XMLRPCServer(cmdLineOptions.xmlRpcPort or XMLRPC_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()
|
||||
server.serve()
|
||||
|
||||
def main():
|
||||
"""
|
||||
Main function of sqlmap when running from command line.
|
||||
|
@ -99,8 +84,6 @@ def main():
|
|||
|
||||
if cmdLineOptions.restApi:
|
||||
restApiServe()
|
||||
elif cmdLineOptions.xmlRpc:
|
||||
xmlRpcServe()
|
||||
else:
|
||||
init(cmdLineOptions)
|
||||
|
||||
|
|
|
@ -482,9 +482,6 @@ EVENTVALIDATION_REGEX = r'(?i)(?P<name>__EVENTVALIDATION[^"]*)[^>]+value="(?P<re
|
|||
# Number of rows to generate inside the full union test for limited output (mustn't be too large to prevent payload length problems)
|
||||
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
|
||||
|
||||
|
|
|
@ -688,12 +688,6 @@ def cmdLineParser():
|
|||
parser.add_option("--restapi-port", dest="restApiPort", type="int",
|
||||
help=SUPPRESS_HELP)
|
||||
|
||||
parser.add_option("--xmlrpc", dest="xmlRpc", action="store_true",
|
||||
help=SUPPRESS_HELP)
|
||||
|
||||
parser.add_option("--xmlrpc-port", dest="xmlRpcPort", type="int",
|
||||
help=SUPPRESS_HELP)
|
||||
|
||||
parser.add_option_group(target)
|
||||
parser.add_option_group(request)
|
||||
parser.add_option_group(optimization)
|
||||
|
@ -767,7 +761,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.restApi, args.xmlRpc, args.purgeOutput)):
|
||||
args.restApi, 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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user