cleanup from XML-RPC related stuff

This commit is contained in:
Bernardo Damele 2012-12-14 13:37:36 +00:00
parent 3d9779ffd4
commit a2a71bb37b
3 changed files with 1 additions and 27 deletions

View File

@ -41,12 +41,10 @@ from lib.core.option import init
from lib.core.profiling import profile from lib.core.profiling import profile
from lib.core.settings import LEGAL_DISCLAIMER from lib.core.settings import LEGAL_DISCLAIMER
from lib.core.settings import RESTAPI_SERVER_PORT 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 smokeTest
from lib.core.testing import liveTest from lib.core.testing import liveTest
from lib.parse.cmdline import cmdLineParser from lib.parse.cmdline import cmdLineParser
from lib.utils.restapi import restAPIrun from lib.utils.restapi import restAPIrun
from lib.utils.xmlrpc import XMLRPCServer
def modulePath(): def modulePath():
""" """
@ -68,19 +66,6 @@ def restApiServe():
sys.stdout = StringIO.StringIO() sys.stdout = StringIO.StringIO()
sys.stderr = 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(): def main():
""" """
Main function of sqlmap when running from command line. Main function of sqlmap when running from command line.
@ -99,8 +84,6 @@ def main():
if cmdLineOptions.restApi: if cmdLineOptions.restApi:
restApiServe() restApiServe()
elif cmdLineOptions.xmlRpc:
xmlRpcServe()
else: else:
init(cmdLineOptions) init(cmdLineOptions)

View File

@ -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) # 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 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 # Default TCP port used for REST API server instance
RESTAPI_SERVER_PORT = 8775 RESTAPI_SERVER_PORT = 8775

View File

@ -688,12 +688,6 @@ def cmdLineParser():
parser.add_option("--restapi-port", dest="restApiPort", type="int", parser.add_option("--restapi-port", dest="restApiPort", type="int",
help=SUPPRESS_HELP) 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(target)
parser.add_option_group(request) parser.add_option_group(request)
parser.add_option_group(optimization) 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, \ 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.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 = "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" errMsg += "use -h for basic or -hh for advanced help"
parser.error(errMsg) parser.error(errMsg)