Walkthrough: Evilbox One

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.

Port Scanning

We start by identifying open ports on the target machine:

nmap 192.168.1.X -sV -sC -oN nmap.output

The scan reveals port 80 (HTTP) and port 22 (SSH).

Directory Fuzzing

Using Gobuster to discover hidden directories:

gobuster dir -u http://192.168.X.X -w /usr/share/wordlists/dirb/common.txt

We discover a directory named /secret.

Parameter Fuzzing & LFI

We find evil.php inside the secret directory and fuzz for parameters to find a Local File Inclusion (LFI) vulnerability:

ffuf -u http://192.168.X.X/secret/evil.php?FUZZ=/etc/passwd -w /usr/share/wordlists/dirbuster/directory-list-2.3-small.txt -fs 0

This confirms the user mowree exists. We then use the LFI to grab their private SSH key from /home/mowree/.ssh/id_rsa.

Cracking the SSH Key

To crack the SSH key passphrase, we use John the Ripper:

  1. Save the key as id_rsa and run chmod 600 id_rsa.
  2. Convert to hash: ssh2john id_rsa > crack.hash
  3. Crack it: sudo john crack.hash --wordlist=/usr/share/wordlists/rockyou.txt

Privilege Escalation

After logging in as mowree, we find we have write permissions to /etc/passwd. We generate a new root-level password hash:

openssl passwd -1 -salt root pass123

By adding a new user entry to /etc/passwd with UID 0, we gain root access.

Conclusion

Evilbox One is a great lesson in LFI and insecure file permissions. Gain initial access via web fuzzing and escalate via misconfigured system files.