mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-11-20 07:00:25 +00:00
Making boolean inference more robust against jitter
This commit is contained in:
parent
023d85fba8
commit
306738539e
3 changed files with 273 additions and 6 deletions
|
|
@ -20,7 +20,7 @@ from lib.core.enums import OS
|
|||
from thirdparty import six
|
||||
|
||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||
VERSION = "1.10.7.240"
|
||||
VERSION = "1.10.7.241"
|
||||
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
||||
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
||||
|
|
|
|||
|
|
@ -513,11 +513,20 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
|
|||
|
||||
result = not Request.queryPage(forgedPayload, timeBasedCompare=timeBasedCompare, raise404=False)
|
||||
|
||||
if result and timeBasedCompare and getTechniqueData().trueCode:
|
||||
result = threadData.lastCode == getTechniqueData().trueCode
|
||||
if not result:
|
||||
warnMsg = "detected HTTP code '%s' in validation phase is differing from expected '%s'" % (threadData.lastCode, getTechniqueData().trueCode)
|
||||
singleTimeWarnMessage(warnMsg)
|
||||
if result and getTechniqueData() is not None:
|
||||
trueCode, falseCode = getTechniqueData().trueCode, getTechniqueData().falseCode
|
||||
if timeBasedCompare:
|
||||
if trueCode:
|
||||
result = threadData.lastCode == trueCode
|
||||
if not result:
|
||||
warnMsg = "detected HTTP code '%s' in validation phase is differing from expected '%s'" % (threadData.lastCode, trueCode)
|
||||
singleTimeWarnMessage(warnMsg)
|
||||
# A boolean validation confirmed under an UNEXPECTED HTTP code (a transient 5xx/403/429/..
|
||||
# landing on the validation request itself) is not trustworthy - fail it so the character is
|
||||
# re-extracted, riding out the blip. On a clean target every code is true/false -> no-op.
|
||||
elif threadData.lastCode is not None and any((trueCode, falseCode)) and threadData.lastCode not in (trueCode, falseCode):
|
||||
result = False
|
||||
singleTimeWarnMessage("unexpected HTTP code '%s' during validation phase; will re-extract" % threadData.lastCode)
|
||||
|
||||
incrementCounter(getTechnique())
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue