Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e03010f

Browse files
committed
got rid of unnecessary output for API - #297
1 parent 4428ad5 commit e03010f

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

lib/techniques/blind/inference.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
156156
warnMsg += "usage of option '--threads' for faster data retrieval"
157157
singleTimeWarnMessage(warnMsg)
158158

159-
if conf.verbose in (1, 2) and not showEta:
159+
if conf.verbose in (1, 2) and not showEta and not hasattr(conf, "api"):
160160
if isinstance(length, int) and conf.threads > 1:
161161
dataToStdout("[%s] [INFO] retrieved: %s" % (time.strftime("%X"), "_" * min(length, conf.progressWidth)))
162162
dataToStdout("\r[%s] [INFO] retrieved: " % time.strftime("%X"))
@@ -430,7 +430,7 @@ def blindThread():
430430
if (endCharIndex - startCharIndex == conf.progressWidth) and (endCharIndex < length - 1):
431431
output = output[:-2] + '..'
432432

433-
if conf.verbose in (1, 2) and not showEta:
433+
if conf.verbose in (1, 2) and not showEta and not hasattr(conf, "api"):
434434
_ = count - firstChar
435435
output += '_' * (min(length, conf.progressWidth) - len(output))
436436
status = ' %d/%d (%d%%)' % (_, length, round(100.0 * _ / length))
@@ -460,7 +460,7 @@ def blindThread():
460460
finalValue = "".join(value)
461461
infoMsg = "\r[%s] [INFO] retrieved: %s" % (time.strftime("%X"), filterControlChars(finalValue))
462462

463-
if conf.verbose in (1, 2) and not showEta and infoMsg:
463+
if conf.verbose in (1, 2) and not showEta and infoMsg and not hasattr(conf, "api"):
464464
dataToStdout(infoMsg)
465465

466466
# No multi-threading (--threads = 1)
@@ -566,11 +566,11 @@ def blindThread():
566566
elif partialValue:
567567
hashDBWrite(expression, "%s%s" % (PARTIAL_VALUE_MARKER if not conf.hexConvert else PARTIAL_HEX_VALUE_MARKER, partialValue))
568568

569-
if conf.hexConvert and not abortedFlag:
569+
if conf.hexConvert and not abortedFlag and not hasattr(conf, "api"):
570570
infoMsg = "\r[%s] [INFO] retrieved: %s %s\n" % (time.strftime("%X"), filterControlChars(finalValue), " " * retrievedLength)
571571
dataToStdout(infoMsg)
572572
else:
573-
if conf.verbose in (1, 2) or showEta:
573+
if conf.verbose in (1, 2) or showEta and not hasattr(conf, "api"):
574574
dataToStdout("\n")
575575

576576
if (conf.verbose in (1, 2) and showEta) or conf.verbose >= 3:

lib/techniques/brute/use.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def tableExistsThread():
9999
threadData.shared.value.append(table)
100100
threadData.shared.unique.add(table.lower())
101101

102-
if conf.verbose in (1, 2):
102+
if conf.verbose in (1, 2) and not hasattr(conf, "api"):
103103
clearConsoleLine(True)
104104
infoMsg = "[%s] [INFO] retrieved: %s\r\n" % (time.strftime("%X"), table)
105105
dataToStdout(infoMsg, True)
@@ -195,7 +195,7 @@ def columnExistsThread():
195195
if result:
196196
threadData.shared.value.append(column)
197197

198-
if conf.verbose in (1, 2):
198+
if conf.verbose in (1, 2) and not hasattr(conf, "api"):
199199
clearConsoleLine(True)
200200
infoMsg = "[%s] [INFO] retrieved: %s\r\n" % (time.strftime("%X"), column)
201201
dataToStdout(infoMsg, True)

0 commit comments

Comments
 (0)