Skip to content

Commit 9d67c3f

Browse files
committed
docs: Update README with comprehensive CLI commands and Docker options
1 parent f1899fb commit 9d67c3f

1 file changed

Lines changed: 95 additions & 36 deletions

File tree

README.md

Lines changed: 95 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,57 @@
1-
# SecNode API Pentester
1+
# SecNode API
22

3-
SecNode is an autonomous API security testing agent. It starts with an OpenAPI/Swagger spec and uses a mix of traditional security tools and LLM reasoning to find vulnerabilities like BOLA, mass assignment, and business logic flaws.
3+
[![CI](https://github.com/SecNode/API-PENTESTER/actions/workflows/secnode-pentest.yml/badge.svg)](https://github.com/SecNode/API-PENTESTER/actions/workflows/secnode-pentest.yml)
4+
[![Python](https://img.shields.io/badge/python-3.9%2B-blue.svg)](https://www.python.org/downloads/)
5+
[![License](https://img.shields.io/badge/license-Apache%202.0-green.svg)](./LICENSE)
6+
7+
AI-augmented, schema-driven API penetration testing from OpenAPI/Swagger specs, with asynchronous execution and structured reporting.
8+
9+
## Why SecNode API
10+
11+
SecNode API helps security engineers and backend teams run repeatable API risk assessments in staging and CI without writing one-off test scripts for every target.
12+
13+
- Ingests local or remote OpenAPI/Swagger schema files
14+
- **Phase 1c Deep Recon:** Automatically analyzes body schemas and uses AI to plan `arjun` parameter discovery.
15+
- **Tool Orchestration:** Integrates `nuclei`, `sqlmap`, and `dirsearch` directly into the agent reasoning.
16+
- **AI-Driven Logic:** Uses an LLM to understand API behavior and generate adversarial test cases.
17+
- **Autonomous Agent:** Supports iterative replanning with request budgets and finding deduplication.
18+
- **Reporting:** Produces both human-readable Markdown and machine-readable JSON findings.
419

520
## How it works
621

7-
The pipeline runs in four distinct stages to ensure both shallow and deep coverage:
22+
The pipeline runs in four distinct stages:
823

9-
1. **Reconnaissance (Phase 1a/1b/1c)**
10-
- **Active Fuzzing:** Probes for undocumented paths, admin panels, and common file exposures.
11-
- **Tool Orchestration:** Runs `dirsearch` for directory discovery and `nuclei` for template-based scanning.
12-
- **Deep Analysis (New):** Deep-parses the API specification to pull out body fields and nested parameters. It then uses AI to plan and run `arjun` for hidden parameter discovery.
24+
1. **Reconnaissance (Phase 1a-c)**
25+
- **Active Fuzzing:** Probes for undocumented paths and common exposures.
26+
- **Tool Orchestration:** Runs `dirsearch` and `nuclei` for automated scanning.
27+
- **Deep Recon:** Deep-parses the spec for body fields and uses AI to find hidden parameters with `arjun`.
1328
2. **AI Analysis (Phase 2)**
14-
- An LLM analyzes the discovered API structure to understand business context and identify high-risk flows.
15-
- It generates adversarial test cases specifically tailored to the API's logic.
29+
- An LLM builds a business context model and identifies high-risk flows.
30+
- Generates adversarial test cases tailored to the specific API logic.
1631
3. **Execution & Validation (Phase 3)**
17-
- The agent executes the tests using adaptive concurrency.
18-
- Responses are analyzed by the AI to distinguish between real vulnerabilities and false positives.
32+
- Async execution of generated tests.
33+
- AI-based validation to confirm findings and assign CVSS scores.
1934
4. **Deduplication (Phase 4)**
20-
- The agent clusters findings sharing a root cause so you don't get 50 reports for the same underlying bug.
35+
- Clusters duplicate findings by root cause to provide a clean, actionable report.
2136

22-
## Getting Started
37+
## Installation
2338

24-
### Prerequisites
25-
- Python 3.10+
26-
- An API key for OpenAI, Anthropic, or Nebius
27-
- Docker (recommended for running the integrated tools)
39+
### Requirements
40+
- Python 3.9+
41+
- LLM API Key (OpenAI, Anthropic, or Nebius)
42+
- Docker (optional, but recommended for tool orchestration)
2843

29-
### Installation
44+
### Local Setup
3045
```bash
3146
git clone https://github.com/SecNode/API-PENTESTER.git
3247
cd API-PENTESTER
3348
pip install -e .
3449
```
3550

36-
### Configuration
37-
Set your LLM provider as an environment variable:
51+
## Configuration
52+
53+
Set your provider credentials before running scans:
54+
3855
```bash
3956
# Example for DeepSeek via Nebius
4057
export SECNODE_LLM="nebius/deepseek-ai/DeepSeek-V3.2"
@@ -44,30 +61,72 @@ export NEBIUS_API_BASE="https://api.tokenfactory.nebius.com/v1/"
4461

4562
## Usage
4663

47-
Run a basic scan:
64+
### CLI Commands
65+
66+
Run against a remote schema:
4867
```bash
49-
secnodeapi --target http://example.com/swagger.json
68+
secnodeapi --target https://api.example.com/swagger.json
5069
```
5170

52-
Run with Docker (easiest way to use all tools):
71+
Advanced options:
72+
```bash
73+
# Dry run to see generated tests
74+
secnodeapi --target ./openapi.yaml --dry-run --dry-run-output tests.json
75+
76+
# Authenticated scanning
77+
secnodeapi --target http://api.local/spec --auth-header "Authorization: Bearer <token>"
78+
79+
# Using a proxy (e.g. Burp Suite)
80+
secnodeapi --target http://api.local/spec --proxy http://127.0.0.1:8080 --insecure
81+
82+
# Agent fine-tuning
83+
secnodeapi --target http://api.local/spec --mode agent --request-budget 500 --max-iterations 5
84+
```
85+
86+
### Full CLI Options
87+
| Option | Description |
88+
|---|---|
89+
| `--target` | URL or local path to OpenAPI schema (required) |
90+
| `--mode` | `agent` (default) or `legacy` execution pipeline |
91+
| `--concurrency` | Concurrent request workers |
92+
| `--auth-header` | Single inline auth header |
93+
| `--auth-file` | JSON file of auth headers |
94+
| `--identities-file` | JSON identities for differential auth testing |
95+
| `--schema-only` | Output normalized API structure and exit |
96+
| `--dry-run` | Generate tests without executing |
97+
| `--request-budget` | Max request count in agent mode |
98+
| `--max-iterations` | Max plan/execute loops in agent mode |
99+
| `--proxy` | Route traffic via proxy |
100+
| `--insecure` | Disable TLS verification |
101+
102+
## Docker Support
103+
104+
The easiest way to run SecNode with all integrated tools (`nuclei`, `sqlmap`, `arjun`, `dirsearch`) is via Docker.
105+
106+
### Build
53107
```bash
54108
docker build -t secnodeapi .
55-
docker run --rm -v $(pwd)/results:/app/results -e NEBIUS_API_KEY="..." secnodeapi --target http://example.com/swagger.json
56109
```
57110

58-
## Project Structure
59-
- `src/secnodeapi/services/recon.py`: The initial path fuzzer.
60-
- `src/secnodeapi/services/deep_recon.py`: The new AI-driven parameter discovery layer.
61-
- `src/secnodeapi/services/tool_orchestrator.py`: Orchestrates Nuclei, SQLMap, etc.
62-
- `src/secnodeapi/ai/`: LLM logic for analysis, test generation, and validation.
63-
- `src/secnodeapi/tools/runners/`: Adapters for external CLI tools.
111+
### Run
112+
```bash
113+
docker run --rm \
114+
-v $(pwd)/results:/app/results \
115+
-e NEBIUS_API_KEY="your-key" \
116+
secnodeapi --target http://api.example.com/swagger.json
117+
```
118+
119+
### Docker Compose
120+
```bash
121+
docker-compose run --rm secnodeapi --target http://api.example.com/swagger.json
122+
```
64123

65124
## Shout-outs
66-
This project stands on the shoulders of some incredible open-source security tools:
67-
- **[Nuclei](https://github.com/projectdiscovery/nuclei)** for template-based scanning.
68-
- **[SQLMap](https://github.com/sqlmapproject/sqlmap)** for the industry-standard SQLi detection.
69-
- **[Dirsearch](https://github.com/maurosoria/dirsearch)** for efficient path enumeration.
70-
- **[Arjun](https://github.com/s0md3v/Arjun)** for finding those hidden parameters.
125+
Special thanks to the open-source projects that power our orchestration:
126+
- **[Nuclei](https://github.com/projectdiscovery/nuclei)**
127+
- **[SQLMap](https://github.com/sqlmapproject/sqlmap)**
128+
- **[Dirsearch](https://github.com/maurosoria/dirsearch)**
129+
- **[Arjun](https://github.com/s0md3v/Arjun)**
71130

72131
---
73-
Built by SecNode. [Report an issue](https://github.com/SecNode/API-PENTESTER/issues).
132+
Built by SecNode. [Report an issue](https://github.com/SecNode/API-PENTESTER/issues).

0 commit comments

Comments
 (0)