mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 12:41:30 +00:00
important update regarding (Bug #209) - probably more will be needed
This commit is contained in:
@@ -7,18 +7,13 @@ Copyright (c) 2006-2010 sqlmap developers (http://sqlmap.sourceforge.net/)
|
||||
See the file 'doc/COPYING' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.convert import urldecode
|
||||
from lib.core.convert import urlencode
|
||||
|
||||
def tamper(place, value):
|
||||
def tamper(value):
|
||||
"""
|
||||
Replaces 'IFNULL(A, B)' with 'IF(ISNULL(A), B, A)'
|
||||
Example: 'IFNULL(1, 2)' becomes 'IF(ISNULL(1), 2, 1)'
|
||||
"""
|
||||
|
||||
if value and value.find("IFNULL") > -1:
|
||||
if place != "URI":
|
||||
value = urldecode(value)
|
||||
|
||||
while value.find("IFNULL(") > -1:
|
||||
index = value.find("IFNULL(")
|
||||
@@ -28,11 +23,14 @@ def tamper(place, value):
|
||||
for i in xrange(index + len("IFNULL("), len(value)):
|
||||
if deepness == 1 and value[i] == ',':
|
||||
comma = i
|
||||
|
||||
elif deepness == 1 and value[i] == ')':
|
||||
end = i
|
||||
break
|
||||
|
||||
elif value[i] == '(':
|
||||
deepness += 1
|
||||
|
||||
elif value[i] == ')':
|
||||
deepness -= 1
|
||||
|
||||
@@ -44,7 +42,4 @@ def tamper(place, value):
|
||||
else:
|
||||
break
|
||||
|
||||
if place != "URI":
|
||||
value = urlencode(value)
|
||||
|
||||
return value
|
||||
|
||||
Reference in New Issue
Block a user