Skip to content

Commit c8dc375

Browse files
committed
Update for sqlmapproject#4537
1 parent a697e6c commit c8dc375

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty.six import unichr as _unichr
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.5.1.22"
21+
VERSION = "1.5.1.23"
2222
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2323
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2424
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

lib/utils/api.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
from lib.core.settings import RESTAPI_DEFAULT_ADAPTER
5050
from lib.core.settings import RESTAPI_DEFAULT_ADDRESS
5151
from lib.core.settings import RESTAPI_DEFAULT_PORT
52+
from lib.core.settings import RESTAPI_UNSUPPORTED_OPTIONS
5253
from lib.core.settings import VERSION_STRING
5354
from lib.core.shell import autoCompletion
5455
from lib.core.subprocessng import Popen
@@ -502,6 +503,11 @@ def scan_start(taskid):
502503
logger.warning("[%s] Invalid JSON options provided to scan_start()" % taskid)
503504
return jsonize({"success": False, "message": "Invalid JSON options"})
504505

506+
for key in request.json:
507+
if key in RESTAPI_UNSUPPORTED_OPTIONS:
508+
logger.warning("[%s] Unsupported option '%s' provided to scan_start()" % (taskid, key))
509+
return jsonize({"success": False, "message": "Unsupported option '%s'" % key})
510+
505511
# Initialize sqlmap engine's options with user's provided options, if any
506512
for option, value in request.json.items():
507513
DataStore.tasks[taskid].set_option(option, value)
@@ -836,15 +842,15 @@ def client(host=RESTAPI_DEFAULT_ADDRESS, port=RESTAPI_DEFAULT_PORT, username=Non
836842
raw = _client("%s/task/new" % addr)
837843
res = dejsonize(raw)
838844
if not res["success"]:
839-
logger.error("Failed to create new task")
845+
logger.error("Failed to create new task ('%s')" % res.get("message", ""))
840846
continue
841847
taskid = res["taskid"]
842848
logger.info("New task ID is '%s'" % taskid)
843849

844850
raw = _client("%s/scan/%s/start" % (addr, taskid), cmdLineOptions)
845851
res = dejsonize(raw)
846852
if not res["success"]:
847-
logger.error("Failed to start scan")
853+
logger.error("Failed to start scan ('%s')" % res.get("message", ""))
848854
continue
849855
logger.info("Scanning started")
850856

0 commit comments

Comments
 (0)