mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-11-24 02:56:12 -10:00
Fix for leftover ASC/DESC when stripping ORDER BY in UNION technique
This commit is contained in:
1 parent
b6c4f880a5
commit
e85b1bbd9d
2 files changed
+2
-2
No files matched your search
@@ -19,7 +19,7 @@ from lib.core.enums import OS
|
||||
from thirdparty import six
|
||||
|
||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||
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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user