diff options
| author | jerome <jerome@xlinfo.fr> | 2025-06-15 19:09:40 +0200 |
|---|---|---|
| committer | jerome <jerome@xlinfo.fr> | 2025-06-15 19:09:40 +0200 |
| commit | b6d1432307e4c69a2c8410228874600a20d67648 (patch) | |
| tree | 9a388ccb9f395cc656461403e4b557abae797dca /crack_md5.py | |
| parent | 0c36ccbf0383975dfccc2280646140c359f4d7b6 (diff) | |
| download | python-b6d1432307e4c69a2c8410228874600a20d67648.tar.gz python-b6d1432307e4c69a2c8410228874600a20d67648.zip | |
crack_md5
Diffstat (limited to 'crack_md5.py')
| -rw-r--r-- | crack_md5.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/crack_md5.py b/crack_md5.py new file mode 100644 index 0000000..00bac2b --- /dev/null +++ b/crack_md5.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python +"""crack_md5 module""" +import sys +import hashlib + +def crack_md5(hash, wordlist): + """ + Args: + hash : le hash à trouver + wordlist: le dictionnaire + """ + with open(wordlist, "r") as fichier: + lignes = fichier.readlines() + for ligne in lignes: + if hashlib.md5(ligne.strip().encode()).hexdigest() == hash.strip(): + print(f"trouvé: {ligne.strip()}") + break + +if __name__ == "__main__": + try: + crack_md5(sys.argv[1], sys.argv[2]) + except IndexError: + print(f"{sys.argv[0]} demande des arguments. Voir l'aide.") + |
