Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 934808f

Browse files
committed
Fix for an Issue #379
1 parent e03010f commit 934808f

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

lib/utils/hash.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ def _bruteProcessVariantA(attack_info, hash_regex, suffix, retVal, proc_id, proc
512512
pass
513513

514514
finally:
515-
if hasattr(proc_count, 'value'):
515+
if hasattr(proc_count, "value"):
516516
proc_count.value -= 1
517517

518518
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
579579
pass
580580

581581
finally:
582-
if hasattr(proc_count, 'value'):
582+
if hasattr(proc_count, "value"):
583583
proc_count.value -= 1
584584

585585
def dictionaryAttack(attack_dict):
@@ -732,10 +732,11 @@ def dictionaryAttack(attack_dict):
732732
processes.append(p)
733733

734734
for p in processes:
735+
p.daemon = True
735736
p.start()
736737

737-
for p in processes:
738-
p.join()
738+
while count.value > 0:
739+
time.sleep(0.5)
739740

740741
else:
741742
warnMsg = "multiprocessing hash cracking is currently "
@@ -810,10 +811,11 @@ def dictionaryAttack(attack_dict):
810811
processes.append(p)
811812

812813
for p in processes:
814+
p.daemon = True
813815
p.start()
814816

815-
for p in processes:
816-
p.join()
817+
while count.value > 0:
818+
time.sleep(0.5)
817819

818820
found = found_.value != 0
819821

0 commit comments

Comments
 (0)