From 9b0e2625605281237e3e58af76d7657127507945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0tampar?= Date: Tue, 20 Oct 2026 10:07:33 +0200 Subject: [PATCH] Fix related to the #6149 --- lib/controller/controller.py | 15 +++++++++++---- lib/core/settings.py | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/controller/controller.py b/lib/controller/controller.py index 69bba347f..0b1cb2c0d 100644 --- a/lib/controller/controller.py +++ b/lib/controller/controller.py @@ -223,6 +223,9 @@ def _autoWafBypass(place, parameter, value): return retVal +def _targetInfo(): + return {"url": conf.url, "query": conf.parameters.get(PLACE.GET), "data": conf.parameters.get(PLACE.POST)} + def _showInjections(): if conf.wizard and kb.wizardMode: kb.wizardMode = False @@ -234,13 +237,12 @@ def _showInjections(): header = "sqlmap resumed the following injection point(s) from stored session" if conf.api: - conf.dumper.string("", {"url": conf.url, "query": conf.parameters.get(PLACE.GET), "data": conf.parameters.get(PLACE.POST)}, content_type=CONTENT_TYPE.TARGET) + conf.dumper.string("", _targetInfo(), content_type=CONTENT_TYPE.TARGET) conf.dumper.string("", kb.injections, content_type=CONTENT_TYPE.TECHNIQUES) else: - # --report-json: capture the same TARGET/TECHNIQUES structures the API emits, without - # printing them (the human-readable injection points are rendered just below) + # --report-json: capture the same TECHNIQUES structure the API emits, without printing it (the + # human-readable injection points are rendered just below); TARGET is reported per target in start() if conf.reportJson: - conf.dumper._reportData({"url": conf.url, "query": conf.parameters.get(PLACE.GET), "data": conf.parameters.get(PLACE.POST)}, CONTENT_TYPE.TARGET) conf.dumper._reportData(kb.injections, CONTENT_TYPE.TECHNIQUES) data = "".join(set(_formatInjection(_) for _ in kb.injections)).rstrip("\n") @@ -522,6 +524,11 @@ def start(): setupTargetEnv() + # --report-json: every tested target gets its own group with its identity, also when nothing is found + # (otherwise its errors, e.g. connection failures, would have no group to land in) + if conf.reportJson: + conf.dumper._reportData(_targetInfo(), CONTENT_TYPE.TARGET) + if not any((conf.graphql,)) and not checkConnection(suppressOutput=conf.forms): continue diff --git a/lib/core/settings.py b/lib/core/settings.py index 1928b873d..f9f08c19a 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -20,7 +20,7 @@ from lib.core.enums import OS from thirdparty import six # sqlmap version (...) -VERSION = "1.10.10.13" +VERSION = "1.10.10.14" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)