From b98f84a610473365cc7f019701fb551ad0ca3e53 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 5 Oct 2015 16:26:12 +0200 Subject: [PATCH] Fixes #1443 --- lib/utils/hash.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/utils/hash.py b/lib/utils/hash.py index 3965efd0e..7ab48c26f 100644 --- a/lib/utils/hash.py +++ b/lib/utils/hash.py @@ -716,7 +716,11 @@ def dictionaryAttack(attack_dict): elif hash_regex in (HASH.CRYPT_GENERIC,): item = [(user, hash_), {'salt': hash_[0:2]}] elif hash_regex in (HASH.WORDPRESS,): - item = [(user, hash_), {'salt': hash_[4:12], 'count': 1 << ITOA64.index(hash_[3]), 'prefix': hash_[:12]}] + if ITOA64.index(hash_[3]) < 32: + item = [(user, hash_), {'salt': hash_[4:12], 'count': 1 << ITOA64.index(hash_[3]), 'prefix': hash_[:12]}] + else: + warnMsg = "invalid hash '%s'" % hash_ + logger.warn(warnMsg) if item and hash_ not in keys: resumed = hashDBRetrieve(hash_)