From a35fc713a2493a3a5af31591f5872456d21715be Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 5 Nov 2020 11:20:51 +0100 Subject: [PATCH] Minor patch (AS keyword does not play well in nullCastConcatFields) --- lib/core/agent.py | 10 ++++++++++ lib/core/settings.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/core/agent.py b/lib/core/agent.py index fe40f2501..7fd836512 100644 --- a/lib/core/agent.py +++ b/lib/core/agent.py @@ -471,6 +471,12 @@ class Agent(object): @rtype: C{str} """ + match = re.search(r"(?i)(.+)( AS \w+)\Z", field) + if match: + field, suffix = match.groups() + else: + suffix = "" + nulledCastedField = field if field and Backend.getIdentifiedDbms(): @@ -490,6 +496,9 @@ class Agent(object): if conf.hexConvert or kb.binaryField: nulledCastedField = self.hexConvertField(nulledCastedField) + if suffix: + nulledCastedField += suffix + return nulledCastedField def nullCastConcatFields(self, fields): @@ -533,6 +542,7 @@ class Agent(object): nulledCastedFields = [] for field in fieldsSplitted: + field = re.sub(r"(?i) AS \w+\Z", "", field) # NOTE: fields such as "... AS type_name" have to be stripped from the alias part for this functionality to work nulledCastedFields.append(self.nullAndCastField(field)) delimiterStr = "%s'%s'%s" % (dbmsDelimiter, kb.chars.delimiter, dbmsDelimiter) diff --git a/lib/core/settings.py b/lib/core/settings.py index 5f42e94b3..49da60b42 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -18,7 +18,7 @@ from lib.core.enums import OS from thirdparty.six import unichr as _unichr # sqlmap version (...) -VERSION = "1.4.11.2" +VERSION = "1.4.11.3" 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)