Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a2a71bb

Browse files
committed
cleanup from XML-RPC related stuff
1 parent 3d9779f commit a2a71bb

3 files changed

Lines changed: 1 addition & 27 deletions

File tree

_sqlmap.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,10 @@
4141
from lib.core.profiling import profile
4242
from lib.core.settings import LEGAL_DISCLAIMER
4343
from lib.core.settings import RESTAPI_SERVER_PORT
44-
from lib.core.settings import XMLRPC_SERVER_PORT
4544
from lib.core.testing import smokeTest
4645
from lib.core.testing import liveTest
4746
from lib.parse.cmdline import cmdLineParser
4847
from lib.utils.restapi import restAPIrun
49-
from lib.utils.xmlrpc import XMLRPCServer
5048

5149
def modulePath():
5250
"""
@@ -68,19 +66,6 @@ def emit(self, record):
6866
sys.stdout = StringIO.StringIO()
6967
sys.stderr = StringIO.StringIO()
7068

71-
def xmlRpcServe():
72-
logger.setLevel(logging.INFO)
73-
cmdLineOptions.batch = True
74-
cmdLineOptions.disableColoring = True
75-
server = XMLRPCServer(cmdLineOptions.xmlRpcPort or XMLRPC_SERVER_PORT)
76-
def emit(self, record):
77-
message = stdoutencode(FORMATTER.format(record))
78-
sys.stdout.write("%s\n" % message.strip('\r'))
79-
LOGGER_HANDLER.emit = types.MethodType(emit, LOGGER_HANDLER, type(LOGGER_HANDLER))
80-
sys.stdout = StringIO.StringIO()
81-
sys.stderr = StringIO.StringIO()
82-
server.serve()
83-
8469
def main():
8570
"""
8671
Main function of sqlmap when running from command line.
@@ -99,8 +84,6 @@ def main():
9984

10085
if cmdLineOptions.restApi:
10186
restApiServe()
102-
elif cmdLineOptions.xmlRpc:
103-
xmlRpcServe()
10487
else:
10588
init(cmdLineOptions)
10689

lib/core/settings.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,6 @@
482482
# Number of rows to generate inside the full union test for limited output (mustn't be too large to prevent payload length problems)
483483
LIMITED_ROWS_TEST_NUMBER = 15
484484

485-
# Default TCP port used for XML-RPC server instance
486-
XMLRPC_SERVER_PORT = 8776
487-
488485
# Default TCP port used for REST API server instance
489486
RESTAPI_SERVER_PORT = 8775
490487

lib/parse/cmdline.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -688,12 +688,6 @@ def cmdLineParser():
688688
parser.add_option("--restapi-port", dest="restApiPort", type="int",
689689
help=SUPPRESS_HELP)
690690

691-
parser.add_option("--xmlrpc", dest="xmlRpc", action="store_true",
692-
help=SUPPRESS_HELP)
693-
694-
parser.add_option("--xmlrpc-port", dest="xmlRpcPort", type="int",
695-
help=SUPPRESS_HELP)
696-
697691
parser.add_option_group(target)
698692
parser.add_option_group(request)
699693
parser.add_option_group(optimization)
@@ -767,7 +761,7 @@ def _(self, *args):
767761

768762
if not any((args.direct, args.url, args.logFile, args.bulkFile, args.googleDork, args.configFile, \
769763
args.requestFile, args.updateAll, args.smokeTest, args.liveTest, args.wizard, args.dependencies, \
770-
args.restApi, args.xmlRpc, args.purgeOutput)):
764+
args.restApi, args.purgeOutput)):
771765
errMsg = "missing a mandatory option (-d, -u, -l, -m, -r, -g, -c, --wizard, --update, --purge-output or --dependencies), "
772766
errMsg += "use -h for basic or -hh for advanced help"
773767
parser.error(errMsg)

0 commit comments

Comments
 (0)