From 0b68144c8f20fe5654d8da61b8030f74087e4c76 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 26 Oct 2011 09:29:41 +0000 Subject: [PATCH] minor fixes for hash cracking --- lib/utils/hash.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/utils/hash.py b/lib/utils/hash.py index e48aab6fb..c5f8bf82b 100644 --- a/lib/utils/hash.py +++ b/lib/utils/hash.py @@ -344,8 +344,6 @@ def __bruteProcessVariantA(attack_info, hash_regex, wordlist, suffix, retVal, pr if not attack_info: break - count += 1 - if not isinstance(word, basestring): continue @@ -358,12 +356,14 @@ def __bruteProcessVariantA(attack_info, hash_regex, wordlist, suffix, retVal, pr for item in attack_info: ((user, hash_), _) = item + count += 1 + if hash_ == current: retVal.put((user, hash_, word)) clearConsoleLine() - infoMsg = "[%s] [INFO] cracked password '%s'" % (time.strftime("%X"), word) + infoMsg = "\r[%s] [INFO] cracked password '%s'" % (time.strftime("%X"), word) if user and not user.startswith(DUMMY_USER_PREFIX): infoMsg += " for user '%s'\n" % user @@ -420,7 +420,7 @@ def __bruteProcessVariantB(user, hash_, kwargs, hash_regex, wordlist, suffix, re clearConsoleLine() - infoMsg = "[%s] [INFO] cracked password '%s'" % (time.strftime("%X"), word) + infoMsg = "\r[%s] [INFO] cracked password '%s'" % (time.strftime("%X"), word) if user and not user.startswith(DUMMY_USER_PREFIX): infoMsg += " for user '%s'\n" % user