DevHub HackTheBox Writeup - Season11
SUMMARY
This write-up covers the DevHub machine from HackTheBox Season 11. Initial reconnaissance exposed an informational page on port 80 and a more interesting service on port 6274 running MCPJam v1.4.2, a Model Context Protocol inspector/server. This version is affected by CVE-2025-49596, an unauthenticated Remote Code Execution vulnerability in the MCP connection handler that accepts an arbitrary command and argument list when establishing a new server session. A crafted POST to /api/mcp/connect delivered an initial foothold as the user mcp-dev.
With a shell on the target, system enumeration revealed a second user, analyst, and a service bound to localhost on port 8888. Running pspy caught a Jupyter Server being launched as analyst, leaking its authentication token in the command line. A reverse port-forward made the local service reachable, and after working around the host-header check Jupyter enforces on localhost-bound listeners, the leaked token unlocked the full REST API. Abusing the /api/kernels endpoint, a Python kernel was spawned and code was sent through the multiplexed WebSocket channel, executing as analyst and delivering a second shell.
As analyst, an internal Flask application was discovered under /opt, exposing an admin API on port 5000 guarded by an X-API-Key header. Reading the source revealed an ops._admin_dump tool that returned the root user’s SSH private key as part of its dump payload. A single authenticated request to the endpoint extracted the key, which was then used to authenticate as root over SSH, completing the machine.
PATH TO FOLLOW
- Reconnaissance
- Port 80 - Informational Page Review
- Port 6274 - MCPJam v1.4.2 Fingerprinting
- CVE-2025-49596 - MCPJam Unauthenticated RCE
- Shell as mcp-dev
- Internal Enumeration & pspy - Jupyter Token Disclosure
- Reverse Port Forward & Host Header Bypass
- Jupyter /api/kernels Abuse via REST + WebSocket
- Shell as analyst
- Internal Flask API Discovery in /opt
- X-API-Key Authentication & ops._admin_dump Abuse
- Root SSH Private Key Extraction
- SSH as Root
CONTENT WILL BE RELEASED ONCE THE MACHINE IS RETIRED