From 9d31230d5e30704de576cb458e9a7539244fd5af Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 26 Oct 2011 21:56:26 +0000 Subject: [PATCH] minor update --- lib/utils/hash.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/utils/hash.py b/lib/utils/hash.py index ceff89311..f46c6a009 100644 --- a/lib/utils/hash.py +++ b/lib/utils/hash.py @@ -474,7 +474,7 @@ def dictionaryAttack(attack_dict): logger.info(infoMsg) for hash_regex in hash_regexes: - items = set() + keys = set() attack_info = [] for (user, hashes) in attack_dict.items(): @@ -498,9 +498,10 @@ def dictionaryAttack(attack_dict): elif hash_regex in (HASH.CRYPT_GENERIC): item = [(user, hash_), {'salt': hash_[0:2]}] - if item and repr(item) not in items: + key = hash(repr(item)) + if item and key not in keys: attack_info.append(item) - items.add(repr(item)) + keys.add(key) if not attack_info: continue