Welcome! In this article, we look at the walkthrough of the Evilbox One Capture the Flag (CTF). We will cover initial port scanning, enumeration, directory traversal, SSH key cracking, and privilege escalation to the root user.
We start by identifying open ports on the target machine:
The scan reveals port 80 (HTTP) and port 22 (SSH).
Using Gobuster to discover hidden directories:
We discover a directory named /secret.
We find evil.php inside the secret directory and fuzz for parameters to find a Local File Inclusion (LFI) vulnerability:
This confirms the user mowree exists. We then use the LFI to grab their private SSH key from /home/mowree/.ssh/id_rsa.
To crack the SSH key passphrase, we use John the Ripper:
id_rsa and run chmod 600 id_rsa.ssh2john id_rsa > crack.hashsudo john crack.hash --wordlist=/usr/share/wordlists/rockyou.txtAfter logging in as mowree, we find we have write permissions to /etc/passwd. We generate a new root-level password hash:
By adding a new user entry to /etc/passwd with UID 0, we gain root access.
Evilbox One is a great lesson in LFI and insecure file permissions. Gain initial access via web fuzzing and escalate via misconfigured system files.