diff --git a/lib/request/inject.py b/lib/request/inject.py index 88c631f60..7999da794 100644 --- a/lib/request/inject.py +++ b/lib/request/inject.py @@ -54,13 +54,12 @@ def __goInference(payload, expression, charsetType=None, firstChar=None, lastCha dataToSessionFile("[%s][%s][%s][%s][" % (conf.url, kb.injPlace, conf.parameters[kb.injPlace], expression)) count, value = bisection(payload, expression, length, charsetType, firstChar, lastChar) - duration = int(time.time() - start) if conf.eta and length: infoMsg = "retrieved: %s" % value logger.info(infoMsg) - debugMsg = "performed %d queries in %d seconds" % (count, duration) + debugMsg = "performed %d queries in %d seconds" % (count, int(time.time() - start)) logger.debug(debugMsg) return value diff --git a/lib/utils/resume.py b/lib/utils/resume.py index f5c12b2e4..97701b035 100644 --- a/lib/utils/resume.py +++ b/lib/utils/resume.py @@ -23,6 +23,7 @@ Franklin St, Fifth Floor, Boston, MA 02110-1301 USA """ import re +import time from lib.core.common import dataToSessionFile from lib.core.common import safeStringFormat @@ -84,8 +85,12 @@ def queryOutputLength(expression, payload): dataToSessionFile("[%s][%s][%s][%s][" % (conf.url, kb.injPlace, conf.parameters[kb.injPlace], lengthExpr)) + start = time.time() lengthExprUnescaped = unescaper.unescape(lengthExpr) - count, length = bisection(payload, lengthExprUnescaped, charsetType=2) + count, length = bisection(payload, lengthExprUnescaped, charsetType=2) + + debugMsg = "performed %d queries in %d seconds" % (count, int(time.time() - start)) + logger.debug(debugMsg) if length == " ": length = 0 @@ -178,7 +183,11 @@ def resume(expression, payload): infoMsg += "output characters" logger.info(infoMsg) - _, finalValue = bisection(payload, newExpr, length=missingCharsLength) + start = time.time() + count, finalValue = bisection(payload, newExpr, length=missingCharsLength) + + debugMsg = "performed %d queries in %d seconds" % (count, int(time.time() - start)) + logger.debug(debugMsg) if len(finalValue) != ( int(length) - len(resumedValue) ): warnMsg = "the total length of the query is not "