pentesting 0.1.0 → 0.1.2
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 +116 -159
- package/dist/index.js +1052 -217
- package/package.json +11 -4
- package/skills/initial-access.md +0 -205
- package/skills/network-scanning.md +0 -87
- package/skills/post-exploitation.md +0 -301
- package/skills/privilege-escalation-linux.md +0 -228
- package/skills/privilege-escalation-windows.md +0 -252
- package/skills/reconnaissance.md +0 -52
- package/skills/web-application-testing.md +0 -75
package/README.md
CHANGED
|
@@ -1,210 +1,167 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Pentesting
|
|
2
2
|
|
|
3
|
-
Autonomous Penetration Testing AI Agent
|
|
3
|
+
> 🎯 DEF CON-level Autonomous Penetration Testing AI Agent
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
██████╔╝█████╗ ██╔██╗ ██║ ██║ █████╗ ███████╗ ██║
|
|
9
|
-
██╔═══╝ ██╔══╝ ██║╚██╗██║ ██║ ██╔══╝ ╚════██║ ██║
|
|
10
|
-
██║ ███████╗██║ ╚████║ ██║ ███████╗███████║ ██║
|
|
11
|
-
╚═╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚══════╝╚══════╝ ╚═╝
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
## Features
|
|
5
|
+
<p align="center">
|
|
6
|
+
<img src="assets/logo.png" alt="Pentesting Logo" width="200"/>
|
|
7
|
+
</p>
|
|
15
8
|
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
- **30+ Integrated Tools**: Nmap, SQLmap, Metasploit, Burp Suite, and more
|
|
19
|
-
- **Privilege Escalation**: Built-in Linux/Windows rooting techniques
|
|
20
|
-
- **Rabbit Hole Detection**: Self-reflection when stuck, tries alternative approaches
|
|
21
|
-
- **Real-time Thinking Display**: Watch the agent's thought process in TUI
|
|
9
|
+
[](https://www.npmjs.com/package/pentesting)
|
|
10
|
+
[](https://hub.docker.com/r/agnusdei1207/pentesting-tools)
|
|
22
11
|
|
|
23
|
-
##
|
|
12
|
+
## Features
|
|
24
13
|
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
14
|
+
- **7-Phase Workflow**: Recon → Enum → Vuln Analysis → Exploitation → PrivEsc → Lateral → Reporting
|
|
15
|
+
- **Parallel Agent Orchestration**: 2-4 specialized agents working simultaneously
|
|
16
|
+
- **Ralph-Style Loops**: Self-referential iteration until objective completion
|
|
17
|
+
- **Confidence Scoring**: Findings rated 0-100 to filter false positives
|
|
18
|
+
- **MCP Integration**: Model Context Protocol for extended tool capabilities
|
|
19
|
+
- **Docker Toolkit**: 50+ pre-installed pentesting tools
|
|
28
20
|
|
|
29
|
-
##
|
|
21
|
+
## Quick Start
|
|
30
22
|
|
|
31
|
-
###
|
|
23
|
+
### Install
|
|
32
24
|
|
|
33
25
|
```bash
|
|
34
|
-
|
|
35
|
-
cd pentesting
|
|
36
|
-
npm install
|
|
26
|
+
npm install -g pentesting
|
|
37
27
|
```
|
|
38
28
|
|
|
39
|
-
###
|
|
29
|
+
### Configure
|
|
40
30
|
|
|
41
31
|
```bash
|
|
42
|
-
|
|
43
|
-
git clone --depth 1 https://github.com/danielmiessler/SecLists.git /opt/SecLists
|
|
44
|
-
|
|
45
|
-
# Alternative: Using apt (Kali/Debian)
|
|
46
|
-
sudo apt install -y seclists
|
|
47
|
-
|
|
48
|
-
# RockYou wordlist (for password cracking)
|
|
49
|
-
sudo apt install -y wordlists
|
|
50
|
-
sudo gunzip /usr/share/wordlists/rockyou.txt.gz 2>/dev/null || true
|
|
32
|
+
export ANTHROPIC_API_KEY=your_api_key
|
|
51
33
|
```
|
|
52
34
|
|
|
53
|
-
###
|
|
35
|
+
### Run
|
|
54
36
|
|
|
55
37
|
```bash
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
# Web tools
|
|
60
|
-
sudo apt install -y ffuf nuclei whatweb wfuzz
|
|
61
|
-
|
|
62
|
-
# Exploitation
|
|
63
|
-
sudo apt install -y metasploit-framework exploitdb
|
|
64
|
-
|
|
65
|
-
# Post-exploitation
|
|
66
|
-
sudo apt install -y crackmapexec evil-winrm impacket-scripts chisel
|
|
67
|
-
|
|
68
|
-
# Browser automation
|
|
69
|
-
npm install -g playwright
|
|
70
|
-
npx playwright install chromium
|
|
38
|
+
pentesting
|
|
39
|
+
# or
|
|
40
|
+
npx pentesting
|
|
71
41
|
```
|
|
72
42
|
|
|
73
|
-
|
|
43
|
+
## Docker Environment
|
|
74
44
|
|
|
75
45
|
```bash
|
|
76
|
-
|
|
77
|
-
|
|
46
|
+
# Pull pre-built toolkit (50+ tools)
|
|
47
|
+
docker pull agnusdei1207/pentesting-tools:latest
|
|
78
48
|
|
|
79
|
-
|
|
49
|
+
# Run with host network (required for target access)
|
|
50
|
+
docker run -d --name pentesting-tools --network host \
|
|
51
|
+
-v $(pwd)/workspace:/pentest \
|
|
52
|
+
agnusdei1207/pentesting-tools:latest
|
|
80
53
|
|
|
81
|
-
|
|
82
|
-
|
|
54
|
+
# Execute tools
|
|
55
|
+
docker exec -it pentesting-tools nmap -sCV 10.0.0.1
|
|
83
56
|
```
|
|
84
57
|
|
|
85
|
-
##
|
|
58
|
+
## Plugin System
|
|
59
|
+
|
|
60
|
+
Based on Claude-Code plugin architecture:
|
|
86
61
|
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
|
|
62
|
+
```
|
|
63
|
+
plugins/pentesting-core/
|
|
64
|
+
├── agents/ # 9 specialized AI agents
|
|
65
|
+
├── commands/ # 5 slash commands
|
|
66
|
+
├── hooks/ # Event handlers
|
|
67
|
+
└── skills/ # 9 domain skills
|
|
90
68
|
```
|
|
91
69
|
|
|
92
|
-
|
|
70
|
+
### Agents
|
|
93
71
|
|
|
94
|
-
|
|
72
|
+
| Agent | Specialty |
|
|
73
|
+
|-------|-----------|
|
|
74
|
+
| target-explorer | Reconnaissance |
|
|
75
|
+
| exploit-researcher | CVE/Exploit research |
|
|
76
|
+
| privesc-master | Privilege escalation |
|
|
77
|
+
| web-hacker | OWASP Top 10 |
|
|
78
|
+
| crypto-solver | Cryptography |
|
|
79
|
+
| forensics-analyst | Digital forensics |
|
|
80
|
+
| reverse-engineer | Binary analysis |
|
|
81
|
+
| attack-architect | Strategy planning |
|
|
82
|
+
| finding-reviewer | Validation |
|
|
95
83
|
|
|
96
|
-
###
|
|
84
|
+
### Commands
|
|
97
85
|
|
|
98
86
|
```bash
|
|
99
|
-
#
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
#
|
|
103
|
-
pentesting -t 192.168.1.1
|
|
104
|
-
|
|
105
|
-
# Auto-approve all tools (dangerous!)
|
|
106
|
-
pentesting --dangerously-skip-permissions
|
|
87
|
+
/pentest-loop <target> <objective> # Autonomous attack loop
|
|
88
|
+
/scan <target> # Quick enumeration
|
|
89
|
+
/exploit <query> # Search/run exploits
|
|
90
|
+
/vuln-review # Review findings
|
|
107
91
|
```
|
|
108
92
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
| Command | Description |
|
|
112
|
-
|---------|-------------|
|
|
113
|
-
| `pentesting` | Start interactive TUI |
|
|
114
|
-
| `pentesting -t <ip>` | Start with target |
|
|
115
|
-
| `pentesting --dangerously-skip-permissions` | Auto-approve all tool executions |
|
|
116
|
-
| `pentesting run <objective>` | Run single objective |
|
|
117
|
-
| `pentesting scan <target>` | Quick scan target |
|
|
93
|
+
## Architecture
|
|
118
94
|
|
|
119
|
-
|
|
95
|
+
```
|
|
96
|
+
┌──────────────────────────────────────────────────────────────┐
|
|
97
|
+
│ AutonomousHackingAgent │
|
|
98
|
+
├──────────────────────────────────────────────────────────────┤
|
|
99
|
+
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
|
|
100
|
+
│ │ Claude │ │ Plugin │ │ MCP │ │
|
|
101
|
+
│ │ API │ │ System │ │ Client │ │
|
|
102
|
+
│ └─────────────┘ └─────────────┘ └─────────────┘ │
|
|
103
|
+
│ │ │ │ │
|
|
104
|
+
│ ┌──────┴────────────────┴────────────────┴───────┐ │
|
|
105
|
+
│ │ Tool Executor │ │
|
|
106
|
+
│ │ (bash, nmap, sqlmap, msfconsole, etc.) │ │
|
|
107
|
+
│ └─────────────────────────────────────────────────┘ │
|
|
108
|
+
├──────────────────────────────────────────────────────────────┤
|
|
109
|
+
│ Hook System │ Command Parser │ Web Search │ Agents │
|
|
110
|
+
└──────────────────────────────────────────────────────────────┘
|
|
111
|
+
```
|
|
120
112
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
113
|
+
## Configuration
|
|
114
|
+
|
|
115
|
+
### MCP Servers
|
|
116
|
+
|
|
117
|
+
Create `.pentest/mcp.json`:
|
|
118
|
+
|
|
119
|
+
```json
|
|
120
|
+
{
|
|
121
|
+
"mcpServers": {
|
|
122
|
+
"filesystem": {
|
|
123
|
+
"command": "npx",
|
|
124
|
+
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/"]
|
|
125
|
+
},
|
|
126
|
+
"pentesting-tools": {
|
|
127
|
+
"command": "docker",
|
|
128
|
+
"args": ["exec", "-i", "pentesting-tools", "/bin/bash"]
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
```
|
|
131
133
|
|
|
132
|
-
###
|
|
134
|
+
### Environment Variables
|
|
133
135
|
|
|
134
|
-
|
|
|
135
|
-
|
|
136
|
-
|
|
|
137
|
-
|
|
|
138
|
-
|
|
|
139
|
-
| `Ctrl+C` | Exit |
|
|
136
|
+
| Variable | Description | Default |
|
|
137
|
+
|----------|-------------|---------|
|
|
138
|
+
| ANTHROPIC_API_KEY | Claude API key | Required |
|
|
139
|
+
| PENTEST_MODEL | Claude model | claude-sonnet-4-20250514 |
|
|
140
|
+
| PENTEST_MAX_TOKENS | Max response tokens | 8192 |
|
|
140
141
|
|
|
141
|
-
|
|
142
|
+
## Development
|
|
142
143
|
|
|
143
144
|
```bash
|
|
144
|
-
#
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
# Run specific objective
|
|
148
|
-
pentesting run "Find SQL injection vulnerabilities" -t http://target.com -o report.json
|
|
149
|
-
|
|
150
|
-
# Quick vulnerability scan
|
|
151
|
-
pentesting scan 192.168.1.1 -s vuln
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
## Attack Phases
|
|
145
|
+
# Clone
|
|
146
|
+
git clone https://github.com/agnusdei1207/pentesting.git
|
|
147
|
+
cd pentesting
|
|
155
148
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
3. **Enumeration** - Deep service enumeration, user discovery
|
|
159
|
-
4. **Vulnerability Analysis** - CVE mapping, vulnerability scanning
|
|
160
|
-
5. **Exploitation** - Initial access, web attacks
|
|
161
|
-
6. **Privilege Escalation** - Linux/Windows rooting
|
|
162
|
-
7. **Pivoting** - Internal network discovery, tunneling
|
|
163
|
-
8. **Persistence** - Backdoor installation
|
|
164
|
-
9. **Data Exfiltration** - Sensitive data extraction
|
|
165
|
-
10. **Reporting** - Findings documentation
|
|
149
|
+
# Install
|
|
150
|
+
npm install
|
|
166
151
|
|
|
167
|
-
|
|
152
|
+
# Build
|
|
153
|
+
npm run build
|
|
168
154
|
|
|
155
|
+
# Dev mode
|
|
156
|
+
npm run dev
|
|
169
157
|
```
|
|
170
|
-
pentesting/
|
|
171
|
-
├── src/
|
|
172
|
-
│ ├── cli/ # TUI components
|
|
173
|
-
│ ├── config/ # Constants, theme
|
|
174
|
-
│ ├── core/
|
|
175
|
-
│ │ ├── agent/ # Autonomous agent
|
|
176
|
-
│ │ ├── prompts/ # AI prompts
|
|
177
|
-
│ │ └── tools/ # Tool definitions
|
|
178
|
-
│ └── mcp/ # MCP server config
|
|
179
|
-
├── skills/ # Pentest skill files
|
|
180
|
-
└── dist/ # Build output
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
## Integrated Tools
|
|
184
|
-
|
|
185
|
-
| Category | Tools |
|
|
186
|
-
|----------|-------|
|
|
187
|
-
| Reconnaissance | nmap, masscan, rustscan, theHarvester, amass |
|
|
188
|
-
| Web | gobuster, ffuf, nikto, sqlmap, nuclei |
|
|
189
|
-
| Exploitation | metasploit, searchsploit, hydra |
|
|
190
|
-
| PrivEsc | linpeas, winpeas, mimikatz, bloodhound |
|
|
191
|
-
| Post-Exploit | chisel, impacket, crackmapexec |
|
|
192
|
-
|
|
193
|
-
## Environment Variables
|
|
194
|
-
|
|
195
|
-
| Variable | Description |
|
|
196
|
-
|----------|-------------|
|
|
197
|
-
| `ANTHROPIC_API_KEY` | Anthropic API key (required) |
|
|
198
|
-
| `PENTEST_MODEL` | Model override (default: claude-sonnet-4-20250514) |
|
|
199
158
|
|
|
200
|
-
##
|
|
159
|
+
## Legal
|
|
201
160
|
|
|
202
|
-
**
|
|
161
|
+
⚠️ **Only use on systems you own or have explicit permission to test.**
|
|
203
162
|
|
|
204
|
-
|
|
205
|
-
- Unauthorized testing is illegal
|
|
206
|
-
- Developers are not responsible for misuse
|
|
163
|
+
This tool is for authorized penetration testing and CTF competitions only.
|
|
207
164
|
|
|
208
165
|
## License
|
|
209
166
|
|
|
210
|
-
MIT
|
|
167
|
+
MIT
|