Overview
Nibbles is an easy HackTheBox Linux machine running Nibbleblog 4.0.3, a blogging platform hidden behind a mostly blank landing page whose source code gives away its location. Default administrative credentials grant access to the admin panel, and CVE-2015-6967, a known arbitrary file upload vulnerability in this version, is exploited manually to plant a PHP webshell and get a reverse shell. Privilege escalation is a straightforward case of a sudo-permitted script also being writable by the same user, letting a root user be created outright.
Attack Chain
- Scan the target and identify
SSHandHTTP - Find a mostly blank landing page and locate
/nibbleblogin the page source - Fuzz
/nibbleblogand confirm it’s runningNibbleblog 4.0.3via itsREADME - Log in to the admin panel with default credentials,
admin:nibbles - Identify
CVE-2015-6967, an authenticated arbitrary file upload vulnerability affecting this version - Manually exploit the vulnerability to upload a PHP webshell to a predictable plugin path
- Trigger the webshell and use an
nc mkfiforeverse shell payload to catch a shell - Read the user flag
- Find a
sudo-permitted script,monitor.sh, that’s also writable by the current user - Edit the script to add a new root-equivalent user
- Run the script with
sudoto trigger the edit, then switch to the new user - Read the root flag
Enumeration
Port Scanning
We start by defining the target and running a full TCP port scan.
export IP=10.129.215.169; export NAME=NIBBLES; echo $IP; echo $NAME; ping $IP -c 1
nmap --min-rate 4500 --max-rtt-timeout 1500ms $IP -Pn -p- -v -oA scans/nmap_allports_$NAME
The open TCP ports are:
22,80
We export the discovered ports and run a service and version scan.
ports=$(cat scans/nmap_allports_$NAME.nmap | grep '^[0-9]' | cut -d '/' -f 1 | tr '\n' ',' | sed s/,$//); echo $ports
nmap $IP -p$ports -sC -sV -oA scans/nmap_initial_$NAME -v

Web Enumeration
Finding Nibbleblog
Browsing to port 80 shows a basic text page with nothing else.

We look at the source code and find a new endpoint, /nibbleblog.

We fuzz the site.
dirsearch -u http://$IP:$PORT/nibbleblog -t 100 -o ./scans/dirsearch_${NAME}_${PORT}_nibble_default.txt
We find a few endpoints.

/nibbleblog is a basic blogging setup.

We view the /README endpoint and find the version, Nibbleblog 4.0.3.

/admin.php is a login portal.

We’re able to log in with default credentials, admin:nibbles.

Foothold
Exploiting CVE-2015-6967
CVE-2015-6967 is an arbitrary file upload vulnerability affecting Nibbleblog 4.0.3:
https://nvd.nist.gov/vuln/detail/CVE-2015-6967
According to the advisory, we can upload a malicious PHP file to /content/private/plugins/my_image/image.php. Public exploits exist, but we do it manually.


We navigate to /nibbleblog/content/private/plugins/my_image/image.php and have a webshell.

Reverse Shell
We use an nc mkfifo reverse shell payload.

We catch our shell on port 443 with penelope.

We read the user flag.

Privilege Escalation
An Editable Sudo Script
We check our privileges with sudo -l.
We can run /home/nibbler/personal/stuff/monitor.sh as root.

We’re able to edit the script.

We edit it to add a new root-equivalent user.
useradd -o -u 0 -s /bin/bash toor ; echo toor:toor | chpasswd

We execute the script through sudo. A few error messages appear, but they don’t concern us.

We check /etc/passwd and see our toor user was added.

We switch to our new root user.

We read the root flag.

Key Takeaways
Nibbles is a clean demonstration of two everyday mistakes. Default administrative credentials on a self-hosted application are effectively no authentication at all once discovered, and they immediately opened the door to a documented, unpatched file upload vulnerability. The privilege escalation is even simpler: granting sudo access to a script only provides a meaningful security boundary if that same script is also protected from modification by the user running it, here, both conditions were controlled by the same low-privileged account, collapsing the intended privilege separation entirely.