← MCP server and skill grades

pentest-mcp

DMontgomery40/pentest-mcp

B
Type
MCP server
Scanned
Nov 17, 2026
Version
88984ab54a16
Files read
100

Pentest MCP is a penetration-testing server that lets an AI agent or researcher register authorized engagements, run security scanners and password crackers, record evidence, and draft reports. Because a local AI client can register its own engagement targets over stdio—and non-container Codex agent profiles leave shell execution, network access, and worker data writes enabled—a prompt-injected agent could scan unintended hosts, run local commands, or bypass URL path exclusions.

What it can reach

Shell commands
Runs security scanners and password crackers (nmap, gobuster, nikto, subfinder, httpx, ffuf, nuclei, hydra, sqlmap, tcpdump, john, hashcat), local audit commands (id, whoami, uname, sudo, linpeas), and optional configured agent worker processes (codex, claude, docker, ssh).
Network
Scans, probes, fuzzes, brute-forces, and tests SQL injection against targets declared in an engagement, captures network packets via tcpdump, optionally serves an authenticated HTTP MCP endpoint, and calls configured OIDC verifiers and LLM provider APIs.
Files
Reads and writes engagement scopes, evidence records, generated wordlists, temporary run files, and reports in ~/.pentest-mcp (or PENTEST_DATA_DIR), and reads approved shared wordlists, reviewed Nuclei templates, and optional agent profile and credential files.
Secrets
Reads OAuth client secrets and LLM API keys (OPENAI_API_KEY, ANTHROPIC_API_KEY, OPENROUTER_API_KEY, OPENAI_COMPATIBLE_API_KEY, OPENROUTER_PROXY_API_KEY) from environment variables, and reads dedicated Codex auth.json or SSH keys when agent profiles are configured.
System
Executes local user, kernel, sudoers, and linpeas privilege-escalation checks over local stdio when 127.0.0.1 is in scope, and captures live interface traffic when tcpdump has packet-capture capabilities.

Findings

2 medium2 low
  1. MediumLocal and SSH Codex agent profiles leave shell, web, and worker-store write access enabled

    src/agent-providers.ts:950

    Container-isolated Codex runs explicitly pass --disable flags for shell_tool, browser_use, computer_use, plugins, and web_search under a read-only sandbox so the model can only act through the locked Pentest MCP server (in assessment mode) or generate text (in draft mode). However, codexArgsForRun—used for local dedicated-os-account Codex profiles and ssh-codex draft profiles—omits disabledCodexToolArgs(), --strict-config, and web_search="disabled". In assessment mode, it also sets --sandbox workspace-write, -c sandbox_workspace_write.network_access=true, and --add-dir pointing to the MCP worker's PENTEST_DATA_DIR. If target output or evidence prompt-injects the Codex model during runAgentAssessment or draftAssessmentReport, the model can invoke shell_tool directly to run local commands, make arbitrary outbound network requests outside engagement scope, or rewrite the worker's engagement scope and allowedToolNames records on disk.

    Fix: Include ...disabledCodexToolArgs(), '--strict-config', and '-c', 'web_search="disabled"' in codexArgsForRun, keep Codex itself on '--sandbox', 'read-only', and remove '--add-dir', assessmentDataDir and 'sandbox_workspace_write.network_access=true' so only the spawned MCP server touches worker storage and network targets.

  2. MediumURL path exclusions in engagement scope can be bypassed with duplicate slashes or path parameters

    src/scope.ts:322

    When an engagement authorizes a domain or root URL (such as example.com) while excluding a sensitive sub-path (such as https://example.com/admin), webUrl rejects percent-encoding and dot segments, but Node's URL parser preserves duplicate slashes and semicolon matrix parameters in parsed.pathname. As a result, urlPathMatches('/admin', '//admin') and urlPathMatches('/admin', '/admin;v=1') both return false, allowing tools that rely on assertTargetsInScope—such as extractionSweep (sqlmap) and httpxProbe—to test URLs like https://example.com//admin?id=1 or https://example.com/admin;v=1?id=1 that most web servers and servlet containers normalize and route to the excluded /admin endpoint.

    Fix: Reject URL targets whose rawPath contains consecutive slashes ('//') or semicolon path parameters (';'), or collapse duplicate slashes and strip matrix parameters from each path segment before evaluating exclusion rules, and consider case-insensitive path matching for exclusions.

  3. LowDockerfile installs unpinned @latest Go binaries and live Nuclei templates at build time

    Dockerfile:61

    While the Dockerfile verifies Hashcat 8.0.0 with a pinned version, SHA-256 checksum, and GPG fingerprint, it installs subfinder, httpx, and nuclei using @latest and runs nuclei -update-templates during the image build. Anyone building the Docker image pulls whatever unreviewed code and templates are newest at build time, creating a supply-chain risk if an upstream tag is compromised.

    Fix: Pin subfinder, httpx, and nuclei to specific immutable version tags or commit hashes in go install, pin the Kali base image by digest, and avoid unpinned template updates during image builds.

  4. LowExample script recommends running the Docker container with --privileged

    usage-examples.sh:97

    Whereas docker-compose.yml runs the server as an unprivileged user with all Linux capabilities dropped, usage-examples.sh instructs users configuring Claude Desktop or CLI runs with Docker to pass --privileged. Copy-pasting that configuration disables container isolation and grants the container full root access to host devices and kernel features.

    Fix: Remove --privileged from the example commands in usage-examples.sh and document narrow capability grants (such as --cap-add=NET_RAW only when raw SYN scans or packet capture are explicitly required).