#!/usr/bin/env python"""Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/)See the file 'doc/COPYING' for copying permission"""import loggingimport optparsefrom sqlmap import modulePathfrom lib.core.common import setPathsfrom lib.core.data import pathsfrom lib.core.data import loggerfrom lib.utils.api import clientfrom lib.utils.api import serverRESTAPI_SERVER_HOST = "127.0.0.1"RESTAPI_SERVER_PORT = 8775if __name__ == "__main__":"""REST-JSON API main function"""# Set default logging level to debuglogger.setLevel(logging.DEBUG)# Initialize path variablepaths.SQLMAP_ROOT_PATH = modulePath()setPaths()# Parse command line optionsapiparser = optparse.OptionParser()apiparser.add_option("-s", "--server", help="Act as a REST-JSON API server", default=RESTAPI_SERVER_PORT, action="store_true")apiparser.add_option("-c", "--client", help="Act as a REST-JSON API client", default=RESTAPI_SERVER_PORT, action="store_true")apiparser.add_option("-H", "--host", help="Host of the REST-JSON API server", default=RESTAPI_SERVER_HOST, action="store")apiparser.add_option("-p", "--port", help="Port of the the REST-JSON API server", default=RESTAPI_SERVER_PORT, type="int", action="store")(args, _) = apiparser.parse_args()# Start the client or the serverif args.server is True:server(args.host, args.port)elif args.client is True:client(args.host, args.port)else:apiparser.print_help()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。