From cf8e5d535d064cd5add71837f269a10255c3bb6d Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 4 Feb 2013 20:15:44 +0100 Subject: [PATCH] Minor cleanup --- lib/utils/hash.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/utils/hash.py b/lib/utils/hash.py index a3927235b..d0c2379e1 100644 --- a/lib/utils/hash.py +++ b/lib/utils/hash.py @@ -340,11 +340,9 @@ def attackCachedUsersPasswords(): for user in kb.data.cachedUsersPasswords.keys(): for i in xrange(len(kb.data.cachedUsersPasswords[user])): - _ = kb.data.cachedUsersPasswords[user][i] - if _: - hash_ = _.split()[0].lower() - if hash_ in lut and "clear-text password" not in _: - kb.data.cachedUsersPasswords[user][i] += "%s clear-text password: %s" % ('\n' if kb.data.cachedUsersPasswords[user][i][-1] != '\n' else '', lut[hash_]) + value = kb.data.cachedUsersPasswords[user][i].lower() + if value in lut and "clear-text password" not in value: + kb.data.cachedUsersPasswords[user][i] += "%s clear-text password: %s" % ('\n' if kb.data.cachedUsersPasswords[user][i][-1] != '\n' else '', lut[value]) def attackDumpedTable(): if kb.data.dumpedTable: