Adding a question for storing hashes to a temporary file (after a mention of it on Twitter)

This commit is contained in:
stamparm
2013-07-04 15:34:00 +02:00
parent e498694928
commit db536427f0
2 changed files with 11 additions and 2 deletions

View File

@@ -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()