fix: only report combined output file when it exists

cleanup() previously always printed 'Cracked passwords combined in
X.out' even when combine_ntlm_output() returned early (no cracked
hashes) or the hash type wasn't NTLM pwdump. Now checks file
existence first and falls back to pointing at the raw .out file.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Justin Bollinger
2026-04-08 13:05:08 -04:00
parent 13a1f9e28c
commit 0a9549b15a

View File

@@ -2988,10 +2988,11 @@ def cleanup():
if hcatHashType == "1000" and pwdump_format:
print("\nComparing cracked hashes to original file...")
combine_ntlm_output()
print(
"\nCracked passwords combined with original hashes in %s"
% (hcatHashFileOrig + ".out")
)
out_path = hcatHashFileOrig + ".out"
if os.path.isfile(out_path):
print(f"\nCracked passwords combined with original hashes in {out_path}")
else:
print(f"\nNo cracked hashes to combine. Raw output (if any): {hcatHashFile}.out")
print("\nCleaning up temporary files...")
if os.path.exists(hcatHashFile + ".masks"):
os.remove(hcatHashFile + ".masks")