pentester-mcp 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pentester_mcp-0.3.0/.gitignore +8 -0
- pentester_mcp-0.3.0/LICENSE +21 -0
- pentester_mcp-0.3.0/PKG-INFO +429 -0
- pentester_mcp-0.3.0/README.md +378 -0
- pentester_mcp-0.3.0/pyproject.toml +55 -0
- pentester_mcp-0.3.0/src/pentest_agent/__init__.py +3 -0
- pentester_mcp-0.3.0/src/pentest_agent/assets.py +104 -0
- pentester_mcp-0.3.0/src/pentest_agent/audit.py +62 -0
- pentester_mcp-0.3.0/src/pentest_agent/engagement.example.json +32 -0
- pentester_mcp-0.3.0/src/pentest_agent/engagement.py +320 -0
- pentester_mcp-0.3.0/src/pentest_agent/findings.py +75 -0
- pentester_mcp-0.3.0/src/pentest_agent/installer.py +314 -0
- pentester_mcp-0.3.0/src/pentest_agent/patterns.py +87 -0
- pentester_mcp-0.3.0/src/pentest_agent/runner.py +186 -0
- pentester_mcp-0.3.0/src/pentest_agent/server.py +754 -0
- pentester_mcp-0.3.0/src/pentest_agent/skills/pentest-guardrails/SKILL.md +94 -0
- pentester_mcp-0.3.0/src/pentest_agent/skills/pentest-workflow/SKILL.md +154 -0
- pentester_mcp-0.3.0/src/pentest_agent/state.py +68 -0
- pentester_mcp-0.3.0/src/pentest_agent/tools/__init__.py +1 -0
- pentester_mcp-0.3.0/src/pentest_agent/tools/ctf.py +832 -0
- pentester_mcp-0.3.0/src/pentest_agent/tools/exploit.py +380 -0
- pentester_mcp-0.3.0/src/pentest_agent/tools/integrations.py +562 -0
- pentester_mcp-0.3.0/src/pentest_agent/tools/orchestrate.py +102 -0
- pentester_mcp-0.3.0/src/pentest_agent/tools/osint.py +345 -0
- pentester_mcp-0.3.0/src/pentest_agent/tools/recon.py +265 -0
- pentester_mcp-0.3.0/src/pentest_agent/tools/report.py +488 -0
- pentester_mcp-0.3.0/src/pentest_agent/tools/vulnscan.py +411 -0
- pentester_mcp-0.3.0/src/pentest_agent/tools/webapp.py +721 -0
- pentester_mcp-0.3.0/tests/test_advanced.py +171 -0
- pentester_mcp-0.3.0/tests/test_cli.py +22 -0
- pentester_mcp-0.3.0/tests/test_ctf.py +182 -0
- pentester_mcp-0.3.0/tests/test_engagement.py +122 -0
- pentester_mcp-0.3.0/tests/test_findings.py +26 -0
- pentester_mcp-0.3.0/tests/test_installer.py +92 -0
- pentester_mcp-0.3.0/tests/test_integrations.py +203 -0
- pentester_mcp-0.3.0/tests/test_report.py +46 -0
- pentester_mcp-0.3.0/tests/test_runner.py +40 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 pentest-agent contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: pentester-mcp
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Authorization-gated penetration testing MCP server for agentic AI
|
|
5
|
+
Project-URL: Documentation, https://github.com/keselyoleren/pentest-mcp#readme
|
|
6
|
+
Project-URL: Source, https://github.com/keselyoleren/pentest-mcp
|
|
7
|
+
Project-URL: Issues, https://github.com/keselyoleren/pentest-mcp/issues
|
|
8
|
+
Author: keselyoleren
|
|
9
|
+
License: MIT License
|
|
10
|
+
|
|
11
|
+
Copyright (c) 2026 pentest-agent contributors
|
|
12
|
+
|
|
13
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
15
|
+
in the Software without restriction, including without limitation the rights
|
|
16
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
17
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
18
|
+
furnished to do so, subject to the following conditions:
|
|
19
|
+
|
|
20
|
+
The above copyright notice and this permission notice shall be included in all
|
|
21
|
+
copies or substantial portions of the Software.
|
|
22
|
+
|
|
23
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
24
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
25
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
26
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
27
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
28
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
29
|
+
SOFTWARE.
|
|
30
|
+
License-File: LICENSE
|
|
31
|
+
Keywords: agent,mcp,osint,pentest,security,vulnerability-scanning
|
|
32
|
+
Classifier: Development Status :: 4 - Beta
|
|
33
|
+
Classifier: Environment :: Console
|
|
34
|
+
Classifier: Intended Audience :: Information Technology
|
|
35
|
+
Classifier: Intended Audience :: System Administrators
|
|
36
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
37
|
+
Classifier: Programming Language :: Python :: 3
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
41
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
42
|
+
Classifier: Topic :: Security
|
|
43
|
+
Requires-Python: >=3.10
|
|
44
|
+
Requires-Dist: httpx>=0.27
|
|
45
|
+
Requires-Dist: mcp>=1.2.0
|
|
46
|
+
Provides-Extra: dev
|
|
47
|
+
Requires-Dist: build>=1.0; extra == 'dev'
|
|
48
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
49
|
+
Requires-Dist: twine>=5.0; extra == 'dev'
|
|
50
|
+
Description-Content-Type: text/markdown
|
|
51
|
+
|
|
52
|
+
# pentest-mcp
|
|
53
|
+
|
|
54
|
+
An authorization-gated penetration testing MCP server for agentic AI — 80 tools
|
|
55
|
+
that install into **any MCP-capable agent**: Claude Code, Claude Desktop, Cursor,
|
|
56
|
+
Windsurf, Cline, Roo Code, Zed, OpenCode, Continue, and anything else that speaks
|
|
57
|
+
the Model Context Protocol.
|
|
58
|
+
|
|
59
|
+
Every network-touching tool **refuses to run** without an engagement file that
|
|
60
|
+
records the client's written authorization and the exact in-scope targets. The
|
|
61
|
+
gate lives in code, not in a prompt, so no conversation can talk the plugin into
|
|
62
|
+
testing something it is not allowed to test.
|
|
63
|
+
|
|
64
|
+
## Capabilities
|
|
65
|
+
|
|
66
|
+
| Area | Tools |
|
|
67
|
+
| --- | --- |
|
|
68
|
+
| Engagement & scope | `pentest_load_engagement`, `pentest_scope_check`, `pentest_rules` |
|
|
69
|
+
| Recon & OSINT | `pentest_recon_dns`, `pentest_recon_whois`, `pentest_recon_subdomains`, `pentest_recon_portscan`, `pentest_recon_tech` |
|
|
70
|
+
| Advanced OSINT | `pentest_osint_crtsh`, `pentest_osint_wayback`, `pentest_osint_js_secrets`, `pentest_osint_cloud_assets`, `pentest_osint_takeover`, `pentest_osint_shodan` |
|
|
71
|
+
| Vulnerability scanning | `pentest_vuln_nmap`, `pentest_vuln_nmap_preset`, `pentest_vuln_nuclei`, `pentest_vuln_tls`, `pentest_vuln_sslscan`, `pentest_vuln_testssl`, `pentest_vuln_wpscan`, `pentest_vuln_cve_lookup` |
|
|
72
|
+
| Web app testing | `pentest_web_headers`, `pentest_web_crawl`, `pentest_web_dirbust`, `pentest_web_reflection`, `pentest_web_param_discovery`, `pentest_web_cors`, `pentest_web_jwt`, `pentest_web_open_redirect`, `pentest_web_host_header`, `pentest_web_secrets_scan`, `pentest_web_sqlmap` |
|
|
73
|
+
| Exploit & post-exploit | `pentest_exploit_search`, `pentest_exploit_msf_check`, `pentest_exploit_msf_run`, `pentest_exploit_payload_generate`, `pentest_exploit_credential_test` |
|
|
74
|
+
| Orchestration | `pentest_assess_web`, `pentest_attack_surface` |
|
|
75
|
+
| CTF: crypto & encodings | `pentest_ctf_decode`, `pentest_ctf_encode`, `pentest_ctf_xor`, `pentest_ctf_cipher_brute`, `pentest_ctf_hash_identify`, `pentest_ctf_hash_crack`, `pentest_ctf_rsa` |
|
|
76
|
+
| CTF: forensics & pwn | `pentest_ctf_file_info`, `pentest_ctf_strings`, `pentest_ctf_binwalk`, `pentest_ctf_exif`, `pentest_ctf_stego`, `pentest_ctf_pcap`, `pentest_ctf_cyclic`, `pentest_ctf_cheatsheet` |
|
|
77
|
+
| CTF: challenge ops | `pentest_ctf_init`, `pentest_ctf_web_probe`, `pentest_ctf_remote` |
|
|
78
|
+
| Integrations | `pentest_burp_import`, `pentest_burp_status`, `pentest_burp_api`, `pentest_zap_status`, `pentest_zap_import`, `pentest_zap_spider`, `pentest_zap_active_scan`, `pentest_zap_scan_status`, `pentest_zap_alerts`, `pentest_defectdojo_status`, `pentest_defectdojo_export`, `pentest_report_generic_json` |
|
|
79
|
+
| Reporting & intel | `pentest_add_finding`, `pentest_list_findings`, `pentest_report`, `pentest_report_html`, `pentest_report_sarif`, `pentest_remediation_plan`, `pentest_cvss`, `pentest_assets`, `pentest_tool_status`, `pentest_audit_tail` |
|
|
80
|
+
|
|
81
|
+
### Highlights
|
|
82
|
+
|
|
83
|
+
- **`pentest_assess_web(url, deep=True)`** — one call runs the whole web battery:
|
|
84
|
+
headers, fingerprinting, crawl, sensitive paths, TLS, CORS, secrets, then
|
|
85
|
+
reflection and hidden-parameter discovery.
|
|
86
|
+
- **`pentest_attack_surface(domain)`** — maps the external attack surface: DNS,
|
|
87
|
+
WHOIS, certificate transparency (crt.sh), Wayback Machine, subdomain takeover,
|
|
88
|
+
cloud storage buckets. Active steps only run when the engagement allows them.
|
|
89
|
+
- **CVE intelligence** — `pentest_vuln_cve_lookup` pulls published CVEs from NVD
|
|
90
|
+
based on the product/version fingerprints.
|
|
91
|
+
- **JWT & secret hunting** — offline JWT analysis (`alg=none`, embedded `jwk`,
|
|
92
|
+
missing claims, common HMAC secret cracking) and leaked-credential detection in
|
|
93
|
+
JS/responses with values **always redacted**.
|
|
94
|
+
- **Layered exploitation** — Metasploit check mode first, msfvenom payloads into
|
|
95
|
+
the evidence directory only, hydra capped at 50 users / 50 passwords.
|
|
96
|
+
- **Dashboard-ready output** — SARIF 2.1.0 (GitHub code scanning, DefectDojo),
|
|
97
|
+
standalone HTML, CVSS v3.x calculator, and a wave-based remediation plan.
|
|
98
|
+
- **Tooling integrations** — import Burp (XML) and ZAP (JSON) reports into
|
|
99
|
+
standardized findings, drive the ZAP API from the agent, controlled passthrough
|
|
100
|
+
to the Burp REST API, and one-call export to DefectDojo (with `dry_run`).
|
|
101
|
+
- **CTF toolkit** — encodings (auto-detect), XOR brute-force, Caesar/frequency
|
|
102
|
+
attacks, hash identification + cracking, RSA factoring (trial/Fermat/Pollard
|
|
103
|
+
rho/Wiener) with decryption, file forensics (magic bytes, entropy, embedded
|
|
104
|
+
carving), strings, stego checks, PCAP analysis, De Bruijn cyclic offsets,
|
|
105
|
+
payload cheatsheets, and CTF web probes (SSTI/LFI/command injection). Offline
|
|
106
|
+
analysis runs without an engagement; `pentest_ctf_init(target)` creates a
|
|
107
|
+
scoped engagement for a challenge box in one call.
|
|
108
|
+
|
|
109
|
+
## Security model
|
|
110
|
+
|
|
111
|
+
1. **Authorization first.** The engagement file must contain a written
|
|
112
|
+
authorization statement and validity dates. After expiry, every active tool stops.
|
|
113
|
+
2. **Strict scope.** Only `scope.domains` / `cidrs` / `ips` / `urls` may be
|
|
114
|
+
touched. `scope.excluded` always wins, and resolved IPs outside the scope are
|
|
115
|
+
refused too.
|
|
116
|
+
3. **No DoS.** Per-target rate limits, capped port/path/credential lists, and
|
|
117
|
+
destructive Metasploit modules are blocked while `rules.no_dos` is set.
|
|
118
|
+
4. **Layered exploitation.** `check` mode first; `msf_run` and `payload_generate`
|
|
119
|
+
require `rules.allow_payload_execution = true` **and** a `confirm_phrase`
|
|
120
|
+
equal to the `engagement_id`. `credential_test` requires its own
|
|
121
|
+
`rules.credential_testing = true` flag.
|
|
122
|
+
5. **Audit trail.** Every tool call lands in `audit.jsonl`; findings are stored in
|
|
123
|
+
`findings.jsonl` with IDs and status (open/verified/false-positive); discovered
|
|
124
|
+
assets accumulate in `assets.json`.
|
|
125
|
+
6. **Sensitive data.** Credentials, tokens and personal data are reported as
|
|
126
|
+
location + type with the value `[REDACTED]` — including inside evidence snippets.
|
|
127
|
+
|
|
128
|
+
## Install
|
|
129
|
+
|
|
130
|
+
Requires Python 3.10+. External tools are optional: when missing, the related
|
|
131
|
+
tool reports `available: false` and the built-in capabilities (TCP port scan, TLS
|
|
132
|
+
audit, header audit, crawl, reflection, CORS, JWT) keep working.
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
pipx install pentester-mcp # recommended: isolated per user
|
|
136
|
+
# or
|
|
137
|
+
uvx --from pentester-mcp pentest-mcp --version
|
|
138
|
+
# or
|
|
139
|
+
pip install --user pentester-mcp
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
> **Naming note:** the PyPI package is `pentester-mcp` (the name `pentest-mcp` is
|
|
143
|
+
> blocked by PyPI's similarity guard because `pentestmcp`/`mcp-pentest` exist),
|
|
144
|
+
> while the command you run and the GitHub repo stay `pentest-mcp`.
|
|
145
|
+
|
|
146
|
+
From source:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
cd pentest-mcp
|
|
150
|
+
python3 -m venv .venv
|
|
151
|
+
source .venv/bin/activate
|
|
152
|
+
pip install -e .
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Optional external tools and API keys:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
brew install nmap nuclei sqlmap sslscan nikto ffuf metasploit wpscan testssl hydra
|
|
159
|
+
# sudo apt-get install nmap sqlmap sslscan nikto ffuf metasploit-framework testssl.sh hydra
|
|
160
|
+
|
|
161
|
+
export SHODAN_API_KEY=... # pentest_osint_shodan
|
|
162
|
+
export NVD_API_KEY=... # raises NVD rate limits
|
|
163
|
+
export ZAP_API_URL=http://127.0.0.1:8080
|
|
164
|
+
export ZAP_API_KEY=...
|
|
165
|
+
export BURP_API_URL=https://127.0.0.1:1337
|
|
166
|
+
export BURP_API_KEY=...
|
|
167
|
+
export BURP_AUTH_STYLE=bearer # or 'apikey' for X-API-Key
|
|
168
|
+
export DEFECTDOJO_URL=https://dojo.example.com
|
|
169
|
+
export DEFECTDOJO_API_KEY=...
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Burp and ZAP report import needs no API at all — export from the GUI, then call
|
|
173
|
+
`pentest_burp_import(path)` or `pentest_zap_import(path)`.
|
|
174
|
+
|
|
175
|
+
## Register with your AI agent
|
|
176
|
+
|
|
177
|
+
### One command (recommended)
|
|
178
|
+
|
|
179
|
+
`pentest-mcp --install` detects the agents installed on your machine and writes
|
|
180
|
+
the MCP entry into each of their configs:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
pentest-mcp --list-agents # see what was detected
|
|
184
|
+
pentest-mcp --install --dry-run # preview, writes nothing
|
|
185
|
+
pentest-mcp --install # register everywhere
|
|
186
|
+
pentest-mcp --install --project # also write .mcp.json in the current repo
|
|
187
|
+
pentest-mcp --uninstall # remove the entry again
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Supported auto-detection: **Claude Code** (user + project scope), **Claude
|
|
191
|
+
Desktop**, **Cursor**, **Windsurf**, **Cline**, **Roo Code**, **Zed**,
|
|
192
|
+
**OpenCode**, **Continue**. Existing config entries are preserved; re-running is
|
|
193
|
+
idempotent. Restart the agent afterwards.
|
|
194
|
+
|
|
195
|
+
### Manual per-agent config
|
|
196
|
+
|
|
197
|
+
<details>
|
|
198
|
+
<summary><b>Claude Code</b></summary>
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
claude mcp add pentest-mcp -- $(which pentest-mcp)
|
|
202
|
+
```
|
|
203
|
+
or in `.mcp.json` / `~/.claude.json`:
|
|
204
|
+
```json
|
|
205
|
+
{ "mcpServers": { "pentest-mcp": { "command": "pentest-mcp" } } }
|
|
206
|
+
```
|
|
207
|
+
</details>
|
|
208
|
+
|
|
209
|
+
<details>
|
|
210
|
+
<summary><b>OpenCode</b></summary>
|
|
211
|
+
|
|
212
|
+
`opencode.json`:
|
|
213
|
+
```json
|
|
214
|
+
{ "mcp": { "pentest-mcp": { "type": "local", "command": ["pentest-mcp"] } } }
|
|
215
|
+
```
|
|
216
|
+
</details>
|
|
217
|
+
|
|
218
|
+
<details>
|
|
219
|
+
<summary><b>Cursor / Windsurf / Cline / Roo Code / Claude Desktop</b></summary>
|
|
220
|
+
|
|
221
|
+
In the respective MCP config (`~/.cursor/mcp.json`,
|
|
222
|
+
`~/.codeium/windsurf/mcp_config.json`, `cline_mcp_settings.json`,
|
|
223
|
+
`claude_desktop_config.json`):
|
|
224
|
+
```json
|
|
225
|
+
{ "mcpServers": { "pentest-mcp": { "command": "pentest-mcp" } } }
|
|
226
|
+
```
|
|
227
|
+
</details>
|
|
228
|
+
|
|
229
|
+
<details>
|
|
230
|
+
<summary><b>Zed</b></summary>
|
|
231
|
+
|
|
232
|
+
In `settings.json`:
|
|
233
|
+
```json
|
|
234
|
+
{ "context_servers": { "pentest-mcp": { "command": { "path": "pentest-mcp", "args": [] } } } }
|
|
235
|
+
```
|
|
236
|
+
</details>
|
|
237
|
+
|
|
238
|
+
<details>
|
|
239
|
+
<summary><b>Continue</b></summary>
|
|
240
|
+
|
|
241
|
+
In `~/.continue/mcpServers.yaml`:
|
|
242
|
+
```yaml
|
|
243
|
+
mcpServers:
|
|
244
|
+
pentest-mcp:
|
|
245
|
+
command: pentest-mcp
|
|
246
|
+
args: []
|
|
247
|
+
```
|
|
248
|
+
</details>
|
|
249
|
+
|
|
250
|
+
<details>
|
|
251
|
+
<summary><b>Any other MCP client</b></summary>
|
|
252
|
+
|
|
253
|
+
Stdio transport, command `pentest-mcp`, no arguments, no required environment.
|
|
254
|
+
</details>
|
|
255
|
+
|
|
256
|
+
### Skill pack
|
|
257
|
+
|
|
258
|
+
The agent skills ship inside the package — export them into your agent's skills
|
|
259
|
+
directory:
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
pentest-mcp --export-skills ~/.claude/skills # Claude Code, global
|
|
263
|
+
pentest-mcp --export-skills .claude/skills # per project
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
- `pentest-guardrails` — engagement rules: authorization, scope, no-DoS,
|
|
267
|
+
sensitive-data handling, when to refuse.
|
|
268
|
+
- `pentest-workflow` — end-to-end methodology: recon → OSINT → scan → web →
|
|
269
|
+
exploit → report.
|
|
270
|
+
|
|
271
|
+
## Engagement file
|
|
272
|
+
|
|
273
|
+
No engagement file, no active tools. Generate a starter and edit it:
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
pentest-mcp --export-engagement-template engagement.json
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
Key fields:
|
|
280
|
+
|
|
281
|
+
- `authorization` — written authorization statement plus `valid_from` / `valid_until`
|
|
282
|
+
- `scope.domains/ips/cidrs/urls` — the only targets allowed; `excluded` always wins
|
|
283
|
+
- `rules.active_scanning` — `true` when traffic may be sent to the target
|
|
284
|
+
- `rules.exploit_authorized` / `allow_payload_execution` / `credential_testing` —
|
|
285
|
+
keep `false` unless explicitly agreed in the RoE
|
|
286
|
+
- `evidence_dir` — where findings, audit trail and reports are written
|
|
287
|
+
|
|
288
|
+
## Usage
|
|
289
|
+
|
|
290
|
+
Tell your agent:
|
|
291
|
+
|
|
292
|
+
```
|
|
293
|
+
Run a security assessment against https://app.example.com, engagement file: ./engagement.json
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
The agent loads the engagement first, then works the methodology from the
|
|
297
|
+
`pentest-workflow` skill. Outputs land in `evidence_dir`:
|
|
298
|
+
|
|
299
|
+
- `findings.jsonl`, `audit.jsonl`, `assets.json`
|
|
300
|
+
- `report-*.md`, `report-*.html`, `findings-*.sarif`, `findings-*-generic.json`
|
|
301
|
+
|
|
302
|
+
## Publish publicly
|
|
303
|
+
|
|
304
|
+
Once published, anyone in the world can install and self-register with two lines:
|
|
305
|
+
|
|
306
|
+
```bash
|
|
307
|
+
uv tool install pentester-mcp # or: pipx install pentester-mcp
|
|
308
|
+
pentest-mcp --install
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
Maintainer — one-time setup and release flow:
|
|
312
|
+
|
|
313
|
+
1. **Push the repository** to GitHub/GitLab as `keselyoleren/pentest-mcp` and fill in
|
|
314
|
+
`[project.urls]` in `pyproject.toml`. The PyPI project name is `pentester-mcp`
|
|
315
|
+
(`pentest-mcp` itself is blocked by PyPI's similarity guard against the existing
|
|
316
|
+
`pentestmcp`/`mcp-pentest` projects).
|
|
317
|
+
2. **Configure PyPI Trusted Publishing** (recommended, no long-lived token):
|
|
318
|
+
pypi.org → project `pentester-mcp` → Publishing → add a pending publisher with
|
|
319
|
+
your repo and workflow `release.yml`, environment `pypi`. Alternative: create a
|
|
320
|
+
PyPI API token and use `twine upload` with `__token__`.
|
|
321
|
+
3. **Dry-run on TestPyPI** before going public:
|
|
322
|
+
|
|
323
|
+
```bash
|
|
324
|
+
python -m build
|
|
325
|
+
twine upload --repository testpypi dist/*
|
|
326
|
+
uv tool install --index-url https://test.pypi.org/simple/ pentester-mcp
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
4. **Release with a tag** — CI (`.github/workflows/release.yml`) runs the tests,
|
|
330
|
+
publishes to PyPI, and attaches the wheel to a GitHub Release:
|
|
331
|
+
|
|
332
|
+
```bash
|
|
333
|
+
git tag v0.3.0 && git push origin v0.3.0
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
Manual fallback: `python -m build && twine upload dist/*`
|
|
337
|
+
|
|
338
|
+
Distribution without PyPI works too and keeps the same user experience:
|
|
339
|
+
|
|
340
|
+
```bash
|
|
341
|
+
pipx install git+https://github.com/keselyoleren/pentest-mcp.git
|
|
342
|
+
uv tool install --from git+https://github.com/keselyoleren/pentest-mcp.git pentest-mcp
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
End users never need the repository: the wheel carries the MCP server, the skills
|
|
346
|
+
(`pentest-mcp --export-skills`), and the engagement template
|
|
347
|
+
(`pentest-mcp --export-engagement-template`). Pair public distribution with the
|
|
348
|
+
authorization gates in the security model — the tools refuse out-of-scope targets
|
|
349
|
+
no matter where the package came from.
|
|
350
|
+
|
|
351
|
+
## Team distribution
|
|
352
|
+
|
|
353
|
+
The model: **every tester runs their own local instance** — perfect isolation per
|
|
354
|
+
process, each with their own engagement file and evidence, no shared server to
|
|
355
|
+
operate or defend. Distribute through any channel from "Publish publicly" above.
|
|
356
|
+
|
|
357
|
+
Team member onboarding (5 minutes):
|
|
358
|
+
|
|
359
|
+
```bash
|
|
360
|
+
pipx install pentester-mcp==0.3.0
|
|
361
|
+
pentest-mcp --install
|
|
362
|
+
pentest-mcp --export-skills ~/.claude/skills
|
|
363
|
+
pentest-mcp --export-engagement-template engagement.json
|
|
364
|
+
# edit engagement.json, then: pentest_load_engagement
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
Suggested team conventions:
|
|
368
|
+
|
|
369
|
+
- One engagement file per project per operator; never share engagement files
|
|
370
|
+
across projects (scope and validity dates differ).
|
|
371
|
+
- Keep `evidence_dir` in the team's internal version control or shared storage.
|
|
372
|
+
- Consolidate findings across operators in DefectDojo
|
|
373
|
+
(`pentest_defectdojo_export`) — the single shared source of truth in this model.
|
|
374
|
+
- Pin versions on deploy so tool behaviour stays consistent across the team.
|
|
375
|
+
|
|
376
|
+
## Repository layout
|
|
377
|
+
|
|
378
|
+
```
|
|
379
|
+
pentest-mcp/
|
|
380
|
+
├── pyproject.toml # PyPI metadata, pentest-mcp entry point
|
|
381
|
+
├── LICENSE
|
|
382
|
+
├── src/pentest_agent/
|
|
383
|
+
│ ├── engagement.py # scope matching + authorization gate
|
|
384
|
+
│ ├── state.py # gate() used by every tool
|
|
385
|
+
│ ├── runner.py # bounded binary execution + rate limiter
|
|
386
|
+
│ ├── audit.py # append-only audit trail
|
|
387
|
+
│ ├── findings.py # finding model + JSONL store
|
|
388
|
+
│ ├── assets.py # asset inventory (hosts, services, tech)
|
|
389
|
+
│ ├── patterns.py # secret/endpoint patterns + redaction
|
|
390
|
+
│ ├── installer.py # --install agent auto-detection
|
|
391
|
+
│ ├── engagement.example.json # bundled engagement template
|
|
392
|
+
│ ├── server.py # 80 MCP tools + onboarding CLI
|
|
393
|
+
│ ├── skills/ # bundled into the wheel
|
|
394
|
+
│ │ ├── pentest-guardrails/SKILL.md
|
|
395
|
+
│ │ └── pentest-workflow/SKILL.md
|
|
396
|
+
│ └── tools/
|
|
397
|
+
│ ├── recon.py # DNS, WHOIS, subdomains, port scan, fingerprint
|
|
398
|
+
│ ├── osint.py # crt.sh, Wayback, JS secrets, cloud, takeover, Shodan
|
|
399
|
+
│ ├── vulnscan.py # nmap(+presets), nuclei, TLS, testssl, wpscan, CVE lookup
|
|
400
|
+
│ ├── webapp.py # headers, crawl, dirbust, reflection, params, CORS,
|
|
401
|
+
│ │ # JWT, open redirect, host header, secrets, sqlmap
|
|
402
|
+
│ ├── exploit.py # searchsploit, Metasploit check/run, msfvenom, hydra
|
|
403
|
+
│ ├── ctf.py # CTF: encodings, crypto, RSA, forensics, stego, pwn, probes
|
|
404
|
+
│ ├── orchestrate.py # assess_web, attack_surface
|
|
405
|
+
│ ├── integrations.py # Burp, OWASP ZAP, DefectDojo
|
|
406
|
+
│ └── report.py # findings, Markdown/HTML/SARIF/generic JSON, CVSS, remediation
|
|
407
|
+
└── tests/ # 64 tests: scope, gates, redaction, CVSS, SARIF, JWT,
|
|
408
|
+
# integrations, CLI, installer, CTF
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
## Development
|
|
412
|
+
|
|
413
|
+
```bash
|
|
414
|
+
pip install -e ".[dev]"
|
|
415
|
+
pytest
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
Probe the tool surface without an agent:
|
|
419
|
+
|
|
420
|
+
```bash
|
|
421
|
+
npx @modelcontextprotocol/inspector $(which pentest-mcp)
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
## Usage restrictions
|
|
425
|
+
|
|
426
|
+
This plugin is for security assessments that are authorised in writing. Testing
|
|
427
|
+
systems without authorization is a criminal offence in most jurisdictions,
|
|
428
|
+
including under Indonesia's ITE Law. The in-code scope gates limit accidental
|
|
429
|
+
damage, but legal responsibility stays with the operator and their organisation.
|