From f39170a2c4c8c5cd14e0135cb130b6ffd4af7ba1 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 22 Nov 2011 15:06:51 +0000 Subject: [PATCH] minor update --- lib/techniques/blind/inference.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/techniques/blind/inference.py b/lib/techniques/blind/inference.py index 82725efad..54c399313 100644 --- a/lib/techniques/blind/inference.py +++ b/lib/techniques/blind/inference.py @@ -258,25 +258,25 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None if retVal in originalTbl or (retVal == ord('\n') and CHAR_INFERENCE_MARK in payload): if timeBasedCompare and not validateChar(idx, retVal): - errMsg = "invalid character detected. retrying.." - logger.error(errMsg) - if not kb.originalTimeDelay: kb.originalTimeDelay = conf.timeSec - conf.timeSec += 1 - if (conf.timeSec - kb.originalTimeDelay) <= MAX_TIME_REVALIDATION_STEPS: + if (conf.timeSec - kb.originalTimeDelay) < MAX_TIME_REVALIDATION_STEPS: + errMsg = "invalid character detected. retrying.." + logger.error(errMsg) + warnMsg = "increasing time delay to %d second%s " % (conf.timeSec, 's' if conf.timeSec > 1 else '') - warnMsg += "(due to invalid char)" logger.warn(warnMsg) + conf.timeSec += 1 + if kb.adjustTimeDelay: dbgMsg = "turning off auto-adjustment mechanism" logger.debug(dbgMsg) kb.adjustTimeDelay = False return getChar(idx, originalTbl, continuousOrder, expand) else: - errMsg = "unable to properly validate character value. using last known value ('%s').." % decodeIntToUnicode(retVal) + errMsg = "unable to properly validate last character value ('%s').." % decodeIntToUnicode(retVal) logger.error(errMsg) conf.timeSec = kb.originalTimeDelay return decodeIntToUnicode(retVal)