Skip to content

Instantly share code, notes, and snippets.

@chrismaddalena
Created April 15, 2019 13:56
Show Gist options
  • Save chrismaddalena/5aa97aed92c87caa4f203d2b0a4c2b8d to your computer and use it in GitHub Desktop.
Save chrismaddalena/5aa97aed92c87caa4f203d2b0a4c2b8d to your computer and use it in GitHub Desktop.
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