zen-ai-pentest 2.0.0__py3-none-any.whl
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.
- agents/__init__.py +28 -0
- agents/agent_base.py +239 -0
- agents/agent_orchestrator.py +346 -0
- agents/analysis_agent.py +225 -0
- agents/cli.py +258 -0
- agents/exploit_agent.py +224 -0
- agents/integration.py +211 -0
- agents/post_scan_agent.py +937 -0
- agents/react_agent.py +384 -0
- agents/react_agent_enhanced.py +616 -0
- agents/react_agent_vm.py +298 -0
- agents/research_agent.py +176 -0
- api/__init__.py +11 -0
- api/auth.py +123 -0
- api/main.py +1027 -0
- api/schemas.py +357 -0
- api/websocket.py +97 -0
- autonomous/__init__.py +122 -0
- autonomous/agent.py +253 -0
- autonomous/agent_loop.py +1370 -0
- autonomous/exploit_validator.py +1537 -0
- autonomous/memory.py +448 -0
- autonomous/react.py +339 -0
- autonomous/tool_executor.py +488 -0
- backends/__init__.py +16 -0
- backends/chatgpt_direct.py +133 -0
- backends/claude_direct.py +130 -0
- backends/duckduckgo.py +138 -0
- backends/openrouter.py +120 -0
- benchmarks/__init__.py +149 -0
- benchmarks/benchmark_engine.py +904 -0
- benchmarks/ci_benchmark.py +785 -0
- benchmarks/comparison.py +729 -0
- benchmarks/metrics.py +553 -0
- benchmarks/run_benchmarks.py +809 -0
- ci_cd/__init__.py +2 -0
- core/__init__.py +17 -0
- core/async_pool.py +282 -0
- core/asyncio_fix.py +222 -0
- core/cache.py +472 -0
- core/container.py +277 -0
- core/database.py +114 -0
- core/input_validator.py +353 -0
- core/models.py +288 -0
- core/orchestrator.py +611 -0
- core/plugin_manager.py +571 -0
- core/rate_limiter.py +405 -0
- core/secure_config.py +328 -0
- core/shield_integration.py +296 -0
- modules/__init__.py +46 -0
- modules/cve_database.py +362 -0
- modules/exploit_assist.py +330 -0
- modules/nuclei_integration.py +480 -0
- modules/osint.py +604 -0
- modules/protonvpn.py +554 -0
- modules/recon.py +165 -0
- modules/sql_injection_db.py +826 -0
- modules/tool_orchestrator.py +498 -0
- modules/vuln_scanner.py +292 -0
- modules/wordlist_generator.py +566 -0
- risk_engine/__init__.py +99 -0
- risk_engine/business_impact.py +267 -0
- risk_engine/business_impact_calculator.py +563 -0
- risk_engine/cvss.py +156 -0
- risk_engine/epss.py +190 -0
- risk_engine/example_usage.py +294 -0
- risk_engine/false_positive_engine.py +1073 -0
- risk_engine/scorer.py +304 -0
- web_ui/backend/main.py +471 -0
- zen_ai_pentest-2.0.0.dist-info/METADATA +795 -0
- zen_ai_pentest-2.0.0.dist-info/RECORD +75 -0
- zen_ai_pentest-2.0.0.dist-info/WHEEL +5 -0
- zen_ai_pentest-2.0.0.dist-info/entry_points.txt +2 -0
- zen_ai_pentest-2.0.0.dist-info/licenses/LICENSE +21 -0
- zen_ai_pentest-2.0.0.dist-info/top_level.txt +10 -0
|
@@ -0,0 +1,795 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: zen-ai-pentest
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: Advanced AI-Powered Penetration Testing Framework with Multi-Agent Orchestration
|
|
5
|
+
Home-page: https://github.com/SHAdd0WTAka/zen-ai-pentest
|
|
6
|
+
Author: SHAdd0WTAka
|
|
7
|
+
Author-email: SHAdd0WTAka <shadd0wtaka@example.com>
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Homepage, https://github.com/SHAdd0WTAka/zen-ai-pentest
|
|
10
|
+
Project-URL: Documentation, https://github.com/SHAdd0WTAka/zen-ai-pentest/tree/main/docs
|
|
11
|
+
Project-URL: Repository, https://github.com/SHAdd0WTAka/zen-ai-pentest.git
|
|
12
|
+
Project-URL: Bug Tracker, https://github.com/SHAdd0WTAka/zen-ai-pentest/issues
|
|
13
|
+
Project-URL: Changelog, https://github.com/SHAdd0WTAka/zen-ai-pentest/releases
|
|
14
|
+
Project-URL: Discussions, https://github.com/SHAdd0WTAka/zen-ai-pentest/discussions
|
|
15
|
+
Keywords: penetration-testing,security,ai,llm,multi-agent,cve,vulnerability-scanner,pentest
|
|
16
|
+
Classifier: Development Status :: 4 - Beta
|
|
17
|
+
Classifier: Intended Audience :: Information Technology
|
|
18
|
+
Classifier: Topic :: Security
|
|
19
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
20
|
+
Classifier: Programming Language :: Python :: 3
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
26
|
+
Classifier: Operating System :: OS Independent
|
|
27
|
+
Requires-Python: >=3.9
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
License-File: LICENSE
|
|
30
|
+
Requires-Dist: requests>=2.31.0
|
|
31
|
+
Requires-Dist: aiohttp>=3.9.0
|
|
32
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
33
|
+
Requires-Dist: pydantic>=2.0.0
|
|
34
|
+
Requires-Dist: fastapi>=0.104.0
|
|
35
|
+
Requires-Dist: uvicorn>=0.24.0
|
|
36
|
+
Provides-Extra: dev
|
|
37
|
+
Requires-Dist: pytest>=7.4.0; extra == "dev"
|
|
38
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
39
|
+
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
|
|
40
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
41
|
+
Requires-Dist: isort>=5.12.0; extra == "dev"
|
|
42
|
+
Requires-Dist: flake8>=6.1.0; extra == "dev"
|
|
43
|
+
Requires-Dist: bandit>=1.7.5; extra == "dev"
|
|
44
|
+
Requires-Dist: safety>=2.3.0; extra == "dev"
|
|
45
|
+
Requires-Dist: mypy>=1.5.0; extra == "dev"
|
|
46
|
+
Requires-Dist: pre-commit>=3.5.0; extra == "dev"
|
|
47
|
+
Provides-Extra: docs
|
|
48
|
+
Requires-Dist: mkdocs>=1.5.0; extra == "docs"
|
|
49
|
+
Requires-Dist: mkdocs-material>=9.4.0; extra == "docs"
|
|
50
|
+
Requires-Dist: mkdocstrings[python]>=0.23.0; extra == "docs"
|
|
51
|
+
Dynamic: author
|
|
52
|
+
Dynamic: home-page
|
|
53
|
+
Dynamic: license-file
|
|
54
|
+
Dynamic: requires-python
|
|
55
|
+
|
|
56
|
+
# Zen-AI-Pentest
|
|
57
|
+
|
|
58
|
+
> 🛡️ **Professional AI-Powered Penetration Testing Framework**
|
|
59
|
+
|
|
60
|
+
[](https://python.org)
|
|
61
|
+
[](https://fastapi.tiangolo.com)
|
|
62
|
+
[](LICENSE)
|
|
63
|
+
[](docker/)
|
|
64
|
+
[](tests/)
|
|
65
|
+
[](https://github.com/SHAdd0WTAka/zen-ai-pentest/releases)
|
|
66
|
+
[](#-authors--team)
|
|
67
|
+
[](ROADMAP_2026.md)
|
|
68
|
+
|
|
69
|
+
**Zen-AI-Pentest** is an autonomous, AI-powered penetration testing framework that combines cutting-edge language models with professional security tools. Built for security professionals, bug bounty hunters, and enterprise security teams.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## ✨ Features
|
|
74
|
+
|
|
75
|
+
### 🤖 Autonomous AI Agent
|
|
76
|
+
- **ReAct Pattern**: Reason → Act → Observe → Reflect
|
|
77
|
+
- **State Machine**: IDLE → PLANNING → EXECUTING → OBSERVING → REFLECTING → COMPLETED
|
|
78
|
+
- **Memory System**: Short-term, long-term, and context window management
|
|
79
|
+
- **Tool Orchestration**: Automatic selection and execution of 20+ pentesting tools
|
|
80
|
+
- **Self-Correction**: Retry logic and adaptive planning
|
|
81
|
+
- **Human-in-the-Loop**: Optional pause for critical decisions
|
|
82
|
+
|
|
83
|
+
### 🎯 Risk Engine
|
|
84
|
+
- **False Positive Reduction**: Multi-factor validation with Bayesian filtering
|
|
85
|
+
- **Business Impact**: Financial, compliance, and reputation risk calculation
|
|
86
|
+
- **CVSS/EPSS Scoring**: Industry-standard vulnerability assessment
|
|
87
|
+
- **Priority Ranking**: Automated finding prioritization
|
|
88
|
+
- **LLM Voting**: Multi-model consensus for accuracy
|
|
89
|
+
|
|
90
|
+
### 🔒 Exploit Validation
|
|
91
|
+
- **Sandboxed Execution**: Docker-based isolated testing
|
|
92
|
+
- **Safety Controls**: 4-level safety system (Read-Only to Full)
|
|
93
|
+
- **Evidence Collection**: Screenshots, HTTP captures, PCAP
|
|
94
|
+
- **Chain of Custody**: Complete audit trail
|
|
95
|
+
- **Remediation**: Automatic fix recommendations
|
|
96
|
+
|
|
97
|
+
### 📊 Benchmarking
|
|
98
|
+
- **Competitor Comparison**: vs PentestGPT, AutoPentest, Manual
|
|
99
|
+
- **Test Scenarios**: HTB machines, OWASP WebGoat, DVWA
|
|
100
|
+
- **Metrics**: Time-to-find, coverage, false positive rate
|
|
101
|
+
- **Visual Reports**: Charts and statistical analysis
|
|
102
|
+
- **CI Integration**: Automated regression testing
|
|
103
|
+
|
|
104
|
+
### 🔗 CI/CD Integration
|
|
105
|
+
- **GitHub Actions**: Native action support
|
|
106
|
+
- **GitLab CI**: Pipeline integration
|
|
107
|
+
- **Jenkins**: Plugin and pipeline support
|
|
108
|
+
- **Output Formats**: JSON, JUnit XML, SARIF
|
|
109
|
+
- **Notifications**: Slack, JIRA, Email alerts
|
|
110
|
+
- **Exit Codes**: Pipeline-friendly status codes
|
|
111
|
+
|
|
112
|
+
### 🛠️ 20+ Integrated Tools
|
|
113
|
+
| Category | Tools |
|
|
114
|
+
|----------|-------|
|
|
115
|
+
| **Network** | Nmap, Masscan, Scapy, Tshark |
|
|
116
|
+
| **Web** | BurpSuite, SQLMap, Gobuster, OWASP ZAP |
|
|
117
|
+
| **Exploitation** | Metasploit Framework |
|
|
118
|
+
| **Brute Force** | Hydra, Hashcat |
|
|
119
|
+
| **Reconnaissance** | Amass, Nuclei, TheHarvester |
|
|
120
|
+
| **Active Directory** | BloodHound, CrackMapExec, Responder |
|
|
121
|
+
| **Wireless** | Aircrack-ng Suite |
|
|
122
|
+
|
|
123
|
+
### ☁️ Multi-Cloud & Virtualization
|
|
124
|
+
- **Local**: VirtualBox VM Management
|
|
125
|
+
- **Cloud**: AWS EC2, Azure VMs, Google Cloud Compute
|
|
126
|
+
- **Snapshots**: Automated clean-state workflows
|
|
127
|
+
- **Guest Control**: Execute tools inside isolated VMs
|
|
128
|
+
|
|
129
|
+
### 🚀 Modern API & Backend
|
|
130
|
+
- **FastAPI**: High-performance REST API
|
|
131
|
+
- **PostgreSQL**: Persistent data storage
|
|
132
|
+
- **WebSocket**: Real-time scan updates
|
|
133
|
+
- **JWT Auth**: Role-based access control (RBAC)
|
|
134
|
+
- **Background Tasks**: Async scan execution
|
|
135
|
+
|
|
136
|
+
### 📊 Reporting & Notifications
|
|
137
|
+
- **PDF Reports**: Professional findings reports
|
|
138
|
+
- **HTML Dashboard**: Interactive web interface
|
|
139
|
+
- **Slack/Email**: Instant notifications
|
|
140
|
+
- **JSON/XML**: Integration with other tools
|
|
141
|
+
|
|
142
|
+
### 🐳 Easy Deployment
|
|
143
|
+
- **Docker Compose**: One-command full stack deployment
|
|
144
|
+
- **CI/CD**: GitHub Actions pipeline
|
|
145
|
+
- **Production Ready**: Optimized for enterprise use
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## 🚀 Quick Start
|
|
150
|
+
|
|
151
|
+
### Option 1: Docker (Recommended)
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
# Clone repository
|
|
155
|
+
git clone https://github.com/SHAdd0WTAka/zen-ai-pentest.git
|
|
156
|
+
cd zen-ai-pentest
|
|
157
|
+
|
|
158
|
+
# Copy and configure environment
|
|
159
|
+
cp .env.example .env
|
|
160
|
+
# Edit .env with your settings
|
|
161
|
+
|
|
162
|
+
# Start full stack
|
|
163
|
+
cd docker
|
|
164
|
+
docker-compose -f docker-compose.full.yml up -d
|
|
165
|
+
|
|
166
|
+
# Access:
|
|
167
|
+
# Dashboard: http://localhost:3000
|
|
168
|
+
# API Docs: http://localhost:8000/docs
|
|
169
|
+
# API: http://localhost:8000
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Option 2: Local Installation
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
# Install dependencies
|
|
176
|
+
pip install -r requirements.txt
|
|
177
|
+
|
|
178
|
+
# Initialize database
|
|
179
|
+
python database/models.py
|
|
180
|
+
|
|
181
|
+
# Start API server
|
|
182
|
+
python api/main.py
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### Option 3: VirtualBox VM Setup
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
# Automated Kali Linux setup
|
|
189
|
+
python scripts/setup_vms.py --kali
|
|
190
|
+
|
|
191
|
+
# Manual setup
|
|
192
|
+
# See docs/setup/VIRTUALBOX_SETUP.md
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## 📖 Usage
|
|
198
|
+
|
|
199
|
+
### Python API
|
|
200
|
+
|
|
201
|
+
```python
|
|
202
|
+
from agents.react_agent import ReActAgent, ReActAgentConfig
|
|
203
|
+
|
|
204
|
+
# Configure agent
|
|
205
|
+
config = ReActAgentConfig(
|
|
206
|
+
max_iterations=10,
|
|
207
|
+
use_vm=True,
|
|
208
|
+
vm_name="kali-pentest"
|
|
209
|
+
)
|
|
210
|
+
|
|
211
|
+
# Create agent
|
|
212
|
+
agent = ReActAgent(config)
|
|
213
|
+
|
|
214
|
+
# Run autonomous scan
|
|
215
|
+
result = agent.run(
|
|
216
|
+
target="example.com",
|
|
217
|
+
objective="Comprehensive security assessment"
|
|
218
|
+
)
|
|
219
|
+
|
|
220
|
+
# Generate report
|
|
221
|
+
print(agent.generate_report(result))
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### REST API
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
# Authentication
|
|
228
|
+
curl -X POST http://localhost:8000/auth/login \
|
|
229
|
+
-H "Content-Type: application/json" \
|
|
230
|
+
-d '{"username":"admin","password":"admin"}'
|
|
231
|
+
|
|
232
|
+
# Create scan
|
|
233
|
+
curl -X POST http://localhost:8000/scans \
|
|
234
|
+
-H "Authorization: Bearer $TOKEN" \
|
|
235
|
+
-H "Content-Type: application/json" \
|
|
236
|
+
-d '{
|
|
237
|
+
"name":"Network Scan",
|
|
238
|
+
"target":"192.168.1.0/24",
|
|
239
|
+
"scan_type":"network",
|
|
240
|
+
"config":{"ports":"top-1000"}
|
|
241
|
+
}'
|
|
242
|
+
|
|
243
|
+
# Execute tool
|
|
244
|
+
curl -X POST http://localhost:8000/tools/execute \
|
|
245
|
+
-H "Authorization: Bearer $TOKEN" \
|
|
246
|
+
-d '{
|
|
247
|
+
"tool_name":"nmap_scan",
|
|
248
|
+
"target":"scanme.nmap.org",
|
|
249
|
+
"parameters":{"ports":"22,80,443"}
|
|
250
|
+
}'
|
|
251
|
+
|
|
252
|
+
# Generate report
|
|
253
|
+
curl -X POST http://localhost:8000/reports \
|
|
254
|
+
-H "Authorization: Bearer $TOKEN" \
|
|
255
|
+
-d '{
|
|
256
|
+
"scan_id":1,
|
|
257
|
+
"format":"pdf",
|
|
258
|
+
"template":"default"
|
|
259
|
+
}'
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### WebSocket (Real-Time)
|
|
263
|
+
|
|
264
|
+
```javascript
|
|
265
|
+
const ws = new WebSocket('ws://localhost:8000/ws/scans/1');
|
|
266
|
+
|
|
267
|
+
ws.onmessage = (event) => {
|
|
268
|
+
const data = JSON.parse(event.data);
|
|
269
|
+
console.log('Scan update:', data);
|
|
270
|
+
};
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
## 🏗️ Architecture
|
|
276
|
+
|
|
277
|
+
```
|
|
278
|
+
┌─────────────────────────────────────────────────────────────────────────┐
|
|
279
|
+
│ ZEN-AI-PENTEST v2.0 - System Architecture │
|
|
280
|
+
├─────────────────────────────────────────────────────────────────────────┤
|
|
281
|
+
│ │
|
|
282
|
+
│ ┌─────────────────────────────────────────────────────────────────┐ │
|
|
283
|
+
│ │ FRONTEND LAYER │ │
|
|
284
|
+
│ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────────────┐ │ │
|
|
285
|
+
│ │ │ React │ │ WebSocket │ │ CLI Interface │ │ │
|
|
286
|
+
│ │ │ Dashboard │ │ Client │ │ (Rich/Typer) │ │ │
|
|
287
|
+
│ │ └──────────────┘ └──────────────┘ └──────────────────────┘ │ │
|
|
288
|
+
│ └─────────────────────────────────────────────────────────────────┘ │
|
|
289
|
+
│ │ │
|
|
290
|
+
│ ▼ │
|
|
291
|
+
│ ┌─────────────────────────────────────────────────────────────────┐ │
|
|
292
|
+
│ │ API LAYER (FastAPI) │ │
|
|
293
|
+
│ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────────────┐ │ │
|
|
294
|
+
│ │ │ Auth │ │ Scans │ │ Integrations │ │ │
|
|
295
|
+
│ │ │ (JWT) │ │ CRUD API │ │ (GitHub/Slack) │ │ │
|
|
296
|
+
│ │ └──────────────┘ └──────────────┘ └──────────────────────┘ │ │
|
|
297
|
+
│ └─────────────────────────────────────────────────────────────────┘ │
|
|
298
|
+
│ │ │
|
|
299
|
+
│ ▼ │
|
|
300
|
+
│ ┌─────────────────────────────────────────────────────────────────┐ │
|
|
301
|
+
│ │ AUTONOMOUS LAYER │ │
|
|
302
|
+
│ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────────────┐ │ │
|
|
303
|
+
│ │ │ ReAct │ │ Memory │ │ Exploit Validator │ │ │
|
|
304
|
+
│ │ │ Loop │ │ System │ │ (Sandboxed) │ │ │
|
|
305
|
+
│ │ └──────────────┘ └──────────────┘ └──────────────────────┘ │ │
|
|
306
|
+
│ └─────────────────────────────────────────────────────────────────┘ │
|
|
307
|
+
│ │ │
|
|
308
|
+
│ ▼ │
|
|
309
|
+
│ ┌─────────────────────────────────────────────────────────────────┐ │
|
|
310
|
+
│ │ RISK ENGINE LAYER │ │
|
|
311
|
+
│ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────────────┐ │ │
|
|
312
|
+
│ │ │ False │ │ Business │ │ CVSS/EPSS │ │ │
|
|
313
|
+
│ │ │ Positive │ │ Impact │ │ Scoring │ │ │
|
|
314
|
+
│ │ └──────────────┘ └──────────────┘ └──────────────────────┘ │ │
|
|
315
|
+
│ └─────────────────────────────────────────────────────────────────┘ │
|
|
316
|
+
│ │ │
|
|
317
|
+
│ ▼ │
|
|
318
|
+
│ ┌─────────────────────────────────────────────────────────────────┐ │
|
|
319
|
+
│ │ TOOLS LAYER (20+) │ │
|
|
320
|
+
│ │ ┌──────────────────────────────────────────────────────────┐ │ │
|
|
321
|
+
│ │ │ Network: Nmap | Masscan | Scapy | Tshark │ │ │
|
|
322
|
+
│ │ │ Web: BurpSuite | SQLMap | Gobuster | Nuclei | ZAP │ │ │
|
|
323
|
+
│ │ │ Exploit: Metasploit | SearchSploit | ExploitDB │ │ │
|
|
324
|
+
│ │ │ AD: BloodHound | CrackMapExec | Responder │ │ │
|
|
325
|
+
│ │ └──────────────────────────────────────────────────────────┘ │ │
|
|
326
|
+
│ └─────────────────────────────────────────────────────────────────┘ │
|
|
327
|
+
│ │ │
|
|
328
|
+
│ ▼ │
|
|
329
|
+
│ ┌─────────────────────────────────────────────────────────────────┐ │
|
|
330
|
+
│ │ DATA & REPORTING LAYER │ │
|
|
331
|
+
│ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────────────┐ │ │
|
|
332
|
+
│ │ │ PostgreSQL │ │ Benchmarks │ │ Report Generator │ │ │
|
|
333
|
+
│ │ │ (Main DB) │ │ & Metrics │ │ (PDF/HTML/JSON) │ │ │
|
|
334
|
+
│ │ └──────────────┘ └──────────────┘ └──────────────────────┘ │ │
|
|
335
|
+
│ └─────────────────────────────────────────────────────────────────┘ │
|
|
336
|
+
│ │
|
|
337
|
+
└─────────────────────────────────────────────────────────────────────────┘
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
---
|
|
341
|
+
|
|
342
|
+
## 📁 Project Structure
|
|
343
|
+
|
|
344
|
+
```
|
|
345
|
+
zen-ai-pentest/
|
|
346
|
+
├── api/ # FastAPI Backend
|
|
347
|
+
│ ├── main.py # API Server
|
|
348
|
+
│ ├── schemas.py # Pydantic Models
|
|
349
|
+
│ ├── auth.py # JWT Authentication
|
|
350
|
+
│ └── websocket.py # WebSocket Manager
|
|
351
|
+
├── agents/ # AI Agents
|
|
352
|
+
│ ├── react_agent.py # ReAct Agent
|
|
353
|
+
│ └── react_agent_vm.py # VM-based Agent
|
|
354
|
+
├── database/ # Database Layer
|
|
355
|
+
│ └── models.py # SQLAlchemy Models
|
|
356
|
+
├── virtualization/ # VM Management
|
|
357
|
+
│ ├── vm_manager.py # VirtualBox
|
|
358
|
+
│ └── cloud_vm_manager.py # AWS/Azure/GCP
|
|
359
|
+
├── tools/ # Pentesting Tools
|
|
360
|
+
│ ├── nmap_integration.py
|
|
361
|
+
│ ├── sqlmap_integration.py
|
|
362
|
+
│ ├── metasploit_integration.py
|
|
363
|
+
│ └── ... (20+ tools)
|
|
364
|
+
├── gui/ # Web Interface
|
|
365
|
+
│ └── vm_manager_gui.py # React Dashboard
|
|
366
|
+
├── reports/ # Report Generation
|
|
367
|
+
│ └── generator.py # PDF/HTML/JSON
|
|
368
|
+
├── notifications/ # Alerts
|
|
369
|
+
│ ├── slack.py
|
|
370
|
+
│ └── email.py
|
|
371
|
+
├── docker/ # Deployment
|
|
372
|
+
│ ├── Dockerfile
|
|
373
|
+
│ └── docker-compose.full.yml
|
|
374
|
+
├── docs/ # Documentation
|
|
375
|
+
│ ├── setup/
|
|
376
|
+
│ └── research/
|
|
377
|
+
├── scripts/ # Setup Scripts
|
|
378
|
+
│ └── setup_vms.py
|
|
379
|
+
└── tests/ # Test Suite
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
---
|
|
383
|
+
|
|
384
|
+
## 🔧 Configuration
|
|
385
|
+
|
|
386
|
+
### Environment Variables
|
|
387
|
+
|
|
388
|
+
```env
|
|
389
|
+
# Database
|
|
390
|
+
DATABASE_URL=postgresql://postgres:password@localhost:5432/zen_pentest
|
|
391
|
+
|
|
392
|
+
# Security
|
|
393
|
+
SECRET_KEY=your-secret-key-here
|
|
394
|
+
JWT_EXPIRATION=3600
|
|
395
|
+
|
|
396
|
+
# Notifications
|
|
397
|
+
SLACK_WEBHOOK_URL=https://hooks.slack.com/...
|
|
398
|
+
SMTP_HOST=smtp.gmail.com
|
|
399
|
+
SMTP_USER=user@gmail.com
|
|
400
|
+
SMTP_PASS=password
|
|
401
|
+
|
|
402
|
+
# Cloud Providers
|
|
403
|
+
AWS_ACCESS_KEY_ID=AKIA...
|
|
404
|
+
AWS_SECRET_ACCESS_KEY=...
|
|
405
|
+
AZURE_SUBSCRIPTION_ID=...
|
|
406
|
+
GCP_PROJECT_ID=...
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
See `.env.example` for all options.
|
|
410
|
+
|
|
411
|
+
---
|
|
412
|
+
|
|
413
|
+
## 🧪 Testing
|
|
414
|
+
|
|
415
|
+
```bash
|
|
416
|
+
# Run all tests
|
|
417
|
+
pytest
|
|
418
|
+
|
|
419
|
+
# With coverage
|
|
420
|
+
pytest --cov=. --cov-report=html
|
|
421
|
+
|
|
422
|
+
# Specific test file
|
|
423
|
+
pytest tests/test_react_agent.py -v
|
|
424
|
+
|
|
425
|
+
# Integration tests
|
|
426
|
+
pytest tests/integration/ -v
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
---
|
|
430
|
+
|
|
431
|
+
## 📚 Documentation
|
|
432
|
+
|
|
433
|
+
- [Setup Guide](docs/setup/VIRTUALBOX_SETUP.md) - VM installation & configuration
|
|
434
|
+
- [API Documentation](docs/API.md) - REST API reference
|
|
435
|
+
- [Architecture](docs/ARCHITECTURE.md) - System design
|
|
436
|
+
- [Tool Research](docs/research/FUNDAMENTAL_PENTEST_TOOLS.md) - Tool analysis
|
|
437
|
+
|
|
438
|
+
---
|
|
439
|
+
|
|
440
|
+
## 🤝 Contributing
|
|
441
|
+
|
|
442
|
+
1. Fork the repository
|
|
443
|
+
2. Create feature branch (`git checkout -b feature/amazing-feature`)
|
|
444
|
+
3. Commit changes (`git commit -m 'Add amazing feature'`)
|
|
445
|
+
4. Push to branch (`git push origin feature/amazing-feature`)
|
|
446
|
+
5. Open Pull Request
|
|
447
|
+
|
|
448
|
+
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details.
|
|
449
|
+
|
|
450
|
+
---
|
|
451
|
+
|
|
452
|
+
## ⚠️ Disclaimer
|
|
453
|
+
|
|
454
|
+
**IMPORTANT**: This tool is for authorized security testing only. Always obtain proper permission before testing any system you do not own. Unauthorized access to computer systems is illegal.
|
|
455
|
+
|
|
456
|
+
- Use only on systems you have explicit permission to test
|
|
457
|
+
- Respect privacy and data protection laws
|
|
458
|
+
- The authors assume no liability for misuse or damage
|
|
459
|
+
|
|
460
|
+
---
|
|
461
|
+
|
|
462
|
+
## 📄 License
|
|
463
|
+
|
|
464
|
+
This project is licensed under the MIT License - see [LICENSE](LICENSE) file for details.
|
|
465
|
+
|
|
466
|
+
---
|
|
467
|
+
|
|
468
|
+
## 🙏 Acknowledgments
|
|
469
|
+
|
|
470
|
+
- [LangGraph](https://github.com/langchain-ai/langgraph) - Agent framework
|
|
471
|
+
- [FastAPI](https://fastapi.tiangolo.com/) - Web framework
|
|
472
|
+
- [Kali Linux](https://www.kali.org/) - Penetration testing distribution
|
|
473
|
+
- All open-source security tool creators
|
|
474
|
+
|
|
475
|
+
---
|
|
476
|
+
|
|
477
|
+
## 🎯 Advanced Features
|
|
478
|
+
|
|
479
|
+
### Autonomous Mode
|
|
480
|
+
|
|
481
|
+
The autonomous agent uses ReAct (Reasoning + Acting) pattern for fully automated penetration testing:
|
|
482
|
+
|
|
483
|
+
```bash
|
|
484
|
+
# Run autonomous scan
|
|
485
|
+
zen-ai-pentest --autonomous --target example.com --goal "Find all vulnerabilities"
|
|
486
|
+
|
|
487
|
+
# With custom scope
|
|
488
|
+
zen-ai-pentest --autonomous --target example.com --scope config/autonomous.json
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
**Features:**
|
|
492
|
+
- **State Machine**: PLANNING → EXECUTING → OBSERVING → REFLECTING → COMPLETED
|
|
493
|
+
- **Memory Management**: Short-term, long-term, and context window
|
|
494
|
+
- **Tool Orchestration**: Automatic selection and execution of 20+ tools
|
|
495
|
+
- **Self-Correction**: Retry logic and error recovery
|
|
496
|
+
- **Human-in-the-Loop**: Optional pause for critical decisions
|
|
497
|
+
|
|
498
|
+
```python
|
|
499
|
+
from autonomous import AutonomousAgentLoop
|
|
500
|
+
|
|
501
|
+
agent = AutonomousAgentLoop(max_iterations=50)
|
|
502
|
+
result = await agent.run(
|
|
503
|
+
goal="Find vulnerabilities and open ports",
|
|
504
|
+
target="example.com",
|
|
505
|
+
scope={"depth": "comprehensive"}
|
|
506
|
+
)
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
---
|
|
510
|
+
|
|
511
|
+
### Risk Engine
|
|
512
|
+
|
|
513
|
+
Advanced false-positive reduction and risk prioritization:
|
|
514
|
+
|
|
515
|
+
```bash
|
|
516
|
+
# Scan with risk validation
|
|
517
|
+
zen-ai-pentest --target example.com --autonomous --validate-risks
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
**Components:**
|
|
521
|
+
- **FalsePositiveEngine**: Multi-factor validation using Bayesian filtering and LLM voting
|
|
522
|
+
- **BusinessImpactCalculator**: Financial, compliance, and reputation impact assessment
|
|
523
|
+
- **CVSS/EPSS Scoring**: Industry-standard vulnerability scoring
|
|
524
|
+
- **Priority Ranking**: Automated finding prioritization
|
|
525
|
+
|
|
526
|
+
```python
|
|
527
|
+
from risk_engine import FalsePositiveEngine, BusinessImpactCalculator
|
|
528
|
+
|
|
529
|
+
# Validate findings
|
|
530
|
+
fp_engine = FalsePositiveEngine()
|
|
531
|
+
validation = await fp_engine.validate_finding(finding)
|
|
532
|
+
|
|
533
|
+
# Calculate business impact
|
|
534
|
+
impact_calc = BusinessImpactCalculator(
|
|
535
|
+
organization_size="large",
|
|
536
|
+
annual_revenue=100000000,
|
|
537
|
+
industry="finance"
|
|
538
|
+
)
|
|
539
|
+
impact = impact_calc.calculate_overall_impact(asset_context, finding_type, severity)
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
---
|
|
543
|
+
|
|
544
|
+
### CI/CD Integration
|
|
545
|
+
|
|
546
|
+
Seamless integration with DevSecOps pipelines:
|
|
547
|
+
|
|
548
|
+
**GitHub Actions:**
|
|
549
|
+
```yaml
|
|
550
|
+
- name: Security Scan
|
|
551
|
+
uses: zen-ai-pentest/action@v2
|
|
552
|
+
with:
|
|
553
|
+
target: ${{ vars.TARGET_URL }}
|
|
554
|
+
fail-on: critical
|
|
555
|
+
format: sarif
|
|
556
|
+
```
|
|
557
|
+
|
|
558
|
+
**GitLab CI:**
|
|
559
|
+
```yaml
|
|
560
|
+
security-scan:
|
|
561
|
+
image: zen-ai-pentest:latest
|
|
562
|
+
script:
|
|
563
|
+
- zen-ai-pentest --target $TARGET --ci-mode --fail-on high
|
|
564
|
+
artifacts:
|
|
565
|
+
reports:
|
|
566
|
+
sast: gl-sast-report.json
|
|
567
|
+
```
|
|
568
|
+
|
|
569
|
+
**Jenkins:**
|
|
570
|
+
```groovy
|
|
571
|
+
stage('Security Scan') {
|
|
572
|
+
steps {
|
|
573
|
+
sh 'zen-ai-pentest --target ${TARGET} --ci-mode --fail-on critical'
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
```
|
|
577
|
+
|
|
578
|
+
**Supported Output Formats:**
|
|
579
|
+
- **JSON**: Machine-readable findings
|
|
580
|
+
- **JUnit XML**: Test result integration
|
|
581
|
+
- **SARIF**: Static analysis results format
|
|
582
|
+
- **Markdown**: Human-readable reports
|
|
583
|
+
|
|
584
|
+
**Exit Codes:**
|
|
585
|
+
- `0`: Scan passed (no findings above threshold)
|
|
586
|
+
- `1`: Findings detected (above threshold)
|
|
587
|
+
|
|
588
|
+
---
|
|
589
|
+
|
|
590
|
+
### Benchmarking
|
|
591
|
+
|
|
592
|
+
Compare Zen AI against competitors:
|
|
593
|
+
|
|
594
|
+
```bash
|
|
595
|
+
# Run full benchmark suite
|
|
596
|
+
zen-ai-pentest --benchmark
|
|
597
|
+
|
|
598
|
+
# Quick benchmark
|
|
599
|
+
python -c "from benchmarks import run_quick_benchmark; asyncio.run(run_quick_benchmark())"
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
**Benchmarks Include:**
|
|
603
|
+
- HackTheBox machines (Lame, Blue, Legacy)
|
|
604
|
+
- OWASP WebGoat scenarios
|
|
605
|
+
- DVWA test cases
|
|
606
|
+
- OWASP Juice Shop challenges
|
|
607
|
+
|
|
608
|
+
**Metrics:**
|
|
609
|
+
| Metric | Description |
|
|
610
|
+
|--------|-------------|
|
|
611
|
+
| Time to First Finding | Speed of initial vulnerability detection |
|
|
612
|
+
| Time to User | Initial access achievement time |
|
|
613
|
+
| Time to Root | Full compromise time |
|
|
614
|
+
| Findings Count | Total vulnerabilities discovered |
|
|
615
|
+
| False Positive Rate | Accuracy measurement |
|
|
616
|
+
| Cost per Scan | API and compute costs |
|
|
617
|
+
|
|
618
|
+
**Competitor Comparison:**
|
|
619
|
+
| Tool | HTB Easy | FP Rate | Cost |
|
|
620
|
+
|------|----------|---------|------|
|
|
621
|
+
| Zen AI | ~45min | ~12% | $0.50 |
|
|
622
|
+
| PentestGPT | ~80min | ~28% | $1.20 |
|
|
623
|
+
| AutoPentest | ~120min | ~35% | $2.00 |
|
|
624
|
+
|
|
625
|
+
---
|
|
626
|
+
|
|
627
|
+
### Exploit Validation
|
|
628
|
+
|
|
629
|
+
Safe and controlled exploit testing:
|
|
630
|
+
|
|
631
|
+
```bash
|
|
632
|
+
# Validate exploit with safety controls
|
|
633
|
+
zen-ai-pentest --validate-exploits --target example.com --exploit-type sqli
|
|
634
|
+
```
|
|
635
|
+
|
|
636
|
+
**Safety Levels:**
|
|
637
|
+
- **READ_ONLY**: Passive validation only
|
|
638
|
+
- **VALIDATE_ONLY**: Validate without full execution
|
|
639
|
+
- **CONTROLLED**: Controlled execution with limits (default)
|
|
640
|
+
- **FULL**: Full exploitation (requires explicit approval)
|
|
641
|
+
|
|
642
|
+
**Features:**
|
|
643
|
+
- Docker-based sandboxing
|
|
644
|
+
- Evidence collection (screenshots, HTTP captures)
|
|
645
|
+
- Chain of custody tracking
|
|
646
|
+
- Automatic remediation generation
|
|
647
|
+
|
|
648
|
+
```python
|
|
649
|
+
from autonomous import ExploitValidator, ExploitType, ScopeConfig
|
|
650
|
+
|
|
651
|
+
validator = ExploitValidator(
|
|
652
|
+
safety_level="controlled",
|
|
653
|
+
scope_config=ScopeConfig(allowed_hosts=["example.com"])
|
|
654
|
+
)
|
|
655
|
+
|
|
656
|
+
result = await validator.validate(
|
|
657
|
+
exploit_code="' OR '1'='1",
|
|
658
|
+
target="https://example.com/login",
|
|
659
|
+
exploit_type=ExploitType.WEB_SQLI
|
|
660
|
+
)
|
|
661
|
+
```
|
|
662
|
+
|
|
663
|
+
---
|
|
664
|
+
|
|
665
|
+
### Notifications & Integrations
|
|
666
|
+
|
|
667
|
+
**Slack Notifications:**
|
|
668
|
+
```python
|
|
669
|
+
from integrations import SlackNotifier
|
|
670
|
+
|
|
671
|
+
slack = SlackNotifier(webhook_url="...")
|
|
672
|
+
await slack.notify_scan_completed(results, target="example.com")
|
|
673
|
+
```
|
|
674
|
+
|
|
675
|
+
**JIRA Integration:**
|
|
676
|
+
```python
|
|
677
|
+
from integrations import JiraIntegration
|
|
678
|
+
|
|
679
|
+
jira = JiraIntegration(server="...", username="...", api_token="...")
|
|
680
|
+
ticket = await jira.create_finding_ticket(finding, project_key="SEC")
|
|
681
|
+
```
|
|
682
|
+
|
|
683
|
+
**Supported Integrations:**
|
|
684
|
+
- GitHub (Issues, Check Runs)
|
|
685
|
+
- GitLab (Issues, CI/CD)
|
|
686
|
+
- JIRA (Ticket creation)
|
|
687
|
+
- Slack (Notifications)
|
|
688
|
+
- Jenkins (Pipeline triggers)
|
|
689
|
+
- Email (SMTP alerts)
|
|
690
|
+
- Webhooks (Custom endpoints)
|
|
691
|
+
|
|
692
|
+
---
|
|
693
|
+
|
|
694
|
+
## 📁 Updated Project Structure
|
|
695
|
+
|
|
696
|
+
```
|
|
697
|
+
zen-ai-pentest/
|
|
698
|
+
├── autonomous/ # Autonomous Agent System
|
|
699
|
+
│ ├── agent_loop.py # ReAct Loop Engine
|
|
700
|
+
│ ├── exploit_validator.py # Exploit Validation
|
|
701
|
+
│ ├── memory.py # Memory Management
|
|
702
|
+
│ └── tool_executor.py # Tool Execution
|
|
703
|
+
├── risk_engine/ # Risk Analysis
|
|
704
|
+
│ ├── false_positive_engine.py
|
|
705
|
+
│ ├── business_impact_calculator.py
|
|
706
|
+
│ ├── cvss.py
|
|
707
|
+
│ └── epss.py
|
|
708
|
+
├── benchmarks/ # Benchmark Framework
|
|
709
|
+
│ ├── run_benchmarks.py
|
|
710
|
+
│ └── comparison.py
|
|
711
|
+
├── integrations/ # CI/CD Integrations
|
|
712
|
+
│ ├── github.py
|
|
713
|
+
│ ├── gitlab.py
|
|
714
|
+
│ ├── jira.py
|
|
715
|
+
│ ├── slack.py
|
|
716
|
+
│ └── jenkins.py
|
|
717
|
+
├── config/ # Configuration Files
|
|
718
|
+
│ ├── autonomous.json
|
|
719
|
+
│ ├── risk_engine.json
|
|
720
|
+
│ ├── benchmarks.json
|
|
721
|
+
│ └── integrations.json
|
|
722
|
+
├── api/ # FastAPI Backend
|
|
723
|
+
├── agents/ # AI Agents
|
|
724
|
+
├── database/ # Database Layer
|
|
725
|
+
├── tools/ # Pentesting Tools
|
|
726
|
+
└── ...
|
|
727
|
+
```
|
|
728
|
+
|
|
729
|
+
---
|
|
730
|
+
|
|
731
|
+
## 👥 Authors & Team
|
|
732
|
+
|
|
733
|
+
### Core Development Team
|
|
734
|
+
|
|
735
|
+
<table>
|
|
736
|
+
<tr>
|
|
737
|
+
<td align="center">
|
|
738
|
+
<a href="https://github.com/SHAdd0WTAka">
|
|
739
|
+
<img src="https://github.com/SHAdd0WTAka.png?size=100" width="100px;" alt="SHAdd0WTAka"/>
|
|
740
|
+
<br />
|
|
741
|
+
<sub><b>@SHAdd0WTAka</b></sub>
|
|
742
|
+
</a>
|
|
743
|
+
<br />
|
|
744
|
+
<sub>Project Founder & Lead Developer</sub>
|
|
745
|
+
<br />
|
|
746
|
+
<sub>Security Architect</sub>
|
|
747
|
+
</td>
|
|
748
|
+
<td align="center">
|
|
749
|
+
<a href="https://www.moonshot.cn/">
|
|
750
|
+
<img src="https://img.shields.io/badge/Kimi-AI-blue?style=for-the-badge&logo=openai&logoColor=white" width="100px;" alt="Kimi AI"/>
|
|
751
|
+
<br />
|
|
752
|
+
<sub><b>Kimi AI</b></sub>
|
|
753
|
+
</a>
|
|
754
|
+
<br />
|
|
755
|
+
<sub>AI Development Partner</sub>
|
|
756
|
+
<br />
|
|
757
|
+
<sub>Architecture & Design</sub>
|
|
758
|
+
</td>
|
|
759
|
+
</tr>
|
|
760
|
+
</table>
|
|
761
|
+
|
|
762
|
+
### AI Contributors
|
|
763
|
+
|
|
764
|
+
- **Kimi AI (Moonshot AI)** - Primary AI development partner
|
|
765
|
+
- Led architecture design for autonomous agent loop
|
|
766
|
+
- Implemented Risk Engine with false-positive reduction
|
|
767
|
+
- Created CI/CD integration templates
|
|
768
|
+
- Developed benchmarking framework
|
|
769
|
+
- Co-authored documentation and roadmaps
|
|
770
|
+
|
|
771
|
+
### Special Thanks
|
|
772
|
+
|
|
773
|
+
- **Grok (xAI)** - Strategic analysis and competitive research
|
|
774
|
+
- **GitHub Copilot** - Code assistance and suggestions
|
|
775
|
+
- **Security Community** - Feedback, bug reports, and feature requests
|
|
776
|
+
|
|
777
|
+
### Contributing
|
|
778
|
+
|
|
779
|
+
We welcome contributions! See [CONTRIBUTORS.md](CONTRIBUTORS.md) and [CONTRIBUTING.md](CONTRIBUTING.md) for details.
|
|
780
|
+
|
|
781
|
+
---
|
|
782
|
+
|
|
783
|
+
## 📞 Support
|
|
784
|
+
|
|
785
|
+
- GitHub Issues: [Report Bug](https://github.com/SHAdd0WTAka/zen-ai-pentest/issues)
|
|
786
|
+
- Discussions: [Ask Question](https://github.com/SHAdd0WTAka/zen-ai-pentest/discussions)
|
|
787
|
+
- Email: support@zen-pentest.local
|
|
788
|
+
- Documentation: https://shadd0wtaka.github.io/zen-ai-pentest
|
|
789
|
+
|
|
790
|
+
---
|
|
791
|
+
|
|
792
|
+
<p align="center">
|
|
793
|
+
<b>Made with ❤️ for the security community</b><br>
|
|
794
|
+
<sub>© 2026 Zen-AI-Pentest. All rights reserved.</sub>
|
|
795
|
+
</p>
|