From 934808f53b8d7c83c953234ea3c2ee05ff23780b Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 5 Feb 2013 16:13:33 +0100 Subject: [PATCH] Fix for an Issue #379 --- lib/utils/hash.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/utils/hash.py b/lib/utils/hash.py index ac0721e95..fc068e100 100644 --- a/lib/utils/hash.py +++ b/lib/utils/hash.py @@ -512,7 +512,7 @@ def _bruteProcessVariantA(attack_info, hash_regex, suffix, retVal, proc_id, proc pass finally: - if hasattr(proc_count, 'value'): + if hasattr(proc_count, "value"): proc_count.value -= 1 def _bruteProcessVariantB(user, hash_, kwargs, hash_regex, suffix, retVal, found, proc_id, proc_count, wordlists, custom_wordlist): @@ -579,7 +579,7 @@ def _bruteProcessVariantB(user, hash_, kwargs, hash_regex, suffix, retVal, found pass finally: - if hasattr(proc_count, 'value'): + if hasattr(proc_count, "value"): proc_count.value -= 1 def dictionaryAttack(attack_dict): @@ -732,10 +732,11 @@ def dictionaryAttack(attack_dict): processes.append(p) for p in processes: + p.daemon = True p.start() - for p in processes: - p.join() + while count.value > 0: + time.sleep(0.5) else: warnMsg = "multiprocessing hash cracking is currently " @@ -810,10 +811,11 @@ def dictionaryAttack(attack_dict): processes.append(p) for p in processes: + p.daemon = True p.start() - for p in processes: - p.join() + while count.value > 0: + time.sleep(0.5) found = found_.value != 0