mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 12:41:30 +00:00
Implements #3834
This commit is contained in:
@@ -4868,6 +4868,8 @@ def zeroDepthSearch(expression, value):
|
||||
|
||||
>>> _ = "SELECT (SELECT id FROM users WHERE 2>1) AS result FROM DUAL"; _[zeroDepthSearch(_, "FROM")[0]:]
|
||||
'FROM DUAL'
|
||||
>>> _ = "a(b; c),d;e"; _[zeroDepthSearch(_, "[;, ]")[0]:]
|
||||
',d;e'
|
||||
"""
|
||||
|
||||
retVal = []
|
||||
@@ -4878,8 +4880,13 @@ def zeroDepthSearch(expression, value):
|
||||
depth += 1
|
||||
elif expression[index] == ')':
|
||||
depth -= 1
|
||||
elif depth == 0 and expression[index:index + len(value)] == value:
|
||||
retVal.append(index)
|
||||
elif depth == 0:
|
||||
found = False
|
||||
if value.startswith('[') and value.endswith(']'):
|
||||
if re.search(value, expression[index:index + 1]):
|
||||
retVal.append(index)
|
||||
elif expression[index:index + len(value)] == value:
|
||||
retVal.append(index)
|
||||
|
||||
return retVal
|
||||
|
||||
|
||||
Reference in New Issue
Block a user