fix for those ugly DEBUG messages in brute mode

This commit is contained in:
Miroslav Stampar 2011-04-08 11:02:21 +00:00
parent 5b21352656
commit 228cc68747
5 changed files with 15 additions and 9 deletions

View File

@ -1234,9 +1234,8 @@ def __setKnowledgeBaseAttributes(flushAll=True):
kb.authHeader = None
kb.bannerFp = advancedDict()
kb.brute = advancedDict()
kb.brute.tables = []
kb.brute.columns = []
kb.brute = advancedDict({'tables':[], 'columns':[]})
kb.bruteMode = False
kb.cache = advancedDict()
kb.cache.content = {}

View File

@ -63,6 +63,7 @@ def __goInference(payload, expression, charsetType=None, firstChar=None, lastCha
count, value = bisection(payload, expression, length, charsetType, firstChar, lastChar, dump)
if not kb.bruteMode:
debugMsg = "performed %d queries in %d seconds" % (count, calculateDeltaSeconds(start))
logger.debug(debugMsg)

View File

@ -57,6 +57,7 @@ def tableExists(tableFile, regex=None):
tbllock = threading.Lock()
iolock = threading.Lock()
kb.threadContinue = True
kb.bruteMode = True
def tableExistsThread():
while count[0] < length and kb.threadContinue:
@ -140,6 +141,7 @@ def tableExists(tableFile, regex=None):
except KeyboardInterrupt:
raise sqlmapThreadException, "user aborted"
finally:
kb.bruteMode = False
kb.threadContinue = True
kb.threadException = False
@ -182,6 +184,7 @@ def columnExists(columnFile, regex=None):
collock = threading.Lock()
iolock = threading.Lock()
kb.threadContinue = True
kb.bruteMode = True
def columnExistsThread():
while count[0] < length and kb.threadContinue:
@ -256,6 +259,7 @@ def columnExists(columnFile, regex=None):
except KeyboardInterrupt:
raise sqlmapThreadException, "user aborted"
finally:
kb.bruteMode = False
kb.threadContinue = True
kb.threadException = False

View File

@ -307,6 +307,7 @@ def errorUse(expression, expected=None, resumeValue=True, dump=False):
duration = calculateDeltaSeconds(start)
if not kb.bruteMode:
debugMsg = "performed %d queries in %d seconds" % (reqCount, duration)
logger.debug(debugMsg)

View File

@ -269,6 +269,7 @@ def unionUse(expression, unpack=True, dump=False):
duration = calculateDeltaSeconds(start)
if not kb.bruteMode:
debugMsg = "performed %d queries in %d seconds" % (reqCount, duration)
logger.debug(debugMsg)