Fix for interrupted --first/--last corrupting stored value

This commit is contained in:
Miroslav Štampar 2026-11-12 11:50:33 +01:00
parent 6aa218f720
commit eda9b00185
2 changed files with 3 additions and 3 deletions

View file

@ -19,7 +19,7 @@ from lib.core.enums import OS
from thirdparty import six
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.10.11.19"
VERSION = "1.10.11.20"
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)

View file

@ -327,7 +327,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
threadData = getCurrentThreadData()
threadData.lowCardHit = False # set when this value is confirmed by the (self-verifying) low-card guess
timeBasedCompare = (getTechnique() in (PAYLOAD.TECHNIQUE.TIME, PAYLOAD.TECHNIQUE.STACKED))
retVal = hashDBRetrieve(expression, checkConf=True)
retVal = hashDBRetrieve(expression, checkConf=True) if not (conf.firstChar or conf.lastChar) else None # Note: stored (complete) value doesn't correspond to a --first/--last range
if retVal:
if conf.repair and INFERENCE_UNKNOWN_CHAR in retVal:
@ -1251,7 +1251,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
and 0 < len(finalValue) <= PREDICTION_FEEDBACK_MAX_LENGTH
and len(kb.commonOutputs.get(kb.partRun) or ()) < PREDICTION_FEEDBACK_MAX_ITEMS):
kb.commonOutputs.setdefault(kb.partRun, set()).add(finalValue)
elif partialValue:
elif partialValue and not (conf.firstChar or conf.lastChar): # Note: same as above (otherwise resumed as the start of the complete value)
hashDBWrite(expression, "%s%s" % (PARTIAL_VALUE_MARKER if not conf.hexConvert else PARTIAL_HEX_VALUE_MARKER, partialValue))
if conf.hexConvert and not any((abortedFlag, conf.api, kb.bruteMode)):