mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 04:31:30 +00:00
urllib2 doesn't play well with '\n' when non unescaped chars used
This commit is contained in:
@@ -1724,6 +1724,8 @@ def isDBMSVersionAtLeast(version):
|
|||||||
value = float(value.replace("<=", ""))
|
value = float(value.replace("<=", ""))
|
||||||
elif value.startswith(">"):
|
elif value.startswith(">"):
|
||||||
value = float(value.replace("<", "")) - 0.01
|
value = float(value.replace("<", "")) - 0.01
|
||||||
|
else:
|
||||||
|
value = float(value)
|
||||||
retVal = value >= version
|
retVal = value >= version
|
||||||
|
|
||||||
return retVal
|
return retVal
|
||||||
|
|||||||
@@ -155,6 +155,9 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
|
|||||||
# Used for gradual expanding into unicode charspace
|
# Used for gradual expanding into unicode charspace
|
||||||
shiftTable = [5, 4]
|
shiftTable = [5, 4]
|
||||||
|
|
||||||
|
if CHAR_INFERENCE_MARK in payload and ord('\n') in charTbl:
|
||||||
|
charTbl.remove(ord('\n'))
|
||||||
|
|
||||||
if len(charTbl) == 1:
|
if len(charTbl) == 1:
|
||||||
forgedPayload = safeStringFormat(payload.replace('%3E', '%3D'), (expressionUnescaped, idx, charTbl[0]))
|
forgedPayload = safeStringFormat(payload.replace('%3E', '%3D'), (expressionUnescaped, idx, charTbl[0]))
|
||||||
queriesCount[0] += 1
|
queriesCount[0] += 1
|
||||||
@@ -216,7 +219,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
|
|||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
retVal = minValue + 1
|
retVal = minValue + 1
|
||||||
if retVal in originalTbl:
|
if retVal in originalTbl or (retVal == ord('\n') and CHAR_INFERENCE_MARK in payload):
|
||||||
return chr(retVal) if retVal < 128 else unichr(retVal)
|
return chr(retVal) if retVal < 128 else unichr(retVal)
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|||||||
Reference in New Issue
Block a user