import pyAesCrypt
import sys
import os
# --- Configuration ---
encrypted_file = "/home/rufo/content/web_20250806_120723.zip.aes"
output_file = "web_data.zip"
wordlist_path = "/usr/share/wordlists/rockyou.txt"
bufferSize = 64 * 1024
# ---------------------
print(f"[*] Iniciando ataque de fuerza bruta contra {encrypted_file}")
print(f"[*] Usando wordlist: {wordlist_path}\n")
if not os.path.exists(wordlist_path):
print(f"[ERROR] ¡Wordlist no encontrada en la ruta especificada! Revisa: {wordlist_path}")
sys.exit(1)
try:
with open(wordlist_path, 'r', encoding='latin-1') as f:
for i, line in enumerate(f):
password = line.strip()
if not password:
continue
if (i + 1) % 1000 == 0 or i < 10:
print(f"[>] Probando intento #{i + 1}: {password}", end='\r')
try:
# Try decrypt
pyAesCrypt.decryptFile(encrypted_file, output_file, password, bufferSize)
# Its correct
print(f"\n[+] Password fount!!: {password}")
print(f"[+] File output save as : {output_file}")
print(f"[*] Next step: unzip {output_file} to check the content.")
sys.exit(0)
except ValueError:
continue
except Exception as e:
print(f"\n[!] Error with password {password}: {e}")
continue
print("\n[-] Password not found in rockyou.")
except KeyboardInterrupt:
print("\n[!] Pause.")
sys.exit(1)
except Exception as e:
print(f"\n[!!] Error: {e}")
sys.exit(1)