- Machine
- Compromised
- OS
- Linux
- Difficulty
- Hard
- Steps
- 7
- Added
- 23 Mar 2023
A leaked backup and a hidden log give admin creds; a LiteCart upload and a disable_functions bypass give a shell, then a MySQL UDF and a backdoored PAM lead to root.
How it went
- 0nmap
An nmap scan shows a LiteCart e-commerce site on port 80.
- 1Nikto backup
Nikto finds a site backup archive; a config file inside leaks database credentials and the admin email.
- 2hidden .log
A comment in the login source points to a hidden .log file that stores the admin credentials in cleartext.
- 3LiteCart upload
LiteCart 2.1.2's authenticated upload, with a Content-Type bypass, places a webshell, though most PHP functions are disabled.
- 4disable_functions
A PHP disable_functions bypass restores code execution as www-data.
- 5MySQL UDF
A malicious exec_cmd function planted in MySQL runs commands as the mysql account; an SSH key written to its authorized_keys gives a shell.
- 6sysadmin
Password-change history in mysql's home reveals the sysadmin password for an SSH login and the user flag.
- 7PAM backdoor
A backdoored pam_unix.so holds a hardcoded password; recovering it from the binary gives root over su.