Created
April 15, 2019 13:56
-
-
Save chrismaddalena/5aa97aed92c87caa4f203d2b0a4c2b8d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def process_potfile(hashcat_potfile): | |
"""Process the provided Hashcat potfile to return a dictionary of hash values and plaintext values.""" | |
with open(hashcat_potfile, 'r') as potfile: | |
potfile_hashes = {} | |
for line in potfile: | |
# This doesn't account for potfile entries for NTLMv2, etc. | |
array = line.split(':') | |
if len(array) > 2: | |
pass | |
else: | |
pass_hash = array[0] | |
plaintext = array[1].strip() | |
potfile_hashes[pass_hash] = plaintext | |
return potfile_hashes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment