mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 20:51:31 +00:00
commit of all sorts (bug fix for heuristics and URI injections, fine tunning of tampering modules with SQL keywords,...)
This commit is contained in:
@@ -6,12 +6,28 @@ from lib.core.convert import urlencode
|
||||
"""
|
||||
' ' -> /**/ (e.g., SELECT id FROM users->SELECT/**/id/**/FROM users)
|
||||
"""
|
||||
#TODO: only do it for deepness = 0 regarding '"
|
||||
def tamper(place, value):
|
||||
retVal = value
|
||||
if value:
|
||||
if place != "URI":
|
||||
value = urldecode(value)
|
||||
value = value.replace(" ", "/**/")
|
||||
|
||||
retVal = ""
|
||||
qoute, doublequote, firstspace = False, False, False
|
||||
|
||||
for i in xrange(len(value)):
|
||||
if not firstspace:
|
||||
firstspace = value[i].isspace()
|
||||
elif value[i] == '\'':
|
||||
qoute = not qoute
|
||||
elif value[i] == '"':
|
||||
doublequote = not doublequote
|
||||
elif value[i]==" " and not doublequote and not qoute:
|
||||
retVal += "/**/"
|
||||
continue
|
||||
retVal += value[i]
|
||||
|
||||
if place != "URI":
|
||||
value = urlencode(value)
|
||||
return value
|
||||
retVal = urlencode(retVal)
|
||||
return retVal
|
||||
|
||||
|
||||
Reference in New Issue
Block a user