MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / scan_start

Function scan_start

lib/utils/api.py:499–525  ·  view source on GitHub ↗

Launch a scan

(taskid)

Source from the content-addressed store, hash-verified

497# Handle scans
498@post("/scan/<taskid>/start")
499def scan_start(taskid):
500 """
501 Launch a scan
502 """
503
504 if taskid not in DataStore.tasks:
505 logger.warning("[%s] Invalid task ID provided to scan_start()" % taskid)
506 return jsonize({"success": False, "message": "Invalid task ID"})
507
508 if request.json is None:
509 logger.warning("[%s] Invalid JSON options provided to scan_start()" % taskid)
510 return jsonize({"success": False, "message": "Invalid JSON options"})
511
512 for key in request.json:
513 if key in RESTAPI_UNSUPPORTED_OPTIONS:
514 logger.warning("[%s] Unsupported option '%s' provided to scan_start()" % (taskid, key))
515 return jsonize({"success": False, "message": "Unsupported option '%s'" % key})
516
517 # Initialize sqlmap engine's options with user's provided options, if any
518 for option, value in request.json.items():
519 DataStore.tasks[taskid].set_option(option, value)
520
521 # Launch sqlmap engine in a separate process
522 DataStore.tasks[taskid].engine_start()
523
524 logger.debug("(%s) Started scan" % taskid)
525 return jsonize({"success": True, "engineid": DataStore.tasks[taskid].engine_get_id()})
526
527@get("/scan/<taskid>/stop")
528def scan_stop(taskid):

Callers

nothing calls this directly

Calls 6

jsonizeFunction · 0.90
itemsMethod · 0.80
set_optionMethod · 0.80
engine_startMethod · 0.80
debugMethod · 0.80
engine_get_idMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…