Skip to content

Instantly share code, notes, and snippets.

@ryanvillarreal
Created January 26, 2021 21:24
Show Gist options
  • Save ryanvillarreal/14bef844f68cd4617251d3a998554a1e to your computer and use it in GitHub Desktop.
Save ryanvillarreal/14bef844f68cd4617251d3a998554a1e to your computer and use it in GitHub Desktop.
Match SecretsDump File with Cracked File - Lots of Caveats here !use at your own risk
#!/usr/bin/python3
def dostuff():
outfile = open("matched.txt", "a")
og = open("./secretsdump.txt", 'r')
with open("./cracked.txt", 'r') as cracked:
for line in cracked:
hash_cracked = (line[:line.index(":")].strip())
password = (line[line.index(":"):].strip())
with open("./secretsdump.txt") as og:
for hash_uncracked in og:
# print(hash_cracked + " " + hash_uncracked)
og_hash = (hash_uncracked.split(':')[3])
username = (hash_uncracked.split(':')[0])
if og_hash in hash_cracked:
output_line = username + password + "\n"
outfile.write(output_line)
outfile.close()
if __name__ == "__main__":
dostuff()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment