diff --git a/lib/request/inject.py b/lib/request/inject.py index 8d8f613c2..acf46405f 100644 --- a/lib/request/inject.py +++ b/lib/request/inject.py @@ -54,32 +54,6 @@ from lib.techniques.dns.use import dnsUse from lib.techniques.error.use import errorUse from lib.techniques.union.use import unionUse -def __goInference(payload, expression, charsetType=None, firstChar=None, lastChar=None, dump=False): - start = time.time() - value = None - count = 0 - - value = __goDns(payload, expression) - - if value is None: - timeBasedCompare = (kb.technique in (PAYLOAD.TECHNIQUE.TIME, PAYLOAD.TECHNIQUE.STACKED)) - - if not (timeBasedCompare and kb.dnsTest): - if (conf.eta or conf.threads > 1) and Backend.getIdentifiedDbms() and not timeBasedCompare: - _, length, _ = queryOutputLength(expression, payload) - else: - length = None - - kb.inferenceMode = True - count, value = bisection(payload, expression, length, charsetType, firstChar, lastChar, dump) - kb.inferenceMode = False - - if not kb.bruteMode: - debugMsg = "performed %d queries in %d seconds" % (count, calculateDeltaSeconds(start)) - logger.debug(debugMsg) - - return value - def __goDns(payload, expression): value = None @@ -92,6 +66,34 @@ def __goDns(payload, expression): return value +def __goInference(payload, expression, charsetType=None, firstChar=None, lastChar=None, dump=False): + start = time.time() + value = None + count = 0 + + value = __goDns(payload, expression) + + if value: + return value + + timeBasedCompare = (kb.technique in (PAYLOAD.TECHNIQUE.TIME, PAYLOAD.TECHNIQUE.STACKED)) + + if not (timeBasedCompare and kb.dnsTest): + if (conf.eta or conf.threads > 1) and Backend.getIdentifiedDbms() and not timeBasedCompare: + _, length, _ = queryOutputLength(expression, payload) + else: + length = None + + kb.inferenceMode = True + count, value = bisection(payload, expression, length, charsetType, firstChar, lastChar, dump) + kb.inferenceMode = False + + if not kb.bruteMode: + debugMsg = "performed %d queries in %d seconds" % (count, calculateDeltaSeconds(start)) + logger.debug(debugMsg) + + return value + def __goInferenceFields(expression, expressionFields, expressionFieldsList, payload, expected=None, num=None, charsetType=None, firstChar=None, lastChar=None, dump=False): outputs = [] origExpr = None