diff --git a/lib/request/connect.py b/lib/request/connect.py index b943189bf..659864f6f 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -36,6 +36,7 @@ from lib.core.enums import HTTPMETHOD from lib.core.enums import NULLCONNECTION from lib.core.enums import PLACE from lib.core.exception import sqlmapConnectionException +from lib.core.settings import MIN_TIME_RESPONSES from lib.request.basic import decodePage from lib.request.basic import forgeHeaders from lib.request.basic import parseResponse @@ -384,6 +385,15 @@ class Connect: else: uri = conf.url + if timeBasedCompare: + if len(kb.responseTimes) < MIN_TIME_RESPONSES: + warnMsg = "time-based comparison requested on a statisical model " + warnMsg += "with too small data set. doing few dummy requests." + logger.warn(warnMsg) + + while len(kb.responseTimes) < MIN_TIME_RESPONSES: + _ = Connect.queryPage(content=True) + if conf.safUrl and conf.saFreq > 0: kb.queryCounter += 1 if kb.queryCounter % conf.saFreq == 0: diff --git a/lib/request/inject.py b/lib/request/inject.py index 9c31b15fb..aa72fd62e 100644 --- a/lib/request/inject.py +++ b/lib/request/inject.py @@ -419,9 +419,6 @@ def getValue(expression, blind=True, inband=True, error=True, time=True, fromUse elif kb.stackedTest: kb.technique = PAYLOAD.TECHNIQUE.STACKED - while len(kb.responseTimes) < MIN_TIME_RESPONSES: - _ = Request.queryPage(content=True) - value = __goInferenceProxy(expression, fromUser, expected, batch, resumeValue, unpack, charsetType, firstChar, lastChar) kb.unionNegative = oldParamNegative