Created
April 15, 2019 13:56
-
-
Save chrismaddalena/03605ad5115f754d4a553217917fb895 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_hashes(hash_file): | |
"""Process the hashes in the provided file and return a dictionary.""" | |
# Create hashes of the hashes, lol | |
with open(hash_file, 'r') as hash_dump: | |
hashes = {} | |
for line in hash_dump: | |
# Ignore machine accounts | |
if not '$' in line: | |
# Separate DOMAIN\USER from NTLM and USER from DOMAIN | |
array = line.split(':::') | |
username = array[0].split('\\')[1] | |
# Ignore the empty/no password NTLM hash | |
if not array[1] == '31d6cfe0d16ae931b73c59d7e0c089c0': | |
hashes[username] = array[1].strip() | |
return hashes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment