Skip to content

Instantly share code, notes, and snippets.

@jonathanrodriguezs
Last active June 21, 2020 23:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonathanrodriguezs/bd0a8162f468ed7c703d863123f3a824 to your computer and use it in GitHub Desktop.
Save jonathanrodriguezs/bd0a8162f468ed7c703d863123f3a824 to your computer and use it in GitHub Desktop.
#!usr/bin/python
import sys
import hashlib
pass_found = False
input_hash = sys.argv[1]
pass_doc = sys.argv[2]
try:
pass_file = open(pass_doc, 'r')
except:
print("* Can't open dictionary")
quit()
for word in pass_file:
enc_word = word.encode('utf-8')
hash_word = hashlib.md5(enc_word.strip())
digest = hash_word.hexdigest()
if digest == input_hash:
print("+ Password found: ", word)
pass_found = True
break
if not pass_found:
print("* Password is not found in the dictionary")
@jonathanrodriguezs
Copy link
Author

jonathanrodriguezs commented Jun 21, 2020

$ python dictionary-password.py df53ca268240ca76670c8566ee54568a passwords.txt

@jonathanrodriguezs
Copy link
Author

jonathanrodriguezs commented Jun 21, 2020

Suggested dictionaries to test: https://github.com/danielmiessler/SecLists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment