From ea1b0d31be23c72a19d5bd370b7ec2ac5f3cfc5a Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Sun, 7 Nov 2010 22:42:56 +0000 Subject: [PATCH] Avoid displaying single retrieved character when --verbose > 2 --- lib/techniques/blind/inference.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/techniques/blind/inference.py b/lib/techniques/blind/inference.py index 22fb411d2..631f8c361 100644 --- a/lib/techniques/blind/inference.py +++ b/lib/techniques/blind/inference.py @@ -99,7 +99,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None debugMsg = "starting %d thread%s" % (numThreads, ("s" if numThreads > 1 else "")) logger.debug(debugMsg) - if conf.verbose >= 1 and not showEta: + if conf.verbose in (1, 2) and not showEta: if isinstance(length, int) and conf.threads > 1: dataToStdout("[%s] [INFO] retrieved: %s" % (time.strftime("%X"), "_" * min(length, conf.progressWidth))) dataToStdout("\r[%s] [INFO] retrieved: " % time.strftime("%X")) @@ -413,7 +413,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None if isinstance(finalValue, basestring) and len(finalValue) > 0: dataToSessionFile(replaceNewlineTabs(finalValue)) - if conf.verbose >= 1 and not showEta and infoMsg: + if conf.verbose in (1, 2) and not showEta and infoMsg: dataToStdout(infoMsg) kb.locks.seqLock = None @@ -452,7 +452,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None if showEta: etaProgressUpdate(time.time() - charStart, len(commonValue)) - elif conf.verbose >= 1: + elif conf.verbose in (1, 2): dataToStdout(commonValue[index-1:]) finalValue = commonValue @@ -500,10 +500,10 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None if showEta: etaProgressUpdate(time.time() - charStart, index) - elif conf.verbose >= 1: + elif conf.verbose in (1, 2): dataToStdout(val) - if conf.verbose >= 1 or showEta: + if conf.verbose in (1, 2) or showEta: dataToStdout("\n") if ( conf.verbose in ( 1, 2 ) and showEta ) or conf.verbose >= 3: