File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6161from lib .core .settings import IS_WIN
6262from lib .core .settings import ITOA64
6363from lib .core .settings import ML
64+ from lib .core .settings import NULL
6465from lib .core .settings import UNICODE_ENCODING
6566from lib .core .settings import ROTATING_CHARS
6667from lib .core .wordlist import Wordlist
@@ -314,14 +315,15 @@ def storeHashesToFile(attack_dict):
314315 with open (filename , "w+" ) as f :
315316 for user , hashes in attack_dict .items ():
316317 for hash_ in hashes :
318+ if not hash_ or hash_ == NULL or not hashRecognition (hash_ ):
319+ continue
317320 if user and not user .startswith (DUMMY_USER_PREFIX ):
318321 f .write ("%s:%s\n " % (user .encode (UNICODE_ENCODING ), hash_ .encode (UNICODE_ENCODING )))
319322 else :
320323 f .write ("%s\n " % hash_ .encode (UNICODE_ENCODING ))
321324
322325def attackCachedUsersPasswords ():
323326 if kb .data .cachedUsersPasswords :
324- storeHashesToFile (kb .data .cachedUsersPasswords )
325327 results = dictionaryAttack (kb .data .cachedUsersPasswords )
326328
327329 for (_ , hash_ , password ) in results :
Original file line number Diff line number Diff line change 4040from lib .core .threads import getCurrentThreadData
4141from lib .request import inject
4242from lib .utils .hash import attackCachedUsersPasswords
43+ from lib .utils .hash import storeHashesToFile
4344from lib .utils .pivotdumptable import pivotDumpTable
4445
4546class Users :
@@ -300,6 +301,8 @@ def getPasswordHashes(self):
300301 for user in kb .data .cachedUsersPasswords :
301302 kb .data .cachedUsersPasswords [user ] = list (set (kb .data .cachedUsersPasswords [user ]))
302303
304+ storeHashesToFile (kb .data .cachedUsersPasswords )
305+
303306 message = "do you want to perform a dictionary-based attack "
304307 message += "against retrieved password hashes? [Y/n/q]"
305308 test = readInput (message , default = "Y" )
You can’t perform that action at this time.
0 commit comments