From 23ccc078cfdc5eca8fbce158b67623518823972e Mon Sep 17 00:00:00 2001 From: Justin Bollinger Date: Wed, 5 Aug 2020 11:41:47 -0400 Subject: [PATCH] redesigned for increased performance in large datasets --- hate_crack.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/hate_crack.py b/hate_crack.py index 49aa6b6..5e33c75 100755 --- a/hate_crack.py +++ b/hate_crack.py @@ -835,13 +835,19 @@ def hcatRecycle(hcatHashType, hcatHashFile, hcatNewPasswords): # creating the combined output for pwdformat + cleartext def combine_ntlm_output(): + hashes = {} + with open(hcatHashFile + ".out", "r") as hcatCrackedFile: + for crackedLine in hcatCrackedFile: + hash, password = crackedLine.split(':') + hashes[hash] = password.rstrip() with open(hcatHashFileOrig + ".out", "w+") as hcatCombinedHashes: - with open(hcatHashFile + ".out", "r") as hcatCrackedFile: - for crackedLine in hcatCrackedFile: - with open(hcatHashFileOrig, "r") as hcatOrigFile: - for origLine in hcatOrigFile: - if crackedLine.split(":")[0] == origLine.split(":")[3]: - hcatCombinedHashes.write(origLine.strip() + crackedLine.split(":")[1]) + with open(hcatHashFileOrig, "r") as hcatOrigFile: + for origLine in hcatOrigFile: + if origLine.split(':')[3] in hashes: + password = hashes[origLine.split(':')[3]] + hcatCombinedHashes.write(origLine.strip() + ' ' + password+'\n') + else: + hcatCombinedHashes.write(origLine) # Cleanup Temp Files def cleanup():