From a1203ccb343703ba5ae522254f75b6384a1831a7 Mon Sep 17 00:00:00 2001 From: jerome Date: Mon, 18 Dec 2023 00:02:09 +0100 Subject: =?UTF-8?q?dep=C3=B4t=20initial?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crack_hash.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 crack_hash.py (limited to 'crack_hash.py') diff --git a/crack_hash.py b/crack_hash.py new file mode 100644 index 0000000..a8ade90 --- /dev/null +++ b/crack_hash.py @@ -0,0 +1,20 @@ +import sys +import hashlib + +def crack_hash(hash,wordlist,hashsum) : + """ + Args: + hash : le hash à craquer + wordlist : la wordlist à utiliser + hashsum : md5 ou sha256 ou sha512... + """ + with open(wordlist,"r") as fichier: + lignes = fichier.readlines() + for ligne in lignes: + #if hashlib.md5(ligne.strip().encode()).hexdigest() == hash: + if getattr(hashlib, hashsum)(ligne.strip().encode()).hexdigest() == hash : + print(f"trouvé : {ligne}") + exit() + +if __name__ == "__main__": + crack_hash(sys.argv[1],sys.argv[2],sys.argv[3]) -- cgit v1.2.3