From 23213fd5b694c193b8f8d39e631fae6c0e57ee5d Mon Sep 17 00:00:00 2001 From: Justin Bollinger Date: Tue, 1 Sep 2020 11:15:04 -0400 Subject: [PATCH] Additional check for potfile entries --- hate_crack.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/hate_crack.py b/hate_crack.py index 160152d..fbbc12c 100755 --- a/hate_crack.py +++ b/hate_crack.py @@ -911,9 +911,25 @@ def hcatRecycle(hcatHashType, hcatHashFile, hcatNewPasswords): except KeyboardInterrupt: hcatProcess.kill() +def check_potfile(): + print("Checking POT file for already cracked hashes...") + subprocess.Popen( + "{hcatBin} --show --potfile-path={hate_path}/hashcat.pot -m {hash_type} {hash_file} > {hate_path}/{hash_file}.out".format( + hcatBin=hcatBin, + hash_type=hcatHashType, + hash_file=hcatHashFile, + hate_path=hate_path), shell=True) + hcatHashCracked = lineCount(hcatHashFile + ".out") + if hcatHashCracked > 0: + print("Found %d hashes already cracked.\nCopied hashes to %s.out" % (hcatHashCracked, hcatHashFile)) + else: + print("No hashes found in POT file.") + + # creating the combined output for pwdformat + cleartext def combine_ntlm_output(): hashes = {} + check_potfile() with open(hcatHashFile + ".out", "r") as hcatCrackedFile: for crackedLine in hcatCrackedFile: hash, password = crackedLine.split(':')