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

Skip to content

Commit 8138d13

Browse files
committed
Minor fix
1 parent cbb5c79 commit 8138d13

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

lib/utils/hash.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -317,18 +317,17 @@ def storeHashesToFile(attack_dict):
317317
with open(filename, "w+") as f:
318318
for user, hashes in attack_dict.items():
319319
for hash_ in hashes:
320-
if not hash_ or hash_ == NULL or not hashRecognition(hash_):
321-
continue
322-
323-
item = None
324-
if user and not user.startswith(DUMMY_USER_PREFIX):
325-
item = "%s:%s\n" % (user.encode(UNICODE_ENCODING), hash_.encode(UNICODE_ENCODING))
326-
else:
327-
item = "%s\n" % hash_.encode(UNICODE_ENCODING)
320+
hash_ = hash_.split()[0] if hash_ else hash_
321+
if hash_ and hash_ != NULL and hashRecognition(hash_):
322+
item = None
323+
if user and not user.startswith(DUMMY_USER_PREFIX):
324+
item = "%s:%s\n" % (user.encode(UNICODE_ENCODING), hash_.encode(UNICODE_ENCODING))
325+
else:
326+
item = "%s\n" % hash_.encode(UNICODE_ENCODING)
328327

329-
if item and item not in items:
330-
f.write(item)
331-
items.add(item)
328+
if item and item not in items:
329+
f.write(item)
330+
items.add(item)
332331

333332
def attackCachedUsersPasswords():
334333
if kb.data.cachedUsersPasswords:

0 commit comments

Comments
 (0)