From 17a4ddad635c1871d26703590bc14be559555163 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 30 May 2016 13:10:25 +0200 Subject: [PATCH] Fixes #1916 --- lib/core/agent.py | 7 ++++--- lib/core/settings.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/core/agent.py b/lib/core/agent.py index 5119d58c6..5abebea05 100644 --- a/lib/core/agent.py +++ b/lib/core/agent.py @@ -996,12 +996,13 @@ class Agent(object): def forgeQueryOutputLength(self, expression): lengthQuery = queries[Backend.getIdentifiedDbms()].length.query - select = re.search("\ASELECT\s+", expression, re.I) - selectTopExpr = re.search("\ASELECT\s+TOP\s+[\d]+\s+(.+?)\s+FROM", expression, re.I) + select = re.search(r"\ASELECT\s+", expression, re.I) + selectTopExpr = re.search(r"\ASELECT\s+TOP\s+[\d]+\s+(.+?)\s+FROM", expression, re.I) + selectMinMaxExpr = re.search(r"\ASELECT\s+(MIN|MAX)\(.+?\)\s+FROM", expression, re.I) _, _, _, _, _, _, fieldsStr, _ = self.getFields(expression) - if selectTopExpr: + if selectTopExpr or selectMinMaxExpr: lengthExpr = lengthQuery % ("(%s)" % expression) elif select: lengthExpr = expression.replace(fieldsStr, lengthQuery % fieldsStr, 1) diff --git a/lib/core/settings.py b/lib/core/settings.py index 35a98eaff..05c5b1d20 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -19,7 +19,7 @@ from lib.core.enums import OS from lib.core.revision import getRevisionNumber # sqlmap version (...) -VERSION = "1.0.5.103" +VERSION = "1.0.5.104" REVISION = getRevisionNumber() STABLE = VERSION.count('.') <= 2 VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev")