pentesting 0.7.44 β†’ 0.7.45

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.
Files changed (2) hide show
  1. package/README.md +55 -130
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -189,48 +189,27 @@ Complete
189
189
 
190
190
  ---
191
191
 
192
- ## πŸ€– Agentic System (Dual Architecture)
193
-
194
- ### YAML-Based Agents (Primary)
195
- New agents defined in `src/agents/specs/*.yaml` with auto-switching:
196
-
197
- | YAML Agent | Phase | Description |
198
- |------------|-------|-------------|
199
- | `recon` | RECON, SCAN | Information gathering, port scanning |
200
- | `web` | ENUM | Web application security, OWASP Top 10 |
201
- | `exploit` | VULN, EXPLOIT | CVE research, exploit execution |
202
- | `privesc` | PRIVESC, PIVOT, PERSIST | Privilege escalation techniques |
203
- | `crypto` | EXFIL | Hash cracking, encryption analysis |
204
-
205
- ### Built-in Agents (Fallback)
206
-
207
- | Agent | Specialty |
208
- |-------|-----------|
209
- | `target-explorer` | Network reconnaissance, service enumeration |
210
- | `exploit-researcher` | CVE research, exploit development |
211
- | `privesc-master` | Linux/Windows privilege escalation |
212
- | `web-hacker` | OWASP Top 10, SQLi, XSS, SSRF |
213
- | `crypto-solver` | Hash cracking, cipher analysis |
214
- | `forensics-analyst` | Memory forensics, file carving |
215
- | `reverse-engineer` | Binary analysis, exploit development |
216
- | `attack-architect` | Attack strategy planning |
217
- | `finding-reviewer` | Vulnerability validation |
218
-
219
- ### Agent Orchestration Flow
192
+ ## πŸ€– AI Agents
220
193
 
221
- ```
222
- User Request β†’ AutonomousHackingAgent
223
- ↓
224
- Phase Change Detected (RECON β†’ SCAN β†’ ENUM β†’ ...)
225
- ↓
226
- autoSwitchAgentForPhase(phaseId)
227
- β”œβ”€β”€ Try YAML Agent First (SpecOrchestrator)
228
- └── Fallback to Builtin Agent
229
- ↓
230
- System Prompt = Base + Agent-Specific Instructions
231
- ↓
232
- LLM Call with Specialized Context
233
- ```
194
+ Pentesting automatically switches between specialized AI agents based on the current attack phase:
195
+
196
+ | Phase | Agent | What it does |
197
+ |-------|-------|--------------|
198
+ | Reconnaissance | **Recon Agent** | Discovers hosts, ports, services, subdomains |
199
+ | Web Scanning | **Web Agent** | Tests for OWASP Top 10, SQLi, XSS, SSRF |
200
+ | Exploitation | **Exploit Agent** | Researches CVEs, selects and runs exploits |
201
+ | Privilege Escalation | **PrivEsc Agent** | Finds SUID, sudo misconfigs, kernel exploits |
202
+ | Data Extraction | **Crypto Agent** | Cracks hashes, analyzes encryption |
203
+
204
+ ### How it works
205
+
206
+ 1. **You set a target** β†’ Agent starts in Recon mode
207
+ 2. **Finds web services** β†’ Automatically switches to Web Agent
208
+ 3. **Discovers vulnerability** β†’ Switches to Exploit Agent
209
+ 4. **Gets shell access** β†’ Switches to PrivEsc Agent
210
+ 5. **Finds password hashes** β†’ Crypto Agent takes over
211
+
212
+ > No manual agent switching needed. The system automatically picks the best agent for each situation.
234
213
 
235
214
  ---
236
215
 
@@ -249,44 +228,15 @@ LLM Call with Specialized Context
249
228
 
250
229
  > **Note**: `ANTHROPIC_API_KEY` is also accepted as fallback for `PENTEST_API_KEY`.
251
230
 
252
- ---
253
-
254
- ## πŸ’» Programmatic Usage
255
-
256
- ```typescript
257
- import { AutonomousHackingAgent, AGENT_EVENT } from 'pentesting';
258
-
259
- const agent = new AutonomousHackingAgent(undefined, {
260
- autoApprove: false, // Require approval for dangerous tools
261
- maxIterations: 100, // Max loop iterations
262
- });
263
-
264
- // Multi-target setup
265
- agent.addTarget('example1.com');
266
- agent.addTarget('example2.com');
267
- agent.setTarget('example1.com');
268
231
 
269
- // Listen for events
270
- agent.on(AGENT_EVENT.FINDING, (finding) => {
271
- console.log(`Found: ${finding.title} (${finding.severity})`);
272
- });
273
-
274
- agent.on(AGENT_EVENT.TARGET_SET, (target) => {
275
- console.log(`Target set: ${target}`);
276
- });
232
+ ---
277
233
 
278
- agent.on(AGENT_EVENT.TOOL_CALL, ({ name, input }) => {
279
- console.log(`Tool: ${name}`);
280
- });
234
+ ## πŸ’» For Developers
281
235
 
282
- // Start pentesting
283
- await agent.runAutonomous('Get root access');
284
-
285
- // Control execution
286
- agent.pause(); // Pause (ESC key equivalent)
287
- agent.resume(); // Resume
288
- agent.abort(); // Complete stop
289
- ```
236
+ Pentesting can be used as a library in your own projects. See [Architecture Docs](./docs/architecture.md) for:
237
+ - API Reference
238
+ - Event System
239
+ - Custom Agent Integration
290
240
 
291
241
  ---
292
242
 
@@ -332,63 +282,39 @@ docker pull agnusdei1207/pentesting-tools:latest
332
282
 
333
283
  ## πŸ”Œ MCP Integration
334
284
 
335
- Extend with additional MCP servers:
336
-
337
- ```typescript
338
- const agent = new AutonomousHackingAgent();
339
-
340
- // Add filesystem access
341
- await agent.addMCPServer('filesystem', 'npx', [
342
- '-y', '@modelcontextprotocol/server-filesystem', '/'
343
- ]);
344
-
345
- // Add custom security tools
346
- await agent.addMCPServer('security-tools', 'docker', [
347
- 'exec', '-i', 'pentesting-tools', '/bin/bash'
348
- ]);
349
- ```
285
+ Pentesting supports MCP (Model Context Protocol) for extending capabilities with additional tools and servers. See [Architecture Docs](./docs/architecture.md) for integration details.
350
286
 
351
287
  ---
352
288
 
353
- ## πŸ—οΈ Architecture
289
+ ## πŸ—οΈ How It Works
354
290
 
355
291
  ```
356
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
357
- β”‚ TUI (app.tsx) β”‚
358
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
359
- β”‚ β”‚ WireLogger β”‚ β”‚ContextMgr β”‚ β”‚ Multi-Target Handler β”‚ β”‚
360
- β”‚ β”‚ (Recording) β”‚ β”‚(Checkpoints)β”‚ β”‚ (add/list/rm/clear/all) β”‚ β”‚
361
- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
362
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
363
- β”‚ β”‚ KeyboardLstn β”‚ β”‚ ForceUpdate β”‚ β”‚ SlashCommandRegistry β”‚ β”‚
364
- β”‚ β”‚ (ESC/Ctrl+C) β”‚ β”‚ (UI Refresh) β”‚ β”‚ (Command Handling) β”‚ β”‚
365
- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
366
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
367
- β”‚ Events
368
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
369
- β”‚ AutonomousHackingAgent (Core Engine) β”‚
370
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
371
- β”‚ β”‚ HookExecutor β”‚ β”‚ MCPManager β”‚ β”‚ApprovalMgr β”‚ β”‚
372
- β”‚ β”‚ (Lifecycle) β”‚ β”‚ (Extensions) β”‚ β”‚(Tool Safety) β”‚ β”‚
373
- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
374
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
375
- β”‚ β”‚ TargetMgr β”‚ β”‚ PauseMgr β”‚ β”‚ContextMgr β”‚ β”‚
376
- β”‚ β”‚ (Multi-Tgt) β”‚ β”‚ (ESC/Abort) β”‚ β”‚ (Compaction) β”‚ β”‚
377
- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
378
- β”‚ β”‚
379
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
380
- β”‚ β”‚ 9 Built-in Specialized Agents β”‚ β”‚
381
- β”‚ β”‚ target-explorer β€’ exploit-researcher β€’ privesc-master β”‚ β”‚
382
- β”‚ β”‚ web-hacker β€’ crypto-solver β€’ forensics-analyst β”‚ β”‚
383
- β”‚ β”‚ reverse-engineer β€’ attack-architect β€’ finding-reviewer β”‚ β”‚
384
- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
385
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
386
- β”‚
387
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
388
- β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”
389
- β”‚ Tool β”‚ β”‚ Bash β”‚ β”‚ MCP β”‚
390
- β”‚Executor β”‚ β”‚Commands β”‚ β”‚ Servers β”‚
391
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
292
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
293
+ β”‚ Your Terminal β”‚
294
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
295
+ β”‚ β”‚ pentesting CLI (Interactive TUI) β”‚ β”‚
296
+ β”‚ β”‚ - Target management β”‚ β”‚
297
+ β”‚ β”‚ - Session recording β”‚ β”‚
298
+ β”‚ β”‚ - Real-time output β”‚ β”‚
299
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
300
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
301
+ β–Ό
302
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
303
+ β”‚ AI Agent Core β”‚
304
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
305
+ β”‚ β”‚ 5 Specialized Agents (auto-switching) β”‚ β”‚
306
+ β”‚ β”‚ Recon β†’ Web β†’ Exploit β†’ PrivEsc β†’ Cryptoβ”‚
307
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
308
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
309
+ β–Ό
310
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
311
+ β”‚ Tool Execution β”‚
312
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
313
+ β”‚ β”‚ Docker β”‚ β”‚ Local β”‚ β”‚ MCP β”‚ β”‚
314
+ β”‚ β”‚ (50+ β”‚ β”‚ Tools β”‚ β”‚ Servers β”‚ β”‚
315
+ β”‚ β”‚ tools) β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
316
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
317
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
392
318
  ```
393
319
 
394
320
  ---
@@ -410,7 +336,6 @@ npm run build
410
336
  npm run dev
411
337
  ```
412
338
 
413
- ## πŸ“„ License
414
339
  ## Documentation
415
340
 
416
341
  - [Architecture](./docs/ARCHITECTURE.md) - System design and components
@@ -418,6 +343,6 @@ npm run dev
418
343
 
419
344
  ---
420
345
 
421
- ## οΏ½πŸ“„ License
346
+ ## πŸ“„ License
422
347
 
423
348
  MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pentesting",
3
- "version": "0.7.44",
3
+ "version": "0.7.45",
4
4
  "description": "Autonomous Penetration Testing AI Agent",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",