mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 12:41:30 +00:00
changes regarding Feature #157 (Evaluate BETWEEN for inference algorithm)
This commit is contained in:
@@ -158,18 +158,30 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
|
||||
posValueOld = posValue
|
||||
posValue = chr(posValue)
|
||||
|
||||
forgedPayload = safeStringFormat(payload, (expressionUnescaped, idx, posValue))
|
||||
if not conf.useBetween:
|
||||
forgedPayload = safeStringFormat(payload, (expressionUnescaped, idx, posValue))
|
||||
else:
|
||||
forgedPayload = safeStringFormat(payload.replace('%3E', 'BETWEEN 0 AND '), (expressionUnescaped, idx, posValue))
|
||||
|
||||
result = Request.queryPage(urlencode(forgedPayload))
|
||||
|
||||
if kb.dbms == "SQLite":
|
||||
posValue = posValueOld
|
||||
|
||||
if result:
|
||||
minValue = posValue
|
||||
asciiTbl = asciiTbl[position:]
|
||||
else:
|
||||
maxValue = posValue
|
||||
asciiTbl = asciiTbl[:position]
|
||||
if not conf.useBetween: #normal
|
||||
if result:
|
||||
minValue = posValue
|
||||
asciiTbl = asciiTbl[position:]
|
||||
else:
|
||||
maxValue = posValue
|
||||
asciiTbl = asciiTbl[:position]
|
||||
else: #reversed
|
||||
if result:
|
||||
maxValue = posValue
|
||||
asciiTbl = asciiTbl[:position]
|
||||
else:
|
||||
minValue = posValue
|
||||
asciiTbl = asciiTbl[position:]
|
||||
|
||||
if len(asciiTbl) == 1:
|
||||
if maxValue == 1:
|
||||
|
||||
Reference in New Issue
Block a user