pentest-suite
# Pentest-Suite
<p align="center">
<img src="assets/banner.png" alt="pentest-suite banner" width="100%">
</p>
<p align="center">
<strong>Modular Attack Surface Discovery & Vulnerability Intelligence in Pure Python Standard Library</strong>
</p>
<p align="center">
<img src="https://img.shields.io/badge/python-3.15+-blue.svg" alt="Python 3.15+">
<img src="https://img.shields.io/badge/dependencies-zero%20(stdlib%20only)-success.svg" alt="Zero Dependencies">
<img src="https://img.shields.io/badge/license-MIT-green.svg" alt="License MIT">
<img src="https://img.shields.io/badge/MCP-JSON--RPC%202.0-blueviolet.svg" alt="MCP Server">
<img src="https://img.shields.io/badge/threat%20intel-CISA%20KEV%20%7C%20cve.now-orange.svg" alt="Threat Intel">
<img src="https://img.shields.io/badge/taxonomy-MITRE%20ATT%26CK-red.svg" alt="MITRE ATT&CK">
</p>
---
**Pentest-Suite** is a lightweight, zero-dependency cybersecurity toolkit designed for attack surface reconnaissance, active host qualification, port enumeration, content discovery, template-based vulnerability scanning, and threat intelligence enrichment.
Built in pure Python standard library (`urllib`, `concurrent.futures`, `socket`, `ssl`), it runs everywhere with zero compilation, no external package bloat, and predictable execution. It is the offensive security counterpart of `osint-suite` (sharing the same core engine, session models, correlation logic, and Markdown/Mermaid reporting).
---
## ⚡ Key Highlights
- **Pure Python Standard Library**: Zero third-party dependencies. No `pip install`, no C/Rust toolchains. Runs with Python ≥ 3.15 or via [uv](https://docs.astral.sh/uv/).
- **Safe & Benign Active Probing**: Non-destructive full TCP-connect scans, soft-404 baseline calibration, conservative wordlists, and strict authorization banners.
- **Threat Intelligence Engine**: Integrated live lookups via [sazabi/cve.now](https://cve.now) (CVSS scores, Exploit-DB links, EPSS probability, AI summaries) and official [CISA KEV](https://www.cisa.gov/known-exploited-vulnerabilities-catalog) feeds without requiring API keys.
- **Autonomous OODA Loop**: Deterministic **Observe-Orient-Decide-Act** orchestration (`chain`) that dynamically adapts scan depth based on observed target signals.
- **Native AI Agent MCP Server**: Stdio JSON-RPC 2.0 Model Context Protocol server exposing `probe`, `ports`, `dirs`, `tmpl`, and `kev` as first-class tools for AI coding assistants (Claude Code, Cursor, Codex).
- **MITRE ATT&CK Tagging**: Automated tagging of findings and recon phases to Enterprise ATT&CK techniques (T1595, T1046, T1552, T1190).
- **Tamper-Evident Session Reports**: Every saved session is sealed into an Ed25519-signed, hash-chained sidecar (`.chain.json`, pure-stdlib RFC 8032 — idea from [lacs-project/sysknife](https://github.com/lacs-project/sysknife)); `audit-verify` proves the delivered report has not been altered since signature.
- **CI/CD Security Gate**: Exits with return code `2` on findings at or above `--fail-on` (default: `high`, preserving `high`/`critical` failure) and exports OASIS **SARIF 2.1.0** (`.sarif` / `--sarif`) with CWE/STRIDE tags and `security-severity`.
- **Multi-Format Deliverables & Coverage**: Every run produces structured session JSON, executive Markdown briefings (`.report.md`, including verification/coverage/leads sections), Mermaid topology graphs, SARIF 2.1.0 reports, and a negative-space coverage ledger (`.coverage.json`) in `reports/`.
- **Calibrated Evidence & Provenance**: Distinguishes `confirmed` vs `probable` findings (`ports` banners, `tmpl` baseline checks), extracts observed versions in `probe`, stamps `cve` entities with `retrieved_at` and `query_mode` in `kev`, and flags unverified tech leads as `needs_follow_up` in `chain`.
- **Enforceable Target Scope & Redirect Guard**: Supports explicit target allowlists via `--scope-file` or `PENTEST_SUITE_SCOPE` / `PENTEST_SUITE_SCOPE_FILE` (with `PENTEST_SUITE_ALLOW_LOCAL`) and blocks out-of-scope or SSRF-risk HTTP redirects across `probe`, `ports`, `dirs`, `tmpl`, `chain`, and `mcp`.
- **ARTEX-derived Hardening (AGX stack)**: typed platform-control block codes with agent-readable guidance and a bounded guard audit ring; failure attribution (WAF-blocked `dirs` is never read as clean and halts active probing); a deterministic intent frontier with typed terminal reasons (`exhausted` ≠ `blocked` ≠ `failed`) and zero silent skip; PoE evidence levels 0-4 with verbatim response-verified quotes; wrap-up gaps section (« non examiné ≠ propre »); noise governor (`--noise`), work-unit run budget with wrap-up reserve (`--max-requests`), operator constraints freeze (`--constraints-file`), targeted retest loop (`--retest`), and evidence-gated cross-run lessons — all stdlib-only, no LLM ([docs/artex-architecture.md](docs/artex-architecture.md)).
---
## 🧭 Architecture & Upstream Inspirations
`pentest-suite` faithfully re-implements the core mechanics and operating principles of industry-standard tools within the Python standard library:
| Upstream Project | Re-implemented Concept | Implementation |
|---|---|---|
| [projectdiscovery/nuclei](https://github.com/projectdiscovery/nuclei) | Detection logic decoupled into declarative JSON templates with `status`, `contains`, and `regex` matchers | [`modules/tmpl/`](file:///d:/GIT/pentest-suite/pentest_suite/modules/tmpl) + [`config/templates/`](file:///d:/GIT/pentest-suite/pentest_suite/config/templates) |
| [Checkmarx/kics](https://github.com/Checkmarx/kics) | Per-query metadata (`cwe`, `references`, `category`), category-organized query catalog, and mandatory positive/negative test cases per detection | [`config/templates/`](file:///d:/GIT/pentest-suite/pentest_suite/config/templates) + [`tests/test_templates.py`](file:///d:/GIT/pentest-suite/tests/test_templates.py) + [`config/ports.json`](file:///d:/GIT/pentest-suite/pentest_suite/config/ports.json) |
| [projectdiscovery/httpx](https://github.com/projectdiscovery/httpx) | Concurrent HTTP host qualification: status code, HTML title, server header, technology markers | [`modules/probe/`](file:///d:/GIT/pentest-suite/pentest_suite/modules/probe) |
| [projectdiscovery/naabu](https://github.com/projectdiscovery/naabu) + [nmap/nmap](https://github.com/nmap/nmap) | Multi-threaded TCP connect scan, service identification, banner grabbing, and flagged port classification | [`modules/ports/`](file:///d:/GIT/pentest-suite/pentest_suite/modules/ports) + [`config/ports.json`](file:///d:/GIT/pentest-suite/pentest_suite/config/ports.json) |
| [ffuf/ffuf](https://github.com/ffuf/ffuf) / [feroxbuster](https://github.com/epi052/feroxbuster) | Wordlist content discovery with soft-404 baseline calibration and response size filtering (`--filter-size`) | [`modules/dirs/`](file:///d:/GIT/pentest-suite/pentest_suite/modules/dirs) + [`config/wordlist.txt`](file:///d:/GIT/pentest-suite/pentest_suite/config/wordlist.txt) |
| [sazabi/cve.now](https://github.com/sazabi/cve.now) + [CISA KEV](https://www.cisa.gov/known-exploited-vulnerabilities-catalog) | Real-time threat intelligence lookup (CVSS, EPSS, Exploit-DB, CISA KEV) and critical technology feeds | [`modules/intel/`](file:///d:/GIT/pentest-suite/pentest_suite/modules/intel) |
| [irraz/vulnerator-ai](https://github.com/irraz/vulnerator-ai) | Deterministic OODA loop orchestration, stdio MCP server for autonomous agents, MITRE ATT&CK taxonomy | [`core/chain.py`](file:///d:/GIT/pentest-suite/pentest_suite/core/chain.py), [`mcp_server.py`](file:///d:/GIT/pentest-suite/pentest_suite/mcp_server.py), [`core/attack.py`](file:///d:/GIT/pentest-suite/pentest_suite/core/attack.py) |
| [usestrix/strix](https://github.com/usestrix/strix) | SARIF 2.1.0 export (`CWE`, STRIDE, `security-severity`, `logicalLocations`), negative-space coverage ledger, JSON API spec ingestion (`OpenAPI`/`Swagger`/`Postman`), `--fail-on`, `--target-list`, wildcard counterevidence, strict URL validation | [`core/sarif.py`](pentest_suite/core/sarif.py), [`core/coverage.py`](pentest_suite/core/coverage.py), [`core/api_spec.py`](pentest_suite/core/api_spec.py), [`utils/url_safety.py`](pentest_suite/utils/url_safety.py), [`cli.py`](pentest_suite/cli.py) |
| [Harness Engineering Workshop](https://grahamhelton.github.io/harness-engineering-workshop-book/) | Honest negative-space coverage caveats, `confirmed` vs `probable` confidence calibration, fail-closed `ScopePolicy` + SSRF-safe redirects, bounded MCP responses (`max_items`, `save`), JSONL telemetry, and agent workflow skill | [`core/coverage.py`](pentest_suite/core/coverage.py), [`utils/url_safety.py`](pentest_suite/utils/url_safety.py), [`core/chain.py`](pentest_suite/core/chain.py), [`mcp_server.py`](pentest_suite/mcp_server.py), [`skills/pentest-suite-harness/SKILL.md`](skills/pentest-suite-harness/SKILL.md) |
| [BaaRai/ARTEX](https://github.com/BaaRai/ARTEX) | Platform-control guard framing + bounded allow/block audit ring, failure attribution (Observer/G5), deterministic intent frontier with typed terminal reasons and stagnation detection, PoE levels 0-4 + verbatim response-verified evidence quotes, noise governor, hierarchical run budget with wrap-up reserve, operator constraints freeze, targeted retest loop, evidence-gated RSI lessons, wrap-up gaps | [`core/guard.py`](pentest_suite/core/guard.py), [`core/intents.py`](pentest_suite/core/intents.py), [`core/poe.py`](pentest_suite/core/poe.py), [`core/noise.py`](pentest_suite/core/noise.py), [`core/budget.py`](pentest_suite/core/budget.py), [`core/constraints.py`](pentest_suite/core/constraints.py), [`core/retest.py`](pentest_suite/core/retest.py), [`core/lessons.py`](pentest_suite/core/lessons.py), [`core/chain.py`](pentest_suite/core/chain.py) + [docs/artex-architecture.md](docs/artex-architecture.md) |
| [lacs-project/sysknife](https://github.com/lacs-project/sysknife) | Ed25519-signed, hash-chained audit trail proving reports were not altered after the fact (sidecar document, session schema untouched); RFC 8032 in pure stdlib | [`core/audit_chain.py`](pentest_suite/core/audit_chain.py), [`utils/ed25519.py`](pentest_suite/utils/ed25519.py), [`cli.py`](pentest_suite/cli.py) + [docs/ideas-from-sysknife.md](docs/ideas-from-sysknife.md) |
---
## ⚠️ Responsible Use
> **CRITICAL**: This toolkit is strictly intended for security testing against systems you have explicit, documented authorization to assess (your own infrastructure, authorized penetration testing scopes, or bug bounty programs within scope).
>
> Active probes are deliberately non-destructive: standard TCP handshakes only (no raw sockets or forged packets by default), safe wordlists, and no exploit payloads. Every active command requires and displays an authorization banner.
---
## 🚀 Installation
Managed with [uv](https://docs.astral.sh/uv/) (Python ≥ 3.15, committed `uv.lock`):
```bash
git clone https://github.com/laurentvv/pentest-suite.git
cd pentest-suite
uv sync
uv run pentest-suite --version
```
*Alternative without uv (using your system Python 3.15+ directly)*:
```bash
python -m pentest_suite --version
```
---
## 🛠️ Usage & CLI Reference
### 1. HTTP Host Qualification (`probe`)
Sondes a comma-separated list of targets (or a `--target-list` file, one host per non-empty non-`#` line) over HTTPS and HTTP:
```bash
uv run pentest-suite probe example.com,api.example.com
uv run pentest-suite probe --target-list targets.txt
```
### 2. TCP Port Scanning & Banner Grabbing (`ports`)
Performs a benign multi-threaded TCP connect scan:
```bash
uv run pentest-suite ports example.com
uv run pentest-suite ports example.com --ports 80,443,8000-8100 --workers 50
```
### 3. Path Discovery with Soft-404 Baseline & API Specs (`dirs`)
Discovers hidden endpoints, calibrating against soft-404 behaviors, or probes declared read-only (`GET`/`HEAD`) endpoints from a JSON OpenAPI 3.x, Swagger 2.0, or Postman v2.1 specification:
```bash
uv run pentest-suite dirs https://example.com
uv run pentest-suite dirs https://example.com --filter-size 150032,155455 --workers 12
uv run pentest-suite dirs --spec openapi.json
```
### 4. Template-Based Detection (`tmpl`)
Scans against embedded nuclei-style JSON checks (`git-exposed`, `env-exposed`, `actuator-exposed`, `server-status`, etc.), applying a random-path catch-all baseline check to avoid wildcard false positives:
```bash
uv run pentest-suite tmpl https://example.com
uv run pentest-suite tmpl https://example.com --only git-exposed,env-exposed
uv run pentest-suite tmpl https://example.com --fail-on medium --sarif findings.sarif
```
*Note: Returns exit code `2` when any finding is at or above `--fail-on` (default: `high`, matching `high`/`critical`).*
### 5. Threat Intelligence & Vulnerability Lookup (`kev`)
Queries [cve.now](https://cve.now) and [CISA KEV](https://www.cisa.gov/known-exploited-vulnerabilities-catalog) feeds (100% passive, read-only):
```bash
# Instant enriched CVE lookup (CVSS score, Exploit-DB IDs, EPSS, summary)
uv run pentest-suite kev CVE-2024-6387
uv run pentest-suite kev --cve CVE-2021-44228
# Critical vulnerabilities feed for a specific tracked technology
uv run pentest-suite kev nginx
uv run pentest-suite kev spring
# Search the official CISA KEV catalog by vendor or keyword
uv run pentest-suite kev tomcat --source cisa
```
### 6. Full Autonomous OODA Chain (`chain`)
Executes the deterministic Observe-Orient-Decide-Act workflow over an **intent frontier** and records a negative-space coverage ledger (`.coverage.json`) alongside the SARIF 2.1.0 report:
```bash
uv run pentest-suite chain example.com
uv run pentest-suite chain --spec openapi.json --fail-on medium --sarif reports/api.sarif
# ARTEX-derived operator controls (AGX stack):
uv run pentest-suite chain example.com --noise quiet --max-requests 500 --constraints-file constraints.json
uv run pentest-suite chain --retest reports/chain-example.com.json
```
**How the OODA loop decides**:
1. **Observe**: Probes host reachability. If unreachable, halts immediately (intent `blocked`: target unreachable) to prevent futile scans.
2. **Orient**: Identifies open ports and detected server technologies.
3. **Decide / Act**: Web port open? Run template checks. If a high/critical issue is found, prioritizes alerting and skips brute-force directory discovery (intent `blocked`: prioritized). Otherwise, proceeds to directory fuzzing.
4. **Orient Final**: Detected technologies are cross-referenced with CISA KEV and `cve.now` feeds (one intent per correlated technology, capped at 2).
**Intent frontier (execution ledger)**: every phase — run, skipped, or frozen — exists as an intent with a **typed terminal status** (`done | exhausted | blocked | not_applicable | failed`) and an explicit reason, serialized in the chain result and rendered as a Mermaid graph in `.graph.md`. Nothing is silently skipped (`settled()` guarantees it).
**Guard blocks & failure attribution**: scope/locality violations carry typed codes (`scope_denied`, `local_disallowed`) with explicit *platform-control, not target-defense* framing so an agent reading the output never mistakes a policy decision for a WAF and tries to bypass it; decisions land in a bounded audit ring (`guard_audit`). A `dirs` run whose responses are majority-blocked (403/429/WAF markers) records a `needs_follow_up` verdict with explicit WAF attribution — never a clean one — and halts further active probing.
**Proof of exploitation (PoE)**: `tmpl` findings carry a PoE level 0-4 (declared via `info.poe`, else matcher-derived: L2 for contains/regex, L1 for status-only) capped at L2 when the wildcard counterevidence could not apply (no baseline, non-GET, non-confirmed). The evidence includes a verbatim quote extracted from the actual response body and re-verified by whitespace-normalized containment — quotes never come from memory.
**Targeted retest**: `chain --retest SESSION.json` re-runs ONLY the confirmed `tmpl` templates of a previous session (probe liveness + `tmpl --only`, never a full scan) and returns one verdict per finding: `reproduced` (still matches), `fixed` (alive and clean — always carries a single-run caveat), or `inconclusive` (target unreachable).
**Cross-run lessons**: confirmed findings and retest verdicts are extracted into `reports/lessons.json` (each lesson = cue + action + evidence rows, deduplicated by source, retracted on reversed disposition, retired at zero support). Later runs on the same target surface prior lessons as caveats — data to verify, never instructions.
**Operator controls**:
- `--noise quiet|balanced|aggressive` — caps ports/dirs workers (deterministic table; never raises the rate to meet a deadline).
- `--max-requests N` — work-unit budget over planned requests; over-budget phases end `exhausted(budget)` before launching, and the final passive KEV orient is protected by a wrap-up reserve (max(2, 5 % of N)).
- `--constraints-file constraints.json` — `{"deny": ["dirs"], "allow": ["probe", "ports", "tmpl", "kev"]}`: frozen phases end `not_applicable(denied)`; validation is fail-closed (unknown phase / overlap → error); a non-empty `allow` freezes everything not listed (minimal-scope principle).
- `--lessons PATH` / `--no-lessons` — override or disable the lessons file (default: `reports/lessons.json`, git-ignored).
Deep design notes (ARTEX → here mapping, terminal-status vocabulary, PoE scale, budget math): [docs/artex-architecture.md](docs/artex-architecture.md).
---
### 7. Signed Audit Chain (`audit-verify`)
Every saved session (from `probe`, `ports`, `dirs`, `tmpl`, `kev`, `chain`) is sealed by an **Ed25519-signed hash chain** written to a sidecar `<session>.chain.json`. The session file itself keeps its schema untouched; the sidecar chains one row per top-level section (each row hashing the previous row), binds the raw file bytes via `session_sha256`, and signs the chain tip. Idea and trust model borrowed from [lacs-project/sysknife](https://github.com/lacs-project/sysknife) — proof that a delivered pentest report was not altered after the fact.
```bash
# signing is automatic on every save; verify later:
uv run pentest-suite audit-verify reports/probe_example.com.json # exit 0 = valid, 3 = altered, 1 = missing file
uv run pentest-suite audit-verify reports/probe_example.com.json --key pubkey.hex # pin the expected public key
```
- Pure stdlib Ed25519 (RFC 8032) in `pentest_suite/utils/ed25519.py`, tested against the RFC's official §7.1 vectors — keeps the zero-dependency invariant.
- Signing key: auto-generated at `~/.pentest-suite/audit_key.json` on first save; override with `PENTEST_SUITE_AUDIT_KEY=/path/key.json` (or `--key` on the CLI for the expected public key). The chain embeds the public key + its SHA-256 fingerprint; pin it out-of-band (`--key`) to detect a key swap by someone holding the private key.
- Any altered byte — a finding severity, a hostname, even trailing whitespace — fails verification with the offending section named (`chain_break: ligne N (findings)`).
- Not exposed over MCP (the MCP tool list stays fixed: `probe`, `ports`, `dirs`, `tmpl`, `kev`).
---
## 🤖 Model Context Protocol (MCP) Server
`pentest-suite` includes a built-in stdio MCP server (JSON-RPC 2.0) that allows AI coding agents (Claude Code, Cursor, Codex, Windsurf) to pilot penetration testing workflows safely.
### Claude Code Configuration (`~/.claude.json` or `.mcp.json`):
```json
{
"mcpServers": {
"pentest-suite": {
"command": "uv",
"args": [
"run", "--directory", "/path/to/pentest-suite",
"pentest-suite", "mcp",
"--scope-file", "scope.txt",
"--telemetry", "reports/mcp-telemetry.jsonl"
]
}
}
}
```
### Exposed MCP Tools:
- `probe`: Qualifies HTTP hosts (status, title, banner, observed technology versions).
- `ports`: Multi-threaded TCP connect port scanner with banner confidence calibration.
- `dirs`: Wordlist path discovery with soft-404 size filtering and coverage caveats.
- `tmpl`: Nuclei-style JSON template scanner with baseline failure caveats.
- `kev`: CISA KEV and cve.now vulnerability intelligence lookup with provenance metadata.
### Context Management, Scope & Telemetry:
- **Context Controls**: All 5 tools accept optional `max_items` (`1..50`) to cap verbose lists in agent context and optional `save` (`true`/`false`) to persist full session bundles (`.json`, `.report.md`, `.graph.md`, `.sarif`, `.coverage.json`) strictly inside `reports/`. Tool summaries also surface coverage status and caveats.
- **Scope Enforcement**: Pass `--scope-file` on `probe`, `ports`, `dirs`, `tmpl`, `chain`, or `mcp` (or configure `PENTEST_SUITE_SCOPE`, `PENTEST_SUITE_SCOPE_FILE`, and `PENTEST_SUITE_ALLOW_LOCAL`). Empty scope files fail closed.
- **Append-Only Telemetry**: Pass `--telemetry PATH` to `pentest-suite mcp` (or set `PENTEST_SUITE_TELEMETRY`) to record deterministic JSONL tool/error telemetry without polluting stdout.
- **Bundled Agent Skill**: See [`skills/pentest-suite-harness/SKILL.md`](skills/pentest-suite-harness/SKILL.md) and its templates in [`skills/pentest-suite-harness/assets/`](skills/pentest-suite-harness/assets/) for multi-thread campaign handoff workflows.
*Security Invariant: The tool registry is strictly bounded. No arbitrary shell execution tools are exposed.*
---
## 📁 Repository Structure
```
pentest-suite/
├── assets/
│ └── banner.png # Project banner
├── pentest_suite/
│ ├── cli.py # CLI entry points and command handlers
│ ├── mcp_server.py # Stdio JSON-RPC 2.0 MCP server implementation
│ ├── config/
│ │ ├── attack.json # MITRE ATT&CK taxonomy mapping
│ │ ├── ports.json # Default & flagged sensitive ports (with risk notes)
│ │ ├── wordlist.txt # Embedded path discovery wordlist
│ │ └── templates/ # Nuclei-style JSON templates, in kics-style
│ │ ├── exposure/ # data exposure (.git, .env, dir listing)
│ │ ├── management/ # admin endpoints (Actuator, server-status)
│ │ └── metadata/ # public metadata (robots.txt, security.txt)
│ ├── core/ # Shared engine (models/engine/plugin/report) + suite extensions
│ │ ├── api_spec.py # Stdlib JSON OpenAPI/Swagger/Postman parser
│ │ ├── attack.py # MITRE ATT&CK session tagger
│ │ ├── budget.py # Work-unit run budget with wrap-up reserve (ARTEX)
│ │ ├── chain.py # Deterministic OODA loop over an intent frontier
│ │ ├── constraints.py # Operator deny/allow phase freeze, fail-closed (ARTEX)
│ │ ├── coverage.py # Negative-space coverage ledger & wrap-up gaps
│ │ ├── engine.py # Session runner and event dispatcher
│ │ ├── guard.py # Bounded allow/block audit ring (ARTEX guard)
│ │ ├── intents.py # Intent frontier, terminal reasons, stagnation (ARTEX)
│ │ ├── lessons.py # Evidence-gated cross-run lessons (ARTEX RSI)
│ │ ├── models.py # Entity, Finding, and Session models
│ │ ├── noise.py # Noise governor profiles quiet/balanced/aggressive
│ │ ├── plugin.py # Module registry and base classes
│ │ ├── poe.py # PoE levels 0-4 + verbatim verified quotes (ARTEX)
│ │ ├── retest.py # Targeted retest loop (ARTEX retester)
│ │ ├── report.py # Markdown dossier & Mermaid graph generators
│ │ └── sarif.py # OASIS SARIF 2.1.0 report generator
│ ├── modules/
│ │ ├── probe/ # HTTP host qualification
│ │ ├── ports/ # TCP connect port scanner
│ │ ├── dirs/ # Soft-404 path discovery + failure attribution
│ │ ├── tmpl/ # Template matcher engine (PoE + verbatim quotes)
│ │ └── intel/ # CISA KEV & cve.now threat intelligence
│ └── utils/
│ ├── http.py # Stdlib HTTP client & thread pool runner
│ ├── io.py # Atomic JSON artifact writer
│ └── url_safety.py # URL validation, ScopePolicy & SSRF-safe redirect handler
├── docs/
│ └── artex-architecture.md # AGX design doc: ARTEX ideas → here (deep notes)
├── skills/
│ └── pentest-suite-harness/
│ ├── SKILL.md # Agent skill for scoped verification & MCP workflows
│ └── assets/ # Thread index & evidence handoff Markdown templates
├── tests/
│ ├── test_core.py # Offline core & module tests
│ ├── test_strix_features.py # SARIF, coverage, API specs, CLI gate & URL safety tests
│ ├── test_templates.py # Per-template behavioral & catalog schema tests
│ ├── test_harness_lot1.py # Coverage caveats, confidence calibration & version provenance tests
│ ├── test_harness_lot2.py # ScopePolicy & redirect/SSRF boundary tests
│ ├── test_harness_lot3.py # MCP max_items/save, telemetry JSONL & skill tests
│ ├── test_artex_guard.py # AGX: block codes, platform-control framing, audit ring, G5 attribution
│ ├── test_artex_intents.py # AGX: intent frontier, terminal reasons, stagnation, ruled_out
│ ├── test_artex_ops.py # AGX: noise profiles, run budget, constraints freeze
│ ├── test_artex_poe_wrapup.py # AGX: PoE levels, verbatim quotes, wrap-up gaps
│ └── test_artex_retest_lessons.py # AGX: targeted retest verdicts, evidence-gated lessons
├── pyproject.toml # Project metadata & packaging configuration
└── README.md
```
---
## 🧩 Extending Pentest-Suite
### Adding a Detection Template
Create a JSON file in a category subdirectory of `pentest_suite/config/templates/` (`exposure/`, `management/`, `metadata/`, or a new slug of your choice):
```json
{
"id": "custom-check",
"info": {
"name": "Exposed Configuration File",
"severity": "high",
"cwe": "552",
"category": "exposure",
"references": ["https://owasp.org/Top10/A05_2021-Security_Misconfiguration/"],
"remediation": "Restrict public access to this path."
},
"requests": [
{ "path": "/config.json", "method": "GET" }
],
"matchers": [
{ "type": "status", "status": [200] },
{ "type": "contains", "words": ["\"database\":", "\"secret\":"], "any": false }
]
}
```
Optional `info` fields (inspired by kics query metadata): `cwe` (numeric CWE id as a string), `references` (list of official doc URLs), `category` — the loader enforces that `category` matches the subdirectory the file lives in — `confidence` (`confirmed` | `probable` | `possible`; explicit `confirmed` skips the wildcard counterevidence calibration) and `poe` (integer 0-4, ARTEX-style proof-of-exploitation level: L3+ only takes effect when the wildcard counterevidence actually applied and the match is `confirmed`, otherwise capped at L2).
Every template ships with its behavioral test cases in [`tests/test_templates.py`](file:///d:/GIT/pentest-suite/tests/test_templates.py): extend the `POSITIVE_ROUTES` stub with a route that triggers the new template (positive case) and make sure the 404 / neutral-200 negative servers do not match it.
### Adding a Custom Module
Subclass `BaseModule` and decorate with `@register`:
```python
from pentest_suite.core.plugin import BaseModule, register
@register
class MyScannerModule(BaseModule):
name = "myscan"
description = "Custom passive analyzer."
target_hint = "<target>"
def run(self, target: str, session, options: dict):
session.add_entity("custom", target, "myscan")
session.note("Custom scan completed.")
return []
```
---
## 🧪 Testing
Run the full offline test suite:
```bash
uv run python -m unittest discover -s tests -v
```
All unit tests run completely offline and verify models, deduplication, correlation, report generation, soft-404 logic, template matchers, and threat intelligence fallbacks in under 0.1s.
---
## 📄 License
This project is licensed under the [MIT License](LICENSE).
TDQS
Scored across 5 tools
Each tool targets a fairly distinct recon phase (HTTP probe, port scan, path discovery, template checks, vuln lookup). Minor overlap exists between probe and ports since both grab banners, and 'tmpl' is vague without reading its description.
All five names are single lowercase noun-like tokens following a consistent terse style. They deviate from a verb_noun convention, but the pattern itself is uniform and predictable.
Five tools is a lean but reasonable set for a recon/vuln-detection suite, and each earns its place. It's on the thin side for a 'pentest suite' but not mismatched.
Covers host probing, port scanning, dir discovery, template detections, and KEV lookup, but notable gaps remain: no subdomain/host enumeration, no exploitation/validation step, and no reporting or result aggregation.