File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -312,15 +312,23 @@ def storeHashesToFile(attack_dict):
312312 warnMsg += "for eventual further processing with other tools"
313313 logger .warn (warnMsg )
314314
315+ items = set ()
316+
315317 with open (filename , "w+" ) as f :
316318 for user , hashes in attack_dict .items ():
317319 for hash_ in hashes :
318320 if not hash_ or hash_ == NULL or not hashRecognition (hash_ ):
319321 continue
322+
323+ item = None
320324 if user and not user .startswith (DUMMY_USER_PREFIX ):
321- f . write ( "%s:%s\n " % (user .encode (UNICODE_ENCODING ), hash_ .encode (UNICODE_ENCODING ) ))
325+ item = "%s:%s\n " % (user .encode (UNICODE_ENCODING ), hash_ .encode (UNICODE_ENCODING ))
322326 else :
323- f .write ("%s\n " % hash_ .encode (UNICODE_ENCODING ))
327+ item = "%s\n " % hash_ .encode (UNICODE_ENCODING )
328+
329+ if item and item not in items :
330+ f .write (item )
331+ items .add (item )
324332
325333def attackCachedUsersPasswords ():
326334 if kb .data .cachedUsersPasswords :
You can’t perform that action at this time.
0 commit comments