From 76839ff9d67dd9e3bdd20d27bad7a96a1391c4b7 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 7 Jan 2013 12:52:55 +0100 Subject: [PATCH] Fix for an Issue #305 --- lib/techniques/blind/inference.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/techniques/blind/inference.py b/lib/techniques/blind/inference.py index c5aebfc98..873009f7a 100644 --- a/lib/techniques/blind/inference.py +++ b/lib/techniques/blind/inference.py @@ -116,8 +116,8 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None if length == 0: return 0, "" - if lastChar > 0 and length > ( lastChar - firstChar ): - length = lastChar - firstChar + if (lastChar > 0 or firstChar > 0): + length = min(length, lastChar or length) - firstChar showEta = conf.eta and isinstance(length, int) numThreads = min(conf.threads, length) @@ -358,7 +358,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None while kb.threadContinue: kb.locks.index.acquire() - if threadData.shared.index[0] >= length: + if threadData.shared.index[0] - firstChar >= length: kb.locks.index.release() return @@ -376,7 +376,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None break with kb.locks.value: - threadData.shared.value[curidx - 1] = val + threadData.shared.value[curidx - 1 - firstChar] = val currentValue = list(threadData.shared.value) if kb.threadContinue: