diff --git a/lib/core/settings.py b/lib/core/settings.py index 2971b972c..eb0d4e4d5 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -19,7 +19,7 @@ from lib.core.enums import OS from thirdparty import six # sqlmap version (...) -VERSION = "1.10.11.23" +VERSION = "1.10.11.24" 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) diff --git a/lib/techniques/union/use.py b/lib/techniques/union/use.py index 252a50841..bbdbe681d 100644 --- a/lib/techniques/union/use.py +++ b/lib/techniques/union/use.py @@ -348,7 +348,7 @@ def unionUse(expression, unpack=True, dump=False): # Only remove outer ordering. Nested ORDER BY clauses can select which # rows survive a ROWNUM/TOP limit and must remain intact. positions = set(index for keyword in set(re.findall(r"(?i)ORDER BY", expression)) for index in zeroDepthSearch(expression, keyword)) - expression = re.sub(r"(?i)ORDER BY\s+[\w,]+", lambda match: "" if match.start() in positions else match.group(0), expression) + expression = re.sub(r"(?i)ORDER BY\s+[\w.]+(?:\s+(?:ASC|DESC)\b)?(?:\s*,\s*[\w.]+(?:\s+(?:ASC|DESC)\b)?)*", lambda match: "" if match.start() in positions else match.group(0), expression) debugMsg = "stripping ORDER BY clause from statement because " debugMsg += "it does not play well with UNION query SQL injection" singleTimeDebugMessage(debugMsg)