From c17714c423e956fed3dc83b8e04f85047a400369 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Fri, 7 Jan 2011 16:47:46 +0000 Subject: [PATCH] suppress session in case of brute methods --- lib/core/common.py | 2 +- lib/core/option.py | 1 + lib/techniques/brute/use.py | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/core/common.py b/lib/core/common.py index c01249f71..1dc331d9c 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -430,7 +430,7 @@ def dataToStdout(data, forceOutput=False): print data.encode(conf.dataEncoding) def dataToSessionFile(data): - if not conf.sessionFile: + if not conf.sessionFile or kb.suppressSession: return conf.sessionFP.write(data) diff --git a/lib/core/option.py b/lib/core/option.py index f7314403c..5389f7c58 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -1192,6 +1192,7 @@ def __setKnowledgeBaseAttributes(flushAll=True): kb.resumedQueries = {} kb.retriesCount = 0 kb.skipTests = None + kb.suppressSession = False kb.technique = None kb.testMode = False kb.testQueryCount = 0 diff --git a/lib/techniques/brute/use.py b/lib/techniques/brute/use.py index 3c693cd73..76049fedb 100644 --- a/lib/techniques/brute/use.py +++ b/lib/techniques/brute/use.py @@ -55,6 +55,7 @@ def tableExists(tableFile, regex=None): iolock = threading.Lock() kb.locks.seqLock = threading.Lock() kb.threadContinue = True + kb.suppressSession = True def tableExistsThread(): while count[0] < length and kb.threadContinue: @@ -131,6 +132,7 @@ def tableExists(tableFile, regex=None): kb.locks.seqLock = None kb.threadContinue = True kb.threadException = False + kb.suppressSession = False clearConsoleLine(True) @@ -170,6 +172,7 @@ def columnExists(columnFile, regex=None): iolock = threading.Lock() kb.locks.seqLock = threading.Lock() kb.threadContinue = True + kb.suppressSession = True def columnExistsThread(): while count[0] < length and kb.threadContinue: @@ -237,6 +240,7 @@ def columnExists(columnFile, regex=None): kb.locks.seqLock = None kb.threadContinue = True kb.threadException = False + kb.suppressSession = False clearConsoleLine(True)