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

Potato

Platform: Proving Grounds · Difficulty: Easy

Reconnaissance

I used RustScan to identify open ports.

2023-08-19_19-19.png

The scan found three open ports. I followed up with service detection to identify them.

Service enumeration

Nmap identified the services and versions on the open ports.2023-08-19_19-21.png

The results showed SSH, HTTP, and an FTP service on port 2112. The FTP listing suggested files available for inspection.

FTP enumeration

The service accepted anonymous authentication on port 2112 with anonymous/anonymous. 2023-08-19_19-24.png

I listed the FTP directory.2023-08-19_19-27.png

I downloaded the available files with mget * and inspected them locally.2023-08-19_19-29.png

welcome.msg did not advance the investigation. The index.php.bak backup exposed PHP login logic, including the username admin and a $pass variable. The backup offered a basis for testing the live login form.

Web enumeration

The HTTP landing page displayed “Potato Company.” 2023-08-19_19-30.png

I performed directory discovery to find additional routes.

2023-08-19_19-40.png

The scan found /admin, which presented a login form.

2023-08-19_19-41.png

The admin/admin attempt failed. The form behavior was consistent with the login logic exposed in the backup.spaces_-MFlgUPYI8q83vG2IJpI_uploads_git-blob-606ec3161be6b892cfe9a8dccf020d926b6dff7f_image.png

2023-08-20_09-56.png

The PHP source indicated that the password could change. I tested whether the password comparison could be bypassed by sending an unexpected input type.

Authentication bypass

I intercepted the login request with Burp Suite.

2023-08-19_19-48.png

I modified the password parameter to send an array value and submitted the request. The exact wire representation is visible in the screenshot below.

2023-08-19_19-51.png

The modified request granted access to the administrative interface. 2023-08-19_19-54.png

I examined the logs feature. 2023-08-19_19-57.png

I tested whether the file path was restricted to the intended log directory by requesting /etc/passwd through traversal.

2023-08-19_19-58.png

The response confirmed path traversal and exposed the webadmin account and a password hash.

2023-08-19_20-21.png

I saved the hash and tested it with John the Ripper using the rockyou wordlist.

john --wordlist=/usr/share/wordlists/rockyou.txt hashfile

2023-08-19_21-37.png

SSH access

The recovered password provided SSH access as webadmin.

2023-08-19_21-36.png

I listed the user directory to locate the first flag.2023-08-19_21-38.png

The user flag was present there.

Privilege escalation

I checked sudo -l and continued enumerating local execution paths.

2023-08-19_21-46.png

The first GTFOBins technique failed. I then used the permitted execution path shown in the screenshot with a shell script named comrade.sh containing /bin/bash. This returned a root shell, from which I retrieved the final flag. The precise sudo rule should be checked against the screenshot before treating this as a reproducible procedure.

Outcome

Anonymous FTP exposed source code; the login comparison was bypassed; and path traversal exposed a password hash used for SSH access. The local execution path led to the root flag.