Tried iamkingtheseus with sudo -l → failed (not a sudo/system password, just the DB password)
Pulling data out of MySQL without full DB access
MySQL client wasn’t installed, and installing it needed admin rights
Press enter or click to view image in full size
Rather than tunneling to the local-only MySQL port (3306) with something like Chisel, used mysqldump directly — works even as an unprivileged user if DB creds are valid:
sysinfo runs as root (SUID) → calls fdisk → resolves to the malicious /tmp/fdisk first (due to modified $PATH) → executes the reverse shell as root
✅ Root shell obtained → root flag captured
Press enter or click to view image in full size
7. Flags
Key Takeaways
Login SQLi is still worth trying first on custom PHP portfolio-style apps — it bypassed auth outright here.
Upload filters that only check the file extension can be beaten with a double extension (shell.php.png) when the server (Apache/PHP misconfig) still hands .php.* files to the PHP interpreter.
A leaked DB config file is often a password reuse goldmine — even if the DB password itself doesn’t work for sudo/SSH, dumping the app's own user table can hand you a second, more useful credential.
mysqldump with just a username/password/host can pull data over a local socket/port without needing a full interactive MySQL client installed — a handy alternative to port-forwarding tools like Chisel when you just need to read, not explore interactively.
strace/ltrace on a SUID binary is the standard way to spot relative-path child-process calls (popen, system, execve without /usr/bin/...) — classic PATH hijack setup: prepend a malicious script with the same name to $PATH before running the SUID binary.