Skip to content
AO.GitHub
← All write-ups
FIELD NOTES / PORTFOLIO

Evil-box

Platform: Proving Grounds · Difficulty: Easy

Reconnaissance

RustScan identified ports 22 and 80 as open.

Scan result

Service enumeration

I ran an Nmap scan with aggressive detection to identify services, versions, and operating system indicators.

Nmap scan

The scan identified Apache on port 80 and SSH on port 22.

The web server displayed the default Apache page.

Default Apache page

Directory discovery identified a /secret path containing evil.php.

Fuzzing result

The page did not show useful content, so I used Burp Suite Intruder to test parameter names and values with a cluster-bomb configuration.

BurpSuite intruder

A response-length difference identified a candidate parameter. Reading a local file through it confirmed local file inclusion (LFI).

LFI exploit

The parameter returned the contents of /etc/passwd.

passwd file

Initial access

SSH log poisoning and password guessing did not produce access. The LFI path did allow me to retrieve mowree’s private SSH key.

id_rsa found

The key was passphrase protected. I converted it to John the Ripper’s format with ssh2john.

ssh2john

John the Ripper recovered the key passphrase.

John the Ripper cracked the passphrase

I authenticated to SSH as mowree with the recovered key and passphrase.

SSH connection

Once inside, I found the first flag in the user’s directory.

Privilege escalation

LinPEAS highlighted that /etc/passwd was writable by the current user, a configuration that permitted alteration of local account records. I generated a password hash with openssl and added an account entry with UID 0 to /etc/passwd.

Privilege escalation

Switching to the new UID 0 account succeeded, allowing retrieval of the root flag.

Outcome

LFI exposed an SSH private key; a writable /etc/passwd file provided the route from user access to root.