pentesting 0.8.40 → 0.8.44
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.
- package/README.md +115 -18
- package/dist/index.js +1451 -17
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -18,13 +18,24 @@
|
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
21
|
+
## Philosophy
|
|
22
|
+
|
|
23
|
+
> **Think → Plan → Collaborate → Execute → Reflect → Adapt**
|
|
24
|
+
|
|
25
|
+
Pentesting is not just a tool execution agent. It aims for **AGI-level autonomous thinking**:
|
|
26
|
+
|
|
27
|
+
- 🧠 **Autonomous Decision** - Decide and act without asking the user
|
|
28
|
+
- 🎯 **BFS First** - Breadth over depth, map the attack surface first
|
|
29
|
+
- 🤝 **Agent Collaboration** - 9 specialist agents share knowledge and collaborate
|
|
30
|
+
- 🔄 **Continuous Reflection** - Learn from failures and adjust strategy
|
|
31
|
+
- 💾 **Shared Memory** - All agents share discoveries
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
21
35
|
## Quick Start
|
|
22
36
|
|
|
23
37
|
```bash
|
|
24
|
-
# Docker required for security tools
|
|
25
|
-
# Install: https://docs.docker.com/get-docker/
|
|
26
|
-
open -a Docker # macOS - start Docker Desktop
|
|
27
|
-
|
|
38
|
+
# Docker required for security tools
|
|
28
39
|
npm install -g pentesting
|
|
29
40
|
|
|
30
41
|
# Set API key
|
|
@@ -39,33 +50,72 @@ pentesting
|
|
|
39
50
|
|
|
40
51
|
---
|
|
41
52
|
|
|
42
|
-
##
|
|
53
|
+
## Architecture
|
|
43
54
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
55
|
+
```
|
|
56
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
57
|
+
│ SUPERVISOR AGENT │
|
|
58
|
+
│ (Task Planning & Coordination) │
|
|
59
|
+
└─────────────────────────────────────────────────────────────┘
|
|
60
|
+
│
|
|
61
|
+
▼
|
|
62
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
63
|
+
│ SHARED MEMORY │
|
|
64
|
+
│ Short-Term │ Long-Term │ Episodic │ Attack Surface │
|
|
65
|
+
└─────────────────────────────────────────────────────────────┘
|
|
66
|
+
│
|
|
67
|
+
┌───────────────────┼───────────────────┐
|
|
68
|
+
▼ ▼ ▼
|
|
69
|
+
┌───────────────┐ ┌───────────────┐ ┌───────────────┐
|
|
70
|
+
│target-explorer│ │exploit-research│ │ privesc-master │
|
|
71
|
+
│ web-hacker │ │ crypto-solver │ │forensics-analyst│
|
|
72
|
+
│reverse-engineer│ │attack-architect│ │finding-reviewer│
|
|
73
|
+
└───────────────┘ └───────────────┘ └───────────────┘
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Core Components
|
|
77
|
+
|
|
78
|
+
| Component | Role |
|
|
79
|
+
|-----------|------|
|
|
80
|
+
| **Supervisor Agent** | Task planning, agent selection, strategy adjustment |
|
|
81
|
+
| **Shared Memory** | Cross-agent context sharing, failure recording |
|
|
82
|
+
| **9 Specialists** | Domain expert agents |
|
|
83
|
+
| **Orchestrator** | Parallel execution, result consolidation |
|
|
50
84
|
|
|
51
85
|
---
|
|
52
86
|
|
|
53
87
|
## Features
|
|
54
88
|
|
|
55
|
-
- **
|
|
56
|
-
- **
|
|
57
|
-
- **
|
|
58
|
-
- **
|
|
89
|
+
- **Multi-Agent Orchestration** - 9 specialist agents collaborate
|
|
90
|
+
- **Shared Memory System** - Cross-agent knowledge sharing
|
|
91
|
+
- **Strategic Planning** - BFS-based attack surface mapping
|
|
92
|
+
- **Self-Reflection** - Auto strategy change when stuck
|
|
93
|
+
- **Handoff Protocol** - Context transfer between agents
|
|
94
|
+
- **80%+ Confidence Filter** - Report only high-confidence findings
|
|
59
95
|
- **50+ Security Tools** - nmap, sqlmap, gobuster, hydra...
|
|
60
96
|
|
|
61
97
|
---
|
|
62
98
|
|
|
99
|
+
## Environment Variables
|
|
100
|
+
|
|
101
|
+
| Variable | Required | Default | Description |
|
|
102
|
+
|----------|----------|---------|-------------|
|
|
103
|
+
| `PENTEST_API_KEY` | ✅ | - | API key |
|
|
104
|
+
| `PENTEST_BASE_URL` | | - | Custom API endpoint |
|
|
105
|
+
| `PENTEST_MODEL` | | `claude-sonnet-4-20250514` | LLM model |
|
|
106
|
+
| `PENTEST_MAX_TOKENS` | | `16384` | Max response tokens |
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
63
110
|
## Commands
|
|
64
111
|
|
|
65
112
|
| Command | Description |
|
|
66
113
|
|---------|-------------|
|
|
67
114
|
| `/target <ip>` | Set target |
|
|
68
115
|
| `/start [objective]` | Start autonomous pentest |
|
|
116
|
+
| `/agent <name>` | Switch to specialist agent |
|
|
117
|
+
| `/plan` | Show current attack plan |
|
|
118
|
+
| `/memory` | Show shared memory state |
|
|
69
119
|
| `/findings` | Show findings |
|
|
70
120
|
| `/status` | Status |
|
|
71
121
|
| `/yolo` | Toggle auto-approve |
|
|
@@ -73,11 +123,58 @@ pentesting
|
|
|
73
123
|
|
|
74
124
|
---
|
|
75
125
|
|
|
126
|
+
## Specialized Agents
|
|
127
|
+
|
|
128
|
+
| Agent | Specialty |
|
|
129
|
+
|-------|-----------|
|
|
130
|
+
| `target-explorer` | Recon, OSINT, Enumeration |
|
|
131
|
+
| `exploit-researcher` | CVE, Exploit Development |
|
|
132
|
+
| `privesc-master` | Linux/Windows Privilege Escalation |
|
|
133
|
+
| `web-hacker` | Web Vulnerabilities, Injection |
|
|
134
|
+
| `crypto-solver` | Hash Cracking, Cryptography |
|
|
135
|
+
| `forensics-analyst` | Memory/File Analysis |
|
|
136
|
+
| `reverse-engineer` | Binary Analysis, PWN |
|
|
137
|
+
| `attack-architect` | Strategy, Attack Chains |
|
|
138
|
+
| `finding-reviewer` | Validation, Confidence Scoring |
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Programmatic Usage
|
|
143
|
+
|
|
144
|
+
```typescript
|
|
145
|
+
import {
|
|
146
|
+
getSupervisor,
|
|
147
|
+
getAgentMemory,
|
|
148
|
+
AutonomousHackingAgent
|
|
149
|
+
} from 'pentesting';
|
|
150
|
+
|
|
151
|
+
// High-level: Supervisor orchestration
|
|
152
|
+
const supervisor = getSupervisor();
|
|
153
|
+
const plan = await supervisor.createPlan('Get root access', '10.10.10.5');
|
|
154
|
+
const findings = await supervisor.executePlan();
|
|
155
|
+
|
|
156
|
+
// Direct agent usage
|
|
157
|
+
const agent = new AutonomousHackingAgent();
|
|
158
|
+
await agent.start('Enumerate web application', 'http://target.com');
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
76
163
|
## Documentation
|
|
77
164
|
|
|
78
|
-
- [Architecture](docs/architecture.md)
|
|
79
|
-
- [API Reference](docs/api-reference.md)
|
|
80
|
-
- [Troubleshooting](docs/troubleshooting.md)
|
|
165
|
+
- [Architecture](docs/architecture.md) - System architecture details
|
|
166
|
+
- [API Reference](docs/api-reference.md) - Programming interface
|
|
167
|
+
- [Troubleshooting](docs/troubleshooting.md) - Problem solving
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## Design Principles
|
|
172
|
+
|
|
173
|
+
1. **BFS Over DFS** - Map attack surface completely first
|
|
174
|
+
2. **Fail Fast, Pivot Quick** - Switch to alternative after 3 attempts
|
|
175
|
+
3. **Shared Context** - All agents share discoveries
|
|
176
|
+
4. **Confidence-Based** - Prioritize high-confidence findings
|
|
177
|
+
5. **AGI-like Autonomy** - Decide without asking
|
|
81
178
|
|
|
82
179
|
---
|
|
83
180
|
|