From f4e410db1616ae46a96165c422d86911bcedf056 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 1 Mar 2012 10:17:39 +0000 Subject: [PATCH] minor fix --- lib/techniques/blind/inference.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/techniques/blind/inference.py b/lib/techniques/blind/inference.py index d296b4a4a..e36f2ef67 100644 --- a/lib/techniques/blind/inference.py +++ b/lib/techniques/blind/inference.py @@ -179,7 +179,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None return not result - def getChar(idx, charTbl=asciiTbl, continuousOrder=True, expand=charsetType is None, shiftTable=None): + def getChar(idx, charTbl=None, continuousOrder=True, expand=charsetType is None, shiftTable=None): """ continuousOrder means that distance between each two neighbour's numerical values is exactly 1 @@ -190,6 +190,9 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None if result: return result + if charTbl is None: + charTbl = list(asciiTbl) + originalTbl = list(charTbl) if continuousOrder and shiftTable is None: @@ -199,7 +202,10 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None if CHAR_INFERENCE_MARK in payload and ord('\n') in charTbl: charTbl.remove(ord('\n')) - if len(charTbl) == 1: + if not charTbl: + return None + + elif len(charTbl) == 1: forgedPayload = safeStringFormat(payload.replace(INFERENCE_GREATER_CHAR, INFERENCE_EQUALS_CHAR), (expressionUnescaped, idx, charTbl[0])) result = Request.queryPage(forgedPayload, timeBasedCompare=timeBasedCompare, raise404=False) incrementCounter(kb.technique)