diff --git a/lib/core/option.py b/lib/core/option.py index 6d32dbb1b..526d35d30 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -1661,6 +1661,7 @@ def _setKnowledgeBaseAttributes(flushAll=True): kb.reduceTests = None kb.stickyDBMS = False kb.stickyLevel = None + kb.storeHashesChoice = None kb.suppressResumeInfo = False kb.technique = None kb.testMode = False diff --git a/lib/utils/hash.py b/lib/utils/hash.py index 1f7555a86..df0916b25 100644 --- a/lib/utils/hash.py +++ b/lib/utils/hash.py @@ -358,11 +358,19 @@ def storeHashesToFile(attack_dict): if not attack_dict: return + if kb.storeHashesChoice is None: + message = "do you want to store hashes to a temporary file " + message += "for eventual further processing with other tools [y/N] " + test = readInput(message, default="N") + kb.storeHashesChoice = test[0] in ("y", "Y") + + if not kb.storeHashesChoice: + return + handle, filename = tempfile.mkstemp(prefix="sqlmaphashes-", suffix=".txt") os.close(handle) - infoMsg = "writing hashes to file '%s' " % filename - infoMsg += "for eventual further processing with other tools" + infoMsg = "writing hashes to a temporary file '%s' " % filename logger.info(infoMsg) items = set()