1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import subprocess def crackear_con_john(hash_file, wordlist): try: # Ejecutar John the Ripper desde la línea de comandos comando = f"john --format=FORMATO_HASH --wordlist={wordlist} {hash_file}" resultado = subprocess.run(comando, shell=True, capture_output=True, text=True) # Mostrar la salida de John the Ripper print("Resultado de John the Ripper:") print(resultado.stdout) except Exception as e: print("Error al ejecutar John the Ripper:", e) # Reemplaza 'FORMATO_HASH', 'hash_file' y 'wordlist' con los valores apropiados formato_hash = 'md5' # Ajusta el formato del hash según tu caso archivo_hash = 'ruta/al/archivo_de_hashes.txt' # Ruta al archivo que contiene los hashes archivo_wordlist = 'ruta/a/tu/wordlist.txt' # Ruta a tu archivo de wordlist crackear_con_john(archivo_hash, archivo_wordlist) |