Decrypt an OpenSSL-encrypted file. The file was encrypted with openssl enc using a password.
Vulnerability
OpenSSL’s enc command uses EVP_BytesToKey for password derivation, which is relatively weak compared to modern key derivation functions. Common passwords can be cracked with a good wordlist.
Solution
Step 1: Identify the encryption
file encrypted_flag.encencrypted_flag.enc: openssl enc'd data with salted passwordStep 2: Convert to crackable format
openssl2john encrypted_flag.enc > hashStep 3: Crack the password
john hash --wordlist=rockyou.txtjohn --show hashencrypted_flag.enc:*7¡Vamos!The retained john --show line contains the complete password *7¡Vamos!; neither its prefix nor the non-ASCII punctuation may be dropped. UTF-8 bytes must be preserved. The salted header alone does not identify cipher, digest or whether PBKDF2 was used. AES-256-CBC is the recorded candidate below; the attachment and matching KDF settings are unavailable, so decryption has not been reproduced.
Step 4: Decrypt
printf '%s' '*7¡Vamos!' > password.txtopenssl enc -d -aes-256-cbc -in encrypted_flag.enc -pass file:password.txt -out flagFlag
247CTF{[flag redacted]}