pentesting 0.4.1 → 0.4.3

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 CHANGED
@@ -1,3 +1,5 @@
1
+ # PENTEST
2
+
1
3
  ```
2
4
  ╔═══════════════════════════════════════════════════════════════╗
3
5
  ║ ║
@@ -8,7 +10,7 @@
8
10
  ║ ██║ ███████╗██║ ╚████║ ██║ ███████╗███████║ ██║ ║
9
11
  ║ ╚═╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚══════╝╚══════╝ ╚═╝ ║
10
12
  ║ ║
11
- 🎯 DEF CON-level Autonomous Pentesting Agent
13
+ Autonomous Pentesting Agent
12
14
  ║ ║
13
15
  ╚═══════════════════════════════════════════════════════════════╝
14
16
  ```
@@ -29,11 +31,6 @@ export PENTEST_API_KEY=your_api_key
29
31
  export PENTEST_BASE_URL=https://your-api-endpoint.com/v1
30
32
  export PENTEST_MODEL=your-model-name
31
33
 
32
- export PENTEST_API_KEY="key"
33
- export PENTEST_BASE_URL="https://api.z.ai/api/anthropic"
34
- export PENTEST_MODEL="glm-4.7"
35
-
36
-
37
34
  # Run
38
35
  pentesting
39
36
  ```
@@ -42,46 +39,70 @@ pentesting
42
39
 
43
40
  ## ✨ Features
44
41
 
42
+ ### Core Capabilities
45
43
  - **10-Phase Attack Workflow**: Recon → Scan → Enum → Vuln Analysis → Exploitation → PrivEsc → Pivot → Persist → Exfil → Report
46
- - **9 Specialized Agents**: Built-in experts for each security domain
44
+ - **9 Specialized Agents**: Built-in domain experts for security testing
47
45
  - **Ralph Loop**: Autonomous iteration until objective is achieved
48
- - **Streaming Responses**: Real-time LLM output
46
+ - **Streaming Responses**: Real-time LLM output display
49
47
  - **Session Persistence**: Save/resume pentesting sessions
50
48
  - **Tool Approval**: Manual confirmation for dangerous commands
51
49
  - **MCP Integration**: Extend with Model Context Protocol tools
52
50
  - **Docker Toolkit**: 50+ pre-installed pentesting tools
53
51
  - **Provider Agnostic**: Works with any OpenAI-compatible API
54
52
 
53
+ ### v0.4+ New Features (kimi-cli inspired)
54
+ - **Context Checkpoints**: Save/restore conversation states with `/checkpoint`, `/undo`, `/revert`
55
+ - **Flow Skills**: Mermaid/D2 diagram-based workflow automation
56
+ - **Session Replay**: Review past sessions from wire recordings
57
+ - **Auto-Update**: Background version checking with update notifications
58
+ - **Vision Analysis**: Analyze images from clipboard with `/paste`
59
+ - **Wire Logging**: Detailed session recording in JSONL format
60
+ - **Rich TUI**: Premium ASCII banner, organized help, status reports
61
+
55
62
  ---
56
63
 
57
64
  ## 📖 CLI Commands
58
65
 
66
+ ### Core
59
67
  ```bash
60
- # Target & Session
61
- /target <ip> Set target
68
+ /target <ip> Set target IP/hostname
62
69
  /start [objective] Start autonomous pentest
70
+ /stop Stop current operation
71
+ /status Show status report
72
+ ```
73
+
74
+ ### Session Management
75
+ ```bash
76
+ /checkpoint [desc] Create checkpoint with optional description
77
+ /checkpoints List all checkpoints
78
+ /undo Undo to last checkpoint
79
+ /revert <id> Revert to specific checkpoint
80
+ /compact Compact context (keep last 3 messages)
63
81
  /sessions List saved sessions
64
82
  /resume [id] Resume a session
83
+ /replay Show session recordings
84
+ ```
65
85
 
66
- # Scanning & Enumeration
67
- /scan <target> Quick enumeration
68
- /web <url> Web application testing
69
-
70
- # Exploitation
71
- /exploit <service> Search for exploits
72
- /privesc [os] Check privilege escalation vectors
73
- /attack <objective> Execute attack chain
74
- /hash <hash> Identify and crack hashes
86
+ ### Skills & Extras
87
+ ```bash
88
+ /skills List available skills
89
+ /update Check for updates
90
+ /update now Install update
91
+ ```
75
92
 
76
- # Reporting
93
+ ### Findings & Reports
94
+ ```bash
95
+ /findings Show discovered findings
77
96
  /report Generate pentest report
78
- /findings Show findings
97
+ ```
79
98
 
80
- # Control
99
+ ### Utility
100
+ ```bash
101
+ /paste Paste from clipboard (text or image)
81
102
  /yolo Toggle auto-approve mode
82
- /approve /deny Approve/deny tool execution
83
103
  /clear Clear screen
84
104
  /exit Exit
105
+ /y /n /ya Approve/Deny/Always approve (for pending tools)
85
106
  ```
86
107
 
87
108
  ---
@@ -195,33 +216,62 @@ await agent.addMCPServer('security-tools', 'docker', [
195
216
  ## 🏗️ Architecture
196
217
 
197
218
  ```
198
- ┌─────────────────────────────────────────────────────────────┐
199
- TUI (app.tsx)
200
- - Streaming text display
201
- - Tool approval prompts
202
- - Session management
203
- └──────────────────────────┬──────────────────────────────────┘
204
- │ Wire Protocol
205
- ┌──────────────────────────▼──────────────────────────────────┐
206
- │ PentestingAgent (Unified) │
207
- ┌──────────────┐ ┌──────────────┐ ┌──────────────┐
208
- RalphLoop │ │ Streaming │ Session │ │
209
- │ │ (Auto-iter) Handler Manager
210
- └──────────────┘ └──────────────┘ └──────────────┘
211
-
212
- ┌──────────────────────────────────────────────────┐
213
- │ AutonomousHackingAgent (Core)
214
- │ │ ┌──────────────────────────────────────────┐
215
- │ │ 9 Built-in Specialized Agents
216
- │ │ └──────────────────────────────────────────┘
217
- └──────────────────────────────────────────────────┘
218
- └──────────────────────────┬──────────────────────────────────┘
219
-
220
- ┌────────────────┼────────────────┐
221
- ┌────▼────┐ ┌────▼────┐ ┌────▼────┐
222
- │ Tool │ │ Bash │ │ MCP │
223
- Executor Commands Servers
224
- └─────────┘ └─────────┘ └─────────┘
219
+ ┌─────────────────────────────────────────────────────────────────┐
220
+ TUI (app.tsx)
221
+ ┌──────────────┐ ┌──────────────┐ ┌──────────────────────────┐
222
+ WireLogger │ │ContextMgr │ SlashCommandRegistry │ │
223
+ (Recording) │(Checkpoints)│ │ (Command Handling) │ │
224
+ │ └──────────────┘ └──────────────┘ └──────────────────────────┘ │
225
+ └────────────────────────────┬────────────────────────────────────┘
226
+ │ Events
227
+ ┌────────────────────────────▼────────────────────────────────────┐
228
+ AutonomousHackingAgent (Core Engine)
229
+ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐
230
+ │ │ HookExecutor MCPManager │ │ApprovalMgr
231
+ │ (Lifecycle) │ (Extensions) │ │(Tool Safety) │ │
232
+ └──────────────┘ └──────────────┘ └──────────────┘
233
+
234
+ ┌────────────────────────────────────────────────────────────┐
235
+ │ │ 9 Built-in Specialized Agents
236
+ │ │ target-explorer exploit-researcher privesc-master
237
+ │ │ web-hacker • crypto-solver • forensics-analyst
238
+ │ │ reverse-engineer • attack-architect • finding-reviewer │ │
239
+ │ └────────────────────────────────────────────────────────────┘ │
240
+ └────────────────────────────┬────────────────────────────────────┘
241
+
242
+ ┌──────────────────┼──────────────────┐
243
+ ┌────▼────┐ ┌────▼────┐ ┌────▼────┐
244
+ Tool Bash MCP
245
+ │Executor │ │Commands │ │ Servers │
246
+ └─────────┘ └─────────┘ └─────────┘
247
+ ```
248
+
249
+ ### Module Connectivity
250
+
251
+ ```
252
+ Core Modules (src/core/):
253
+ ├── agent/ AutonomousHackingAgent, PentestingAgent, AgentOrchestrator
254
+ ├── approval/ ApprovalManager - tool execution safety
255
+ ├── commands/ SlashCommandRegistry - command handling
256
+ ├── context/ ContextManager (checkpoints) + Compaction (tokens)
257
+ ├── display/ DisplayBlocks - rich output formatting
258
+ ├── hooks/ HookExecutor - lifecycle events
259
+ ├── loop/ RalphLoop - autonomous iteration
260
+ ├── prompts/ System prompts for agents
261
+ ├── replay/ SessionReplay - wire file parsing
262
+ ├── session/ SessionManager - persistence
263
+ ├── skill/ SkillManager + FlowExecutor - workflow automation
264
+ ├── streaming/ StreamingAgent - real-time output
265
+ ├── tools/ Tool definitions, executor, registry
266
+ └── update/ AutoUpdate - version management
267
+
268
+ Support Modules:
269
+ ├── wire/ WireLogger (JSONL recording) + Wire Protocol
270
+ ├── mcp/ MCPManager, MCPClient - extensions
271
+ ├── utils/ Clipboard, Retry utilities
272
+ ├── agents/ 9 built-in specialized agents
273
+ ├── commands/ Built-in slash commands
274
+ └── config/ Constants, Theme, Agent configuration
225
275
  ```
226
276
 
227
277
  ---
@@ -231,21 +281,29 @@ await agent.addMCPServer('security-tools', 'docker', [
231
281
  ```
232
282
  src/
233
283
  ├── index.tsx # CLI entry point
234
- ├── cli/app.tsx # TUI with streaming, approval, sessions
284
+ ├── cli/
285
+ │ ├── app.tsx # TUI with streaming, approval, sessions
286
+ │ └── components/ # Rich display components
235
287
  ├── core/
236
288
  │ ├── agent/ # Agent implementations
237
289
  │ ├── approval/ # Tool approval system
238
- │ ├── context/ # Conversation compaction
290
+ │ ├── commands/ # Slash command registry
291
+ │ ├── context/ # Checkpoint + compaction
292
+ │ ├── display/ # Rich output blocks
239
293
  │ ├── hooks/ # Event hooks
240
294
  │ ├── loop/ # Ralph autonomous loop
295
+ │ ├── replay/ # Session replay
241
296
  │ ├── session/ # Session persistence
297
+ │ ├── skill/ # Flow skills (Mermaid/D2)
242
298
  │ ├── streaming/ # Real-time streaming
299
+ │ ├── update/ # Auto-update system
243
300
  │ ├── prompts/ # System prompts
244
301
  │ └── tools/ # Tool definitions & executor
245
- ├── agents/index.ts # 9 built-in specialized agents
246
- ├── commands/index.ts # Built-in slash commands
247
- ├── wire/ # Agent-UI communication
302
+ ├── agents/ # 9 built-in specialized agents
303
+ ├── commands/ # Built-in slash commands
304
+ ├── wire/ # JSONL logging + Wire protocol
248
305
  ├── mcp/ # MCP client integration
306
+ ├── utils/ # Clipboard, retry utilities
249
307
  └── config/ # Constants, theme
250
308
  ```
251
309
 
@@ -8,8 +8,8 @@ import {
8
8
  readVersionCache,
9
9
  semverTuple,
10
10
  writeVersionCache
11
- } from "./chunk-TABUHG2A.js";
12
- import "./chunk-JUHBSTKO.js";
11
+ } from "./chunk-F7CHQELL.js";
12
+ import "./chunk-YS332RPG.js";
13
13
  import "./chunk-3RG5ZIWI.js";
14
14
  export {
15
15
  checkForUpdate,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  APP_NAME,
3
3
  APP_VERSION
4
- } from "./chunk-JUHBSTKO.js";
4
+ } from "./chunk-YS332RPG.js";
5
5
 
6
6
  // src/core/update/auto-update.ts
7
7
  import { execSync } from "child_process";
@@ -132,7 +132,7 @@ var SENSITIVE_TOOLS = [
132
132
 
133
133
  // src/config/constants.ts
134
134
  var APP_NAME = "pentesting";
135
- var APP_VERSION = "0.4.1";
135
+ var APP_VERSION = "0.4.3";
136
136
  var APP_DESCRIPTION = "Autonomous Penetration Testing AI Agent";
137
137
  var LLM_API_KEY = process.env.PENTEST_API_KEY || process.env.ANTHROPIC_API_KEY || "";
138
138
  var LLM_BASE_URL = process.env.PENTEST_BASE_URL || void 0;
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  PHASE_STATUS,
16
16
  THOUGHT_TYPE,
17
17
  TOOL_NAME
18
- } from "./chunk-JUHBSTKO.js";
18
+ } from "./chunk-YS332RPG.js";
19
19
  import {
20
20
  __require
21
21
  } from "./chunk-3RG5ZIWI.js";
@@ -4922,7 +4922,7 @@ var App = ({ autoApprove = false, target }) => {
4922
4922
  setCheckpointCount(contextManagerRef.current?.getCheckpoints().length || 0);
4923
4923
  }
4924
4924
  });
4925
- import("./auto-update-ZU3T3VSG.js").then(({ checkForUpdateAsync, formatUpdateNotification }) => {
4925
+ import("./auto-update-3CXD4I54.js").then(({ checkForUpdateAsync, formatUpdateNotification }) => {
4926
4926
  checkForUpdateAsync().then((result) => {
4927
4927
  if (result.hasUpdate) {
4928
4928
  const notification = formatUpdateNotification(result);
@@ -4965,13 +4965,38 @@ var App = ({ autoApprove = false, target }) => {
4965
4965
  return duration;
4966
4966
  }, []);
4967
4967
  useEffect(() => {
4968
- addMessage(MESSAGE_TYPE.SYSTEM, "Pentesting Agent initialized. Type /help for commands.");
4968
+ const versionPadded = `v${APP_VERSION}`.padStart(43);
4969
+ const banner = `
4970
+ \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
4971
+ \u2551 \u2551
4972
+ \u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2551
4973
+ \u2551 \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D\u2551
4974
+ \u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2554\u2588\u2588\u2557 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551 \u2551
4975
+ \u2551 \u2588\u2588\u2554\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2551\u255A\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551 \u2588\u2588\u2551 \u2551
4976
+ \u2551 \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551 \u2588\u2588\u2551 \u2551
4977
+ \u2551 \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u2551
4978
+ \u2551 \u2551
4979
+ \u2551 Autonomous Pentesting Agent ${versionPadded} \u2551
4980
+ \u2551 \u2551
4981
+ \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D`;
4982
+ addMessage(MESSAGE_TYPE.SYSTEM, banner);
4983
+ addMessage(MESSAGE_TYPE.SYSTEM, `
4984
+ \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510
4985
+ \u2502 \u{1F680} Quick Start \u2502
4986
+ \u2502 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2502
4987
+ \u2502 /target <ip> Set target IP/hostname \u2502
4988
+ \u2502 /start [goal] Start autonomous pentesting \u2502
4989
+ \u2502 /help Show all commands \u2502
4990
+ \u2502 \u2502
4991
+ \u2502 \u{1F527} Features: 10 Attack Phases \u2022 9 Specialized Agents \u2502
4992
+ \u2502 \u{1F4E1} Session Recording \u2022 Checkpoints \u2022 Auto-Update \u2502
4993
+ \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518`);
4969
4994
  if (autoApprove) {
4970
- addMessage(MESSAGE_TYPE.SYSTEM, "\u26A0\uFE0F YOLO mode: Auto-approving all tools");
4995
+ addMessage(MESSAGE_TYPE.SYSTEM, "\u26A0\uFE0F YOLO Mode: Auto-approving all tool executions");
4971
4996
  }
4972
4997
  if (target) {
4973
4998
  agent.setTarget(target);
4974
- addMessage(MESSAGE_TYPE.SYSTEM, `Target: ${target}`);
4999
+ addMessage(MESSAGE_TYPE.SYSTEM, `\u{1F3AF} Target: ${target}`);
4975
5000
  }
4976
5001
  agent.on(AGENT_EVENT.THOUGHT, (thought) => {
4977
5002
  setCurrentStatus(thought.content.slice(0, 60));
@@ -5384,7 +5409,7 @@ var App = ({ autoApprove = false, target }) => {
5384
5409
  return;
5385
5410
  case "update":
5386
5411
  try {
5387
- const { checkForUpdate, formatUpdateNotification, doUpdate } = await import("./update-4H3DBFBE.js");
5412
+ const { checkForUpdate, formatUpdateNotification, doUpdate } = await import("./update-FH4FXNSB.js");
5388
5413
  const result = checkForUpdate(true);
5389
5414
  if (result.hasUpdate) {
5390
5415
  const notification = formatUpdateNotification(result);
@@ -8,8 +8,8 @@ import {
8
8
  readVersionCache,
9
9
  semverTuple,
10
10
  writeVersionCache
11
- } from "./chunk-TABUHG2A.js";
12
- import "./chunk-JUHBSTKO.js";
11
+ } from "./chunk-F7CHQELL.js";
12
+ import "./chunk-YS332RPG.js";
13
13
  import "./chunk-3RG5ZIWI.js";
14
14
  export {
15
15
  checkForUpdate,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pentesting",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "description": "Autonomous Penetration Testing AI Agent",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",