@@ -162,7 +162,11 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
162162 length = None
163163
164164 showEta = conf .eta and isinstance (length , int )
165- numThreads = min (conf .threads or 0 , length or 0 ) or 1
165+
166+ if kb .bruteMode :
167+ numThreads = 1
168+ else :
169+ numThreads = min (conf .threads or 0 , length or 0 ) or 1
166170
167171 if showEta :
168172 progress = ProgressBar (maxValue = length )
@@ -174,13 +178,13 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
174178 else :
175179 numThreads = 1
176180
177- if conf . threads == 1 and not timeBasedCompare and not conf .predictOutput :
181+ if numThreads == 1 and not timeBasedCompare and not conf .predictOutput :
178182 warnMsg = "running in a single-thread mode. Please consider "
179183 warnMsg += "usage of option '--threads' for faster data retrieval"
180184 singleTimeWarnMessage (warnMsg )
181185
182- if conf .verbose in (1 , 2 ) and not showEta and not conf .api :
183- if isinstance (length , int ) and conf . threads > 1 :
186+ if conf .verbose in (1 , 2 ) and not any (( showEta , conf .api , kb . bruteMode )) :
187+ if isinstance (length , int ) and numThreads > 1 :
184188 dataToStdout ("[%s] [INFO] retrieved: %s" % (time .strftime ("%X" ), "_" * min (length , conf .progressWidth )))
185189 dataToStdout ("\r [%s] [INFO] retrieved: " % time .strftime ("%X" ))
186190 else :
@@ -459,7 +463,7 @@ def getChar(idx, charTbl=None, continuousOrder=True, expand=charsetType is None,
459463 return decodeIntToUnicode (candidates [0 ])
460464
461465 # Go multi-threading (--threads > 1)
462- if conf . threads > 1 and isinstance (length , int ) and length > 1 :
466+ if numThreads > 1 and isinstance (length , int ) and length > 1 :
463467 threadData .shared .value = [None ] * length
464468 threadData .shared .index = [firstChar ] # As list for python nested function scoping
465469 threadData .shared .start = firstChar
@@ -517,7 +521,7 @@ def blindThread():
517521 if (endCharIndex - startCharIndex == conf .progressWidth ) and (endCharIndex < length - 1 ):
518522 output = output [:- 2 ] + ".."
519523
520- if conf .verbose in (1 , 2 ) and not showEta and not conf .api :
524+ if conf .verbose in (1 , 2 ) and not any (( showEta , conf .api , kb . bruteMode )) :
521525 _ = count - firstChar
522526 output += '_' * (min (length , conf .progressWidth ) - len (output ))
523527 status = ' %d/%d (%d%%)' % (_ , length , int (100.0 * _ / length ))
@@ -547,7 +551,7 @@ def blindThread():
547551 finalValue = "" .join (value )
548552 infoMsg = "\r [%s] [INFO] retrieved: %s" % (time .strftime ("%X" ), filterControlChars (finalValue ))
549553
550- if conf .verbose in (1 , 2 ) and not showEta and infoMsg and not conf .api :
554+ if conf .verbose in (1 , 2 ) and infoMsg and not any (( showEta , conf .api , kb . bruteMode )) :
551555 dataToStdout (infoMsg )
552556
553557 # No multi-threading (--threads = 1)
@@ -632,7 +636,7 @@ def blindThread():
632636
633637 if showEta :
634638 progress .progress (index )
635- elif conf .verbose in (1 , 2 ) or conf .api :
639+ elif ( conf .verbose in (1 , 2 ) and not kb . bruteMode ) or conf .api :
636640 dataToStdout (filterControlChars (val ))
637641
638642 # some DBMSes (e.g. Firebird, DB2, etc.) have issues with trailing spaces
@@ -661,11 +665,11 @@ def blindThread():
661665 elif partialValue :
662666 hashDBWrite (expression , "%s%s" % (PARTIAL_VALUE_MARKER if not conf .hexConvert else PARTIAL_HEX_VALUE_MARKER , partialValue ))
663667
664- if conf .hexConvert and not abortedFlag and not conf .api :
668+ if conf .hexConvert and not any (( abortedFlag , conf .api , kb . bruteMode )) :
665669 infoMsg = "\r [%s] [INFO] retrieved: %s %s\n " % (time .strftime ("%X" ), filterControlChars (finalValue ), " " * retrievedLength )
666670 dataToStdout (infoMsg )
667671 else :
668- if conf .verbose in (1 , 2 ) and not showEta and not conf .api :
672+ if conf .verbose in (1 , 2 ) and not any (( showEta , conf .api , kb . bruteMode )) :
669673 dataToStdout ("\n " )
670674
671675 if (conf .verbose in (1 , 2 ) and showEta ) or conf .verbose >= 3 :
0 commit comments