Files
NeuroSploit/README.md
T

285 lines
16 KiB
Markdown
Executable File

<div align="center">
<img src="web/public/logo.svg" width="120" alt="NeuroSploit">
# NeuroSploit
**Autonomous penetration-testing harness — Rust, multi-model, CLI-first.**
[![Stars](https://img.shields.io/github/stars/JoasASantos/NeuroSploit?style=for-the-badge&logo=github&color=8b5cf6)](https://github.com/JoasASantos/NeuroSploit/stargazers)
[![Forks](https://img.shields.io/github/forks/JoasASantos/NeuroSploit?style=for-the-badge&logo=github&color=a855f7)](https://github.com/JoasASantos/NeuroSploit/network/members)
[![Issues](https://img.shields.io/github/issues/JoasASantos/NeuroSploit?style=for-the-badge&color=22d3ee)](https://github.com/JoasASantos/NeuroSploit/issues)
<br>
[![Rust](https://img.shields.io/badge/Rust-tokio%20async-e6b673?style=flat-square&logo=rust)](https://www.rust-lang.org)
[![License](https://img.shields.io/badge/License-MIT-green?style=flat-square)](LICENSE)
[![Agents](https://img.shields.io/badge/MD%20Agents-486-red?style=flat-square)](agents_md/)
[![Modes](https://img.shields.io/badge/Modes-8-9cf?style=flat-square)](#modes)
[![MCP Profiles](https://img.shields.io/badge/MCP%20Profiles-12-f59e0b?style=flat-square)](#mcp-profiles)
[![Providers](https://img.shields.io/badge/LLM%20Providers-24-38bdf8?style=flat-square)](#providers)
<br>
[**Website**](https://neurosploitai.github.io/) · [**Docs & Tutorial**](https://neurosploitai.github.io/docs.html) · [**TUTORIAL.md**](TUTORIAL.md) · [**BENCHMARK.md**](BENCHMARK.md)
</div>
---
## What is NeuroSploit?
Point it at a target. It runs the security assessment autonomously and hands you a report — recon, exploitation, chaining, validation — no human driving each step.
**The harness is the pentester, not the model.** A Rust engine runs the methodology: picks specialist agents for what it finds, runs them in parallel, re-sends every claim over the wire to confirm it's real, and has a second model check each finding before reporting. The LLMs are the hands; the harness is the discipline.
```
recon ─▶ select agents ─▶ exploit in parallel ─▶ wire-check ─▶ cross-model vote ─▶ chain ─▶ report
```
---
## Install
The installers work on a machine with nothing set up: they ask whether you want the **CLI**, the **web console + CLI**, or **everything** (CLI, web console, recon tools), then install what is missing (git, build tools, Node.js ≥ 18, nmap, typst…), put `neurosploit` and `neurosploit-web` on your PATH and set `NEUROSPLOIT_BASE`. Re-run them to update; config and runs are kept.
```bash
# Linux / macOS / WSL (x64 & arm64)
curl -fsSL https://raw.githubusercontent.com/JoasASantos/NeuroSploit/main/setup.sh | bash
./setup.sh --web --yes # unattended; also --cli / --all, --build, --service, --help
# Windows: double-click setup.bat, or
setup.bat web /y
irm https://raw.githubusercontent.com/JoasASantos/NeuroSploit/main/install.ps1 | iex
# From source
git clone https://github.com/JoasASantos/NeuroSploit && cd NeuroSploit/neurosploit-rs
cargo build --release # → target/release/neurosploit
```
## Quick Start
```bash
# Interactive wizard (asks everything):
neurosploit
# Black-box with subscription:
neurosploit run http://target.com --subscription --model anthropic:claude-opus-4-8 -v
# White-box source review:
neurosploit whitebox /path/to/repo --subscription --model anthropic:claude-opus-4-8 -v
# Host / AD / infra:
neurosploit host 10.0.0.5 --subscription --model anthropic:claude-opus-4-8 -v
# Web console:
neurosploit-web --open # → http://localhost:4173 (from a checkout: cd web && npm start)
```
---
## Modes
| Mode | Command | Surface |
|:-----|:--------|:--------|
| **Black-box** | `neurosploit run <url>` | Web apps, APIs — recon → exploit → vote → report |
| **White-box** | `neurosploit whitebox <repo>` | Source / SAST review (`file:line` evidence) |
| **Grey-box** | `neurosploit greybox <repo> --url <app>` | Code review **+** live exploitation |
| **Host / Infra** | `neurosploit host <ip>` | Linux, Windows, AD, cloud (AWS/GCP/Azure) |
| **AI / LLM** | `neurosploit aitest <ai-url>` | Jailbreaks, prompt injection, OWASP LLM Top 10 |
| **Mobile** | `neurosploit mobile <app.apk\|.ipa>` | APK/IPA RE (Ghidra / MobSF / Frida) |
| **Container** | `neurosploit container <image:tag>` | OCI scan + SBOM (trivy/grype/syft) |
| **Mission Control** | `neurosploit tui <url>` | Live TUI with mid-run composer |
---
## Architecture
```
┌─────────────────────────────────────────────────────────────┐
│ NeuroSploit Harness │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌────────────┐ │
│ │ Recon │─▶│ Select │─▶│ Parallel │─▶│ Validate │ │
│ │ Engine │ │ 486 MDs │ │ Exploit │ │ Wire+Vote │ │
│ └──────────┘ └──────────┘ └──────────┘ └────────────┘ │
│ │ │ │ │ │
│ ▼ ▼ ▼ ▼ │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ Attack Knowledge Graph (Neo4j opt.) │ │
│ │ Host → Service → Finding → Credential → Impact │ │
│ └──────────────────────────────────────────────────────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌──────────┐ ┌────────────┐ │
│ │ Chain │ │ Report │ │
│ │ Engine │ │ HTML·PDF·MD│ │
│ └──────────┘ └────────────┘ │
├─────────────────────────────────────────────────────────────┤
│ LLM Pool: Claude · GPT · Gemini · Grok · GLM · DeepSeek │
│ Qwen · Kimi · Mistral · Bedrock · Ollama · 24 providers │
└─────────────────────────────────────────────────────────────┘
```
---
## MCP Profiles
Built-in profiles swap the tool surface at runtime:
| Profile | Tools | Use Case |
|:--------|:------|:---------|
| `Web` | Playwright browser automation | Web app testing |
| `MobileAndroid` / `MobileIos` | REA reverse engineering | APK/IPA analysis |
| `BinaryAnalysis` | REA decompiler, call graphs | Native binary RE |
| `BurpSuite` | Burp REST API | Proxy-driven testing |
| `CobaltStrike` | Official CS MCP (team server) | C2 integration |
| `SliverC2` / `HavocC2` / `MythicC2` / `AdaptixC2` | C2 MCP (stdio / HTTP) | Session reuse and tasking |
| `Infra` / `Nmap` | Nmap MCP server | Network discovery |
| `AD` / `Kali` | Kali MCP (80+ tools) | AD / full toolkit |
| `Cloud` | Trivy, Prowler, ScoutSuite | Cloud posture |
```bash
neurosploit run http://target.com --mcp-profile web
neurosploit host 10.0.0.5 --mcp-profile ad
```
---
## Toolbox & C2
- **Toolbox (230+ tools):** nmap, rustscan, httpx, nuclei, ffuf, netexec, impacket, bloodhound, trivy, apktool, ghidra and more. `neurosploit tools list`
- **MCP servers:** `neurosploit tools mcp add nmap` then `--mcp`
- **C2 & WebShell:** Authorized engagements only. Listeners, sessions, tasks, payloads, audit trail under `.neurosploit/c2/`
- **Pivot Proxy:** Multi-hop tunnel engine through compromised hosts — portproxy, chisel, SOCKS. `--pivot-proxy auto`
---
## Offensive operations (authorized)
Opt-in, auditable red-team capabilities on top of the assessment harness. High-impact modules are **disabled by default** and gated by operator checkpoints.
- **Phishing (Evilginx):** `neurosploit phish …` — phishlet templates, campaigns and capture; requires an authorization reference + target/lure domain allow-lists.
- **Credential economy:** `neurosploit economy …` — one redacted vault for phishing captures and secrets harvested from JS/source/config; exports `creds.yaml` for authenticated testing.
- **C2 reuse (any MCP):** `neurosploit c2x …` — sync sessions from Sliver / Havoc / Mythic / Adaptix / Cobalt Strike (or any stdio/HTTP MCP), pick the best foothold, and task it (`c2x sync --profile sliver`, `c2x task --target <host> --cmd '<cmd>'`).
- **AD chain:** `neurosploit adchain …` — deterministic AD receipts (TGT/TGS, SMB-admin, DCSync, ADCS) from tool output, and a **fact-gated** chain (`smb-auth → roast/enum → abuse → dcsync → trust`). Receipts are classified automatically in both the reactive engine and the phased pipeline; `adchain plan` remains available for inspection.
- **Collection & exfiltration:** `neurosploit collect …` / `neurosploit exfil …` — per-run collection manifest (size + SHA-256 + sensitivity) and size-capped, hash-verified upload, gated by operator checkpoints.
- **OPSEC / evasion:** `neurosploit evasion …`; `--evasion` drops the `X-NeuroSploit-Scan` header to reduce attribution, and `evasion selfcheck` lists the framework's known fingerprints.
- **Worker tools & activity:** `--worker-tools` gives reactive workers a bounded, budgeted tool loop with cross-worker dedupe; `neurosploit activity …` shows the step-level tape workers share.
- **Operator checkpoints:** `--checkpoints off|record|enforce` gates DCSync, ADCS/delegation abuse, credential dumping, persistence, lateral exec, exfiltration and destructive commands.
---
## Zero-flag defaults (auto-config)
The backend turns on what it can detect, and everything is opt-out:
- **Reactive engine** by default for black-box runs (planner → workers → graph). `--no-reactive` / `NEUROSPLOIT_NO_REACTIVE=1` returns to the phased pipeline.
- **Models** from the API keys present; **toolbox + agent tool loop** when a real pentest tool is installed; **worker tool loop** in reactive; **MCP** when `mcp.servers.json` exists; **credential economy**.
- **Safe operational defaults:** PoC re-validation, OPSEC evasion (scan header dropped) and an already-present Kali sandbox.
Each has an explicit off switch: `--no-revalidate`, `--no-evasion`, `--no-sandbox`, and `--no-auto-config` disables all auto decisions. Authorization/high-impact flags (C2, phishing, scope, persistence, lateral, `--no-validate`, provisioning) are **never** auto-enabled.
CVE lookup and AD/host receipts are also part of the flow: fingerprints are enriched with known CVEs and tool output is classified into `ad:` facts that gate the next recipe step — in both engines.
---
## What Makes It Different
| Feature | How |
|:--------|:----|
| **Wire-bound evidence** | Every claim re-sent through scope-guarded replay engine |
| **Attack knowledge graph** | Typed graph: hosts, services, findings, credentials, impact |
| **Per-CWE validators** | Deterministic judgment on measured bytes, not prose |
| **Secret redaction** | Credentials become `$SECRET_n` in reports; raw in vault only |
| **Execution resilience** | 7 error types, exponential backoff, crash-state salvage, resume |
| **LLM-powered dedup** | Fast-path exact + semantic judge for same root cause |
| **Multi-hop pivoting** | Auto-detect unreachable subnets, establish tunnel chains |
| **Universal cache** | Identical prompts served from memory/disk — token savings |
| **Persistent planner + dual graph** | Planner-only intents, dependency-gated todolist, asset+exploration graph with anchors, resumable state |
| **Cost-aware worker tools** | Bounded tool loop per worker with a run-wide budget, priority-weighted rounds and cross-worker dedupe |
| **AD facts + recipes** | Deterministic AD receipts gate the chain step-by-step instead of trusting prose |
| **C2 reuse over any MCP** | Import/sync/task Sliver/Havoc/Mythic/Adaptix/CS sessions (stdio or HTTP MCP) |
| **Operator checkpoints** | High-impact actions (DCSync, ADCS, persistence, lateral, exfil) are recorded or blocked |
| **OPSEC controls** | Attribution-header suppression + fingerprint self-check for authorized stealth |
---
## Providers
24 LLM providers supported — API key, local subscription, or AWS Bedrock:
`anthropic` · `openai` · `gemini` · `azure` · `xai` · `nvidia_nim` · `deepseek` · `mistral` · `qwen` · `zai` · `moonshot` · `groq` · `together` · `openrouter` · `orcarouter` · `opencode` · `nous` · `venice` · `bedrock` · `ollama` · `llamacpp` · `vllm` · `lmstudio` · `litellm`
AWS Bedrock (native Converse/SigV4): `--model bedrock:<model-id>` with `AWS_ACCESS_KEY_ID` + `AWS_SECRET_ACCESS_KEY` (+ `AWS_SESSION_TOKEN`); region via `BEDROCK_REGION` / `AWS_REGION`.
OrcaRouter (OpenAI-compatible gateway): `ORCAROUTER_API_KEY` → `https://api.orcarouter.ai/v1`; e.g. `orcarouter:orcarouter/auto` or `orcarouter:deepseek/deepseek-v4.1-flash`. Keys are detected by the `sk-orca-` prefix.
Multi-model voting: `--model anthropic:claude-opus-4-8 --model openai:gpt-5.1 --vote-n 3`
---
## Web Console
| Home | Dashboard |
|:--:|:--:|
| ![Home](docs/screenshots/home-dark.png) | ![Dashboard](docs/screenshots/dash-light.png) |
| **Toolbox** | **Scope & safety** |
| ![Toolbox](docs/screenshots/toolbox-dark.png) | ![Scope & safety](docs/screenshots/guardrails-light.png) |
More screens (dark and light) in [docs/screenshots](docs/screenshots).
```bash
neurosploit-web --open # installed by setup.sh / setup.bat → http://localhost:4173
cd web && npm start # from a source checkout
```
- **Attack graph** — host → service → finding → credential → impact, with clickable filters
- **Live model catalog** — every provider fetches its full `/models` list (cached) plus a free-form custom model id
- **Settings → Defaults** — provider → model picker, listing only usable providers
- **Wire evidence** — real request/response pairs with wire provenance
- **Re-test** — re-run proof through replay engine
- **Chains & todo** — attack chains with validation status
- **Transcript viewer** — per-agent run split into navigable blocks
- **Workers** — planner todolist + step-level worker activity tape (searchable)
- **Phishing** — Evilginx phishlets / campaigns / captures (authorized, gated)
- **PDF export** — via Typst
---
## Run Output
Every run → `runs/ns-<ts>-<target>/`:
| File | Contents |
|:-----|:---------|
| `report.html` · `.pdf` · `.md` | Report (PDF via Typst), secrets redacted |
| `findings.json` / `.md` | Validated findings for tooling & re-testing |
| `report.sarif` | SARIF 2.1.0 for CI code-scanning |
| `graph/` | Attack chains, todo, Cypher + JSON export |
| `attack-paths.json` · `.mmd` | Cross-domain paths (graph + Mermaid) |
| `loot.json` | Credentials, tokens, hosts, endpoints |
| `activity/activity.jsonl` | Step-level worker activity (per intent/worker) |
| `collection/manifest.json` | Collected data with size + SHA-256 + sensitivity |
| `graphs/reactive-state.json` | Planner todolist + dual graph (resumable) |
| `pocs/` · `evidence/` | Runnable PoCs and proof screenshots |
---
## Integrations
GitHub / GitLab PR review gate · `@neurosploit` mention bot · Jira cards per finding · MCP server (`neurosploit mcp`) · Compliance mapping (PCI-DSS / HIPAA / SOC 2 / GDPR) · Neo4j graph · OpenSearch logs
---
## Safety
For **authorized** testing only. High-impact modules (C2, phishing, exfiltration) are opt-in and gated by operator checkpoints; agents stay in scope, require proof of exploitation, and do not run destructive/DoS actions without explicit authorization. You are responsible for having permission for every target.
---
<div align="center">
**Joas A Santos** & **Red Team Leaders** — MIT License
</div>