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

Skip to content

Commit 9d31230

Browse files
committed
minor update
1 parent d64c0af commit 9d31230

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

lib/utils/hash.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ def dictionaryAttack(attack_dict):
474474
logger.info(infoMsg)
475475

476476
for hash_regex in hash_regexes:
477-
items = set()
477+
keys = set()
478478
attack_info = []
479479

480480
for (user, hashes) in attack_dict.items():
@@ -498,9 +498,10 @@ def dictionaryAttack(attack_dict):
498498
elif hash_regex in (HASH.CRYPT_GENERIC):
499499
item = [(user, hash_), {'salt': hash_[0:2]}]
500500

501-
if item and repr(item) not in items:
501+
key = hash(repr(item))
502+
if item and key not in keys:
502503
attack_info.append(item)
503-
items.add(repr(item))
504+
keys.add(key)
504505

505506
if not attack_info:
506507
continue

0 commit comments

Comments
 (0)