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

Skip to content

Commit b98f84a

Browse files
committed
Fixes #1443
1 parent 1258b35 commit b98f84a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/utils/hash.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,11 @@ def dictionaryAttack(attack_dict):
716716
elif hash_regex in (HASH.CRYPT_GENERIC,):
717717
item = [(user, hash_), {'salt': hash_[0:2]}]
718718
elif hash_regex in (HASH.WORDPRESS,):
719-
item = [(user, hash_), {'salt': hash_[4:12], 'count': 1 << ITOA64.index(hash_[3]), 'prefix': hash_[:12]}]
719+
if ITOA64.index(hash_[3]) < 32:
720+
item = [(user, hash_), {'salt': hash_[4:12], 'count': 1 << ITOA64.index(hash_[3]), 'prefix': hash_[:12]}]
721+
else:
722+
warnMsg = "invalid hash '%s'" % hash_
723+
logger.warn(warnMsg)
720724

721725
if item and hash_ not in keys:
722726
resumed = hashDBRetrieve(hash_)

0 commit comments

Comments
 (0)