@@ -307,6 +307,7 @@ def hashRecognition(value):
307307 return retVal
308308
309309def dictionaryAttack (attack_dict ):
310+ suffix_list = ["" ]
310311 hash_regexes = []
311312 results = []
312313
@@ -369,12 +370,11 @@ def dictionaryAttack(attack_dict):
369370 logger .info (infoMsg )
370371 kb .wordlist = getFileItems (dictpath , None , False )
371372
372- message = "do you want to use common password suffixes? (slow!) [y/N] "
373- test = readInput (message , default = "N" )
373+ message = "do you want to use common password suffixes? (slow!) [y/N] "
374+ test = readInput (message , default = "N" )
374375
375- suffix_list = ["" ]
376- if test [0 ] in ("y" , "Y" ):
377- suffix_list += COMMON_PASSWORD_SUFFIXES
376+ if test [0 ] in ("y" , "Y" ):
377+ suffix_list += COMMON_PASSWORD_SUFFIXES
378378
379379 infoMsg = "starting dictionary attack (%s)" % __functions__ [hash_regex ].func_name
380380 logger .info (infoMsg )
@@ -427,7 +427,9 @@ def dictionaryAttack(attack_dict):
427427 dataToStdout ("\r [%s] [INFO] %s" % (time .strftime ("%X" ), status ))
428428
429429 except KeyboardInterrupt :
430- raise
430+ warnMsg = "Ctrl+C detected in dictionary attack phase"
431+ logger .warn (warnMsg )
432+ return results
431433
432434 except :
433435 warnMsg = "there was a problem while hashing entry: %s. " % repr (word )
@@ -477,7 +479,9 @@ def dictionaryAttack(attack_dict):
477479 dataToStdout ("\r [%s] [INFO] %s" % (time .strftime ("%X" ), status ))
478480
479481 except KeyboardInterrupt :
480- raise
482+ warnMsg = "Ctrl+C detected in dictionary attack phase"
483+ logger .warn (warnMsg )
484+ return results
481485
482486 except :
483487 warnMsg = "there was a problem while hashing entry: %s. " % repr (word )
0 commit comments