From 9c1d1ca5d86199ad94851db97af86d69020a3ec4 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 26 Oct 2011 14:13:38 +0000 Subject: [PATCH] minor update --- lib/utils/hash.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/utils/hash.py b/lib/utils/hash.py index 951156f46..a4a609f6e 100644 --- a/lib/utils/hash.py +++ b/lib/utils/hash.py @@ -484,20 +484,21 @@ def dictionaryAttack(attack_dict): hash_ = hash_.split()[0].lower() if getCompiledRegex(hash_regex).match(hash_): + item = None + if hash_regex in (HASH.MYSQL, HASH.MYSQL_OLD, HASH.MD5_GENERIC, HASH.SHA1_GENERIC): - attack_info.append([(user, hash_), {}]) - + item = [(user, hash_), {}] elif hash_regex in (HASH.ORACLE_OLD, HASH.POSTGRES): - attack_info.append([(user, hash_), {'username': user}]) - + item = [(user, hash_), {'username': user}] elif hash_regex in (HASH.ORACLE): - attack_info.append([(user, hash_), {'salt': hash_[-20:]}]) - + item = [(user, hash_), {'salt': hash_[-20:]}] elif hash_regex in (HASH.MSSQL, HASH.MSSQL_OLD): - attack_info.append([(user, hash_), {'salt': hash_[6:14]}]) - + item = [(user, hash_), {'salt': hash_[6:14]}] elif hash_regex in (HASH.CRYPT_GENERIC): - attack_info.append([(user, hash_), {'salt': hash_[0:2]}]) + item = [(user, hash_), {'salt': hash_[0:2]}] + + if item and item not in attack_info: + attack_info.append(item) if not attack_info: continue