/pentest:mksfrom pentest
Provides URL resolution, REST endpoint patterns, response parsing, error handling, and fallback rules for MKS-backed Kali tools. Use when automating Kali tool execution via a Metasploit-Kali Server.
Ships in pentest. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Run once at phase start and store as MKS_URL:
MKS_URL=$(cat .pentest-mks.json 2>/dev/null | jq -r '.url // empty')
Some server builds have a defect where the structured /api/tools/* endpoints (and /health) crash
when the command is constructed as an argv list — every structured tool call returns an error like
CommandExecutor expects a string, but got list, and the tools appear unusable even though they are
installed. The generic POST /api/command endpoint (raw command string) is unaffected.
Probe once and set MKS_TOOLS_MODE:
PROBE=$(curl -s -m 20 -X POST "$MKS_URL/api/tools/nmap" \
-H "Content-Type: application/json" \
-d "{\"target\":\"127.0.0.1\",\"scan_type\":\"-sn\",\"additional_args\":\"-Pn\"}")
if echo "$PROBE" | grep -qiE 'got list|expects a string|TypeError|Internal Server Error|got a list'; then
MKS_TOOLS_MODE="command" # structured endpoints are broken on this server → route via /api/command
else
MKS_TOOLS_MODE="structured" # structured endpoints work → use /api/tools/* as documented
fi
MKS_TOOLS_MODE="structured" → use the /api/tools/{tool} endpoints in the Endpoints section.MKS_TOOLS_MODE="command" → use the /api/command fallback (see that section) for every tool.Log the result: {"action":"mks-capability-probe","tools_mode":"<structured|command>"}.
Security note for
commandmode:/api/commandruns the string in a shell (shell=True-style), so it is injection-prone if any target/argument is attacker-controlled. In a pentest the target and args are operator-controlled against the operator's own Kali host, so this is an acceptable bridge — but never interpolate untrusted scan output back into an/api/commandstring. The structured endpoints are the safer design; prefer them whenever the probe says they work.
Every MKS tool endpoint returns JSON:
{ "output": "<raw tool stdout>", "error": "<stderr or empty string>" }
Parsing pattern (apply after every MKS curl call):
RESPONSE=$(curl -s -m TIMEOUT -X POST "$MKS_URL/api/tools/TOOL" \
-H "Content-Type: application/json" \
-d 'PAYLOAD')
RESULT=$(echo "$RESPONSE" | jq -r '.output // empty')
ERR=$(echo "$RESPONSE" | jq -r '.error // empty')
Replace TIMEOUT, TOOL, and PAYLOAD with values from the endpoint sections below.
If a structured /api/tools/{tool} call fails — RESULT empty, OR the response contains
got list / expects a string / TypeError / Internal Server Error (the list-vs-string defect):
/api/command (the raw-string endpoint — see the next section), not straight
to local Bash. This recovers the tool when only the structured endpoint is broken. Log:
{"timestamp":"...","agent":"<agent-name>","action":"mks-fallback","tool":"<tool-name>","from":"structured","to":"command","reason":"<empty-response|type-error>"}
/api/command also fails (or MKS_URL is empty), fall back to the local Bash
equivalent documented in the agent workflow. Log "to":"local-bash".If Step 0.5 already set MKS_TOOLS_MODE="command", skip the structured call entirely and go straight
to /api/command for every tool.
The generic endpoint takes a full command string and is unaffected by the list-vs-string defect.
Request / response shape (different from /api/tools/*):
RESPONSE=$(curl -s -m TIMEOUT -X POST "$MKS_URL/api/command" \
-H "Content-Type: application/json" \
-d "{\"command\":\"<full command string>\"}")
RESULT=$(echo "$RESPONSE" | jq -r '.stdout // empty')
RC=$(echo "$RESPONSE" | jq -r '.return_code // empty') # 0 = success; .success is also returned
Equivalent command string per tool (build the same invocation the structured endpoint would run):
| Tool | /api/command string |
|---|---|
| nmap | nmap <scan_type> <ports?> <additional_args> <target> (e.g. nmap -sS -p- --min-rate 10000 -T4 -Pn $TARGET) |
| gobuster | gobuster dir -u $TARGET -w /usr/share/wordlists/dirb/common.txt -b 404 |
| dirb | dirb $TARGET /usr/share/wordlists/dirb/common.txt |
| nikto | nikto -h $TARGET |
| sqlmap | sqlmap -u "$TARGET_URL" --batch --level=3 --risk=2 (add --data="$POST_DATA" for POST) |
| hydra | hydra -L <user_file> -P /usr/share/wordlists/rockyou.txt $TARGET $SERVICE |
| john | john --wordlist=/usr/share/wordlists/rockyou.txt --format=$HASH_FORMAT $HASH_FILE |
| metasploit | msfconsole -q -x "use $MODULE_PATH; set RHOSTS $TARGET; set RPORT $PORT; run; exit" |
Quote $TARGET_URL and any value containing shell metacharacters. Re-read the Step 0.5 security note
before interpolating anything into these strings.
Verifying a tool is installed (use this instead of trusting /health):
WHICH=$(curl -s -m 10 -X POST "$MKS_URL/api/command" -H "Content-Type: application/json" \
-d "{\"command\":\"which <tool>\"}")
echo "$WHICH" | jq -r '.stdout // empty' # non-empty path = installed
Used by: domain-assessment, cve-tester
SYN scan (full port, fast):
curl -s -m 120 -X POST "$MKS_URL/api/tools/nmap" \
-H "Content-Type: application/json" \
-d "{\"target\":\"$TARGET\",\"scan_type\":\"-sS\",\"additional_args\":\"-p- --min-rate 10000 -T4 -Pn\"}"
Service and version enumeration:
curl -s -m 120 -X POST "$MKS_URL/api/tools/nmap" \
-H "Content-Type: application/json" \
-d "{\"target\":\"$TARGET\",\"scan_type\":\"-sV -sC\",\"ports\":\"$OPEN_PORTS\",\"additional_args\":\"-T4 -Pn\"}"
Version fingerprinting (for CVE research):
curl -s -m 120 -X POST "$MKS_URL/api/tools/nmap" \
-H "Content-Type: application/json" \
-d "{\"target\":\"$TARGET\",\"scan_type\":\"-sV\",\"ports\":\"80,443,8080,8443\",\"additional_args\":\"--version-intensity 9\"}"
Used by: inventory-directory-scanner
curl -s -m 300 -X POST "$MKS_URL/api/tools/gobuster" \
-H "Content-Type: application/json" \
-d "{\"url\":\"$TARGET\",\"mode\":\"dir\",\"wordlist\":\"/usr/share/wordlists/dirb/common.txt\",\"additional_args\":\"-b 404\"}"
Used by: inventory-directory-scanner
curl -s -m 300 -X POST "$MKS_URL/api/tools/dirb" \
-H "Content-Type: application/json" \
-d "{\"url\":\"$TARGET\",\"wordlist\":\"/usr/share/wordlists/dirb/common.txt\"}"
Used by: inventory-directory-scanner
curl -s -m 300 -X POST "$MKS_URL/api/tools/nikto" \
-H "Content-Type: application/json" \
-d "{\"target\":\"$TARGET\"}"
Used by: injection-tester, pentester-executor
GET parameter:
curl -s -m 300 -X POST "$MKS_URL/api/tools/sqlmap" \
-H "Content-Type: application/json" \
-d "{\"url\":\"$TARGET_URL\",\"additional_args\":\"--batch --level=3 --risk=2\"}"
POST parameter:
curl -s -m 300 -X POST "$MKS_URL/api/tools/sqlmap" \
-H "Content-Type: application/json" \
-d "{\"url\":\"$TARGET_URL\",\"data\":\"$POST_DATA\",\"additional_args\":\"--batch --level=3 --risk=2\"}"
Used by: pentester-executor
curl -s -m 300 -X POST "$MKS_URL/api/tools/hydra" \
-H "Content-Type: application/json" \
-d "{\"target\":\"$TARGET\",\"service\":\"$SERVICE\",\"username_file\":\"/usr/share/seclists/Usernames/top-usernames-shortlist.txt\",\"password_file\":\"/usr/share/wordlists/rockyou.txt\"}"
Used by: pentester-executor
curl -s -m 300 -X POST "$MKS_URL/api/tools/john" \
-H "Content-Type: application/json" \
-d "{\"hash_file\":\"$HASH_FILE\",\"wordlist\":\"/usr/share/wordlists/rockyou.txt\",\"format\":\"$HASH_FORMAT\"}"
Used by: pentester-executor, pentester-orchestrator (Phase 5)
Requires operator approval before use (Phase 3 gate).
curl -s -m 300 -X POST "$MKS_URL/api/tools/metasploit" \
-H "Content-Type: application/json" \
-d "{\"module\":\"$MODULE_PATH\",\"options\":{\"RHOSTS\":\"$TARGET\",\"RPORT\":\"$PORT\"}}"
MKS is a REST API. Always invoke via curl -X POST {url}/api/tools/{tool} from Bash. Never invoke MKS tools as MCP tools.
What SKILL.md sets; muted values are Claude Code's defaults
7 skills in this plugin
/authenticatingAuthentication testing skill - automates signup, login, 2FA bypass, CAPTCHA solving, and bot detection evasion using Playwright MCP. Tests authentication security controls. Includes behavioral biometrics simulation, OTP handling, and automated account creation for security assessments./common-appsec-patternsApplication security testing coordinator for common vulnerability patterns including XSS, injection flaws, and client-side security issues. Orchestrates specialized testing agents to identify and validate common application security weaknesses./cve-testingCVE vulnerability testing coordinator that identifies technology stacks, researches known vulnerabilities, and tests applications for exploitable CVEs using public exploits and proof-of-concept code./domain-assessmentDomain reconnaissance coordinator that orchestrates subdomain discovery and port scanning to build comprehensive domain attack surface inventory/pentestPenetration testing orchestrator that coordinates specialized attack agents. Provides attack indexes, methodology frameworks, and documentation. Execution delegated to specialized agents (SQL Injection, XSS, SSRF, etc.). Use for engagement planning and attack coordination./web-application-mappingComprehensive web application reconnaissance and mapping coordinator that orchestrates passive browsing, active endpoint discovery, attack surface analysis, and headless browser automation for complete application coverage.npx claudepluginhub stickman230/claude-pentest --plugin pentestOther plugins' skills for the same job