dsh-pentester 0.0.1 → 1.0.0
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 +39 -5
- package/agents/impact/profile.yml +19 -0
- package/agents/recon/profile.yml +23 -0
- package/agents/reporting/REPORT_TEMPLATE.md +333 -0
- package/agents/reporting/profile.yml +45 -0
- package/agents/threat-model/profile.yml +19 -0
- package/agents/validation/profile.yml +20 -0
- package/agents/vulnerability/profile.yml +19 -0
- package/agents/web/profile.yml +19 -0
- package/cordis.dev.patch.yml +16 -0
- package/cordis.patch.yml +2 -0
- package/docker/README.md +60 -0
- package/docker/kali/Dockerfile +881 -0
- package/docker/kali/README.md +104 -0
- package/docker/kali/REPORT_TEMPLATE.md +333 -0
- package/docker/kali/TOOL_PROMPT.md +362 -0
- package/docker/kali/bin/clone-kb +39 -0
- package/docker/kali/bin/entrypoint.sh +9 -0
- package/docker/kali/bin/gen-tools-json.sh +246 -0
- package/docker/kali/bin/record-traffic.sh +32 -0
- package/docker/kali/bin/tool-info +31 -0
- package/docker/kali/bin/tool-list +17 -0
- package/lib/catalog-BmeOyr6n.js +231 -0
- package/lib/catalog-BmeOyr6n.js.map +1 -0
- package/lib/catalog-DhE_r18k.js +231 -0
- package/lib/catalog-DhE_r18k.js.map +1 -0
- package/lib/client.js +15234 -0
- package/lib/client.js.map +7 -0
- package/lib/container-listing-BI6Xj8l2.js +56 -0
- package/lib/container-listing-BI6Xj8l2.js.map +1 -0
- package/lib/container-listing-BWZoBnN_.js +56 -0
- package/lib/container-listing-BWZoBnN_.js.map +1 -0
- package/lib/container-listing-CE5t-Y_H.js +56 -0
- package/lib/container-listing-CE5t-Y_H.js.map +1 -0
- package/lib/container-listing-DZPBvrLD.js +56 -0
- package/lib/container-listing-DZPBvrLD.js.map +1 -0
- package/lib/docker-tar-_wf8UrSj.js +66 -0
- package/lib/docker-tar-_wf8UrSj.js.map +1 -0
- package/lib/engagement-container-store-B9D8g0wq.js +641 -0
- package/lib/engagement-container-store-B9D8g0wq.js.map +1 -0
- package/lib/engagement-container-store-Cf-h0B4F.js +641 -0
- package/lib/engagement-container-store-Cf-h0B4F.js.map +1 -0
- package/lib/engagement-container-store-Cu1wuur1.js +639 -0
- package/lib/engagement-container-store-Cu1wuur1.js.map +1 -0
- package/lib/engagement-container-store-L_Gms-zi.js +632 -0
- package/lib/engagement-container-store-L_Gms-zi.js.map +1 -0
- package/lib/index.d.ts +41 -0
- package/lib/index.js +3200 -0
- package/lib/index.js.map +1 -0
- package/lib/model-CZoiogVs.js +149 -0
- package/lib/model-CZoiogVs.js.map +1 -0
- package/lib/model-DKZ5Rjik.js +145 -0
- package/lib/model-DKZ5Rjik.js.map +1 -0
- package/lib/worker-events-jFvaBp9x.js +351 -0
- package/lib/worker-events-jFvaBp9x.js.map +1 -0
- package/lib/worker-events-juSf0EDW.js +347 -0
- package/lib/worker-events-juSf0EDW.js.map +1 -0
- package/package.json +89 -8
- package/presets/pentester/agent.cordis.yml +194 -0
- package/presets/pentester/preset.yml +2 -0
- package/presets/pentester/run-state.mjs +210 -0
- package/index.js +0 -5
package/README.md
CHANGED
|
@@ -1,13 +1,47 @@
|
|
|
1
1
|
# dsh-pentester
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
面向 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 的最小化 Root-Orchestrator PTES 渗透测试插件。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**唯一事实来源是 [`docs/plan.md`](docs/plan.md)**;架构视图见 [`docs/architecture.md`](docs/architecture.md),磁盘布局见 [`docs/workspace.md`](docs/workspace.md),领域术语见 [`CONTEXT.md`](CONTEXT.md)。
|
|
6
|
+
|
|
7
|
+
## 心智模型
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
User ⇄ DSH Root Session(pentester persona preset)
|
|
11
|
+
→ Root 是唯一 Orchestrator:判断缺口、派发 Delegation、决定推进/回溯阶段
|
|
12
|
+
→ Root 工具面 4 个:pentester_delegate / pentester_cancel_delegation /
|
|
13
|
+
pentester_advance_stage / pentester_rollback_stage
|
|
14
|
+
→ Root 每次 reasoning 前注入 compact run state(target/branch/stage/delegations)
|
|
15
|
+
Delegation(并行多个)= 各一个 DSH child session(AgentProfile + 不可变 task_prompt)
|
|
16
|
+
→ Worker 工具只有 pentester_container_exec(dockerode;Root 不可见)
|
|
17
|
+
→ Worker 写完 result.md 即完成任务(完成标志);缺失 → failed
|
|
18
|
+
Deliverable = 文件(workspace/stages/<NN>-<stage>/delegations/D-00N/)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## 安装
|
|
6
22
|
|
|
7
23
|
```bash
|
|
24
|
+
# github 源
|
|
25
|
+
dsh plugin --profile web add github:fb0sh/dsh-pentester
|
|
26
|
+
# npm 源
|
|
8
27
|
dsh plugin --profile web add dsh-pentester
|
|
9
|
-
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## 布局
|
|
10
31
|
|
|
11
|
-
|
|
32
|
+
| 目录/文件 | 职责 |
|
|
33
|
+
| --- | --- |
|
|
34
|
+
| `src/` | model/stages/profiles/store、workspace/git、dsh/delegations/tools/worker-tools、docker/(host/connection/images/runtime)、rpc/settings-store、index |
|
|
35
|
+
| `src/ui/client/` | Settings 的 “Pentester Config” 页(Tab:Docker Engine) |
|
|
36
|
+
| `agents/*/profile.yml` | 7 个 AgentProfile(systemPrompt/skills/mcpServers) |
|
|
37
|
+
| `docker/` | Toolbox Dockerfile(kali 等,镜像白名单来源) |
|
|
38
|
+
| `presets/pentester/` | Root persona preset + `run-state.mjs`(工具面限制 + 动态状态注入) |
|
|
39
|
+
|
|
40
|
+
## 开发
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pnpm run check # typecheck + build(含 client bundle)
|
|
44
|
+
pnpm test # node --test
|
|
45
|
+
```
|
|
12
46
|
|
|
13
|
-
|
|
47
|
+
Docker host 优先级:Settings(settings.json)> 插件配置 > 本地 socket 自动发现 > `DOCKER_HOST` > 默认 socket。本地 Docker 用 bind mount(host workspace == 容器 /workspace);远程 daemon 用共享 volume,阶段边界才做 mirror sync。
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
id: impact
|
|
2
|
+
name: Post Exploitation Agent
|
|
3
|
+
description: Impact assessment: lateral reach, data exposure, business consequences.
|
|
4
|
+
skills:
|
|
5
|
+
mcpServers:
|
|
6
|
+
systemPrompt: |
|
|
7
|
+
You are the Post Exploitation specialist of an authorized pentest run.
|
|
8
|
+
Method: from verified footholds, assess blast radius, data exposure and
|
|
9
|
+
business impact. Enumerate what is reachable rather than taking
|
|
10
|
+
destructive actions. Quantify or clearly describe business consequences
|
|
11
|
+
and record cleanup/recovery actions taken. Write your assessment
|
|
12
|
+
(impact-assessment.md ...) into your delegation directory
|
|
13
|
+
/workspace/stages/<NN>-<stage>/delegations/<D-XXX>/ (artifacts/ for final
|
|
14
|
+
outputs, evidence/ for proof, work/ for scratch). Stay strictly inside the
|
|
15
|
+
recorded targets and RoE. Never modify .git/, .dsh-pentester/, other
|
|
16
|
+
delegation directories or target/. Never run git commands. When the task is
|
|
17
|
+
finished, write result.md in your delegation directory — it is the
|
|
18
|
+
completion marker. Write all content (except tool raw output) in the
|
|
19
|
+
language of your task_prompt (the user's language).
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
id: recon
|
|
2
|
+
name: Recon Agent
|
|
3
|
+
description: Intelligence gathering over in-scope targets (network, service and OSINT surface).
|
|
4
|
+
# Skills / MCP are attached by DSH presets (deferred wiring; names are reserved).
|
|
5
|
+
skills:
|
|
6
|
+
mcpServers:
|
|
7
|
+
systemPrompt: |
|
|
8
|
+
You are the Recon specialist of an authorized pentest run.
|
|
9
|
+
Method: enumerate in-scope services and endpoints, fingerprint technology
|
|
10
|
+
stacks, and record structured facts. Prefer passive or low-noise techniques
|
|
11
|
+
first. Never rescan what earlier deliverables already cover — read
|
|
12
|
+
/workspace first: /workspace/target/ and earlier stage dirs under
|
|
13
|
+
/workspace/stages/ (including sibling D-* deliverable dirs).
|
|
14
|
+
Write your outputs (assets.json / services.json / notes.md ...) into YOUR
|
|
15
|
+
delegation directory /workspace/stages/<NN>-<stage>/delegations/<D-XXX>/:
|
|
16
|
+
work/ for scratch, artifacts/ for final outputs, evidence/ for reproducible
|
|
17
|
+
evidence (commands + outputs). Every claim must be reproducible from the
|
|
18
|
+
command output you keep. Stay strictly inside the recorded targets and RoE.
|
|
19
|
+
Never modify .git/, .dsh-pentester/, other delegation directories or
|
|
20
|
+
target/. Never run git commands; the host owns git checkpoints. When the
|
|
21
|
+
task is finished, write result.md in your delegation directory — it is the
|
|
22
|
+
completion marker. Write all content (except tool raw output) in the
|
|
23
|
+
language of your task_prompt (the user's language).
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
# {目标名称} 渗透测试报告
|
|
2
|
+
|
|
3
|
+
**报告编号**: PT-{YYYY}-{MMDD}-{PROJECT}
|
|
4
|
+
**测试目标**: {目标 IP/域名}
|
|
5
|
+
**测试日期**: {开始日期}
|
|
6
|
+
**报告日期**: {报告日期}
|
|
7
|
+
**报告分类**: 机密
|
|
8
|
+
**测试框架**: PTES (Penetration Testing Execution Standard)
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 目录
|
|
13
|
+
|
|
14
|
+
1. [执行摘要](#1-执行摘要)
|
|
15
|
+
2. [测试范围与授权](#2-测试范围与授权)
|
|
16
|
+
3. [测试方法论](#3-测试方法论)
|
|
17
|
+
4. [技术发现详述](#4-技术发现详述)
|
|
18
|
+
5. [攻击链分析](#5-攻击链分析)
|
|
19
|
+
6. [影响评估](#6-影响评估)
|
|
20
|
+
7. [修复优先级建议](#7-修复优先级建议)
|
|
21
|
+
8. [清理记录](#8-清理记录)
|
|
22
|
+
9. [附录](#9-附录)
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 1. 执行摘要
|
|
27
|
+
|
|
28
|
+
### 1.1 测试概述
|
|
29
|
+
|
|
30
|
+
{一段话概述测试目标、技术栈、端口/服务范围}
|
|
31
|
+
|
|
32
|
+
### 1.2 核心结论
|
|
33
|
+
|
|
34
|
+
**整体风险等级: {CRITICAL / HIGH / MEDIUM / LOW}**
|
|
35
|
+
|
|
36
|
+
{一句话总结最重要的发现}
|
|
37
|
+
|
|
38
|
+
### 1.3 关键发现
|
|
39
|
+
|
|
40
|
+
| 严重性 | 漏洞数量 | 关键漏洞 |
|
|
41
|
+
|--------|----------|----------|
|
|
42
|
+
| 🔴 CRITICAL | {N} | {列出 CRITICAL 漏洞名} |
|
|
43
|
+
| 🟡 HIGH | {N} | {列出 HIGH 漏洞名} |
|
|
44
|
+
| 🟠 MEDIUM | {N} | {列出 MEDIUM 漏洞名} |
|
|
45
|
+
| 🟢 LOW | {N} | {列出 LOW 漏洞名} |
|
|
46
|
+
|
|
47
|
+
### 1.4 业务影响
|
|
48
|
+
|
|
49
|
+
- {影响点 1}
|
|
50
|
+
- {影响点 2}
|
|
51
|
+
- {影响点 3}
|
|
52
|
+
|
|
53
|
+
### 1.5 最快攻击路径
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
{描述最高效的攻击链,从入口到完全控制}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## 2. 测试范围与授权
|
|
62
|
+
|
|
63
|
+
### 2.1 测试范围
|
|
64
|
+
|
|
65
|
+
| 属性 | 值 |
|
|
66
|
+
|------|-----|
|
|
67
|
+
| **主要目标** | {IP/域名} |
|
|
68
|
+
| **端口范围** | {端口列表} |
|
|
69
|
+
| **应用范围** | {应用描述} |
|
|
70
|
+
| **排除项** | {排除项,无则填"无"} |
|
|
71
|
+
|
|
72
|
+
### 2.2 交战规则 (Rules of Engagement)
|
|
73
|
+
|
|
74
|
+
- ✅ {允许的操作}
|
|
75
|
+
- ❌ {禁止的操作}
|
|
76
|
+
- 范围仅限 {范围}
|
|
77
|
+
|
|
78
|
+
### 2.3 授权
|
|
79
|
+
|
|
80
|
+
{授权说明}
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## 3. 测试方法论
|
|
85
|
+
|
|
86
|
+
本次渗透测试严格遵循 **PTES (Penetration Testing Execution Standard)** 标准,按七个阶段依次执行:
|
|
87
|
+
|
|
88
|
+
### 3.1 预参与阶段 (Pre-engagement)
|
|
89
|
+
{预参与阶段做了什么}
|
|
90
|
+
|
|
91
|
+
### 3.2 情报收集 (Intelligence Gathering)
|
|
92
|
+
{情报收集阶段做了什么,使用了哪些工具和技术}
|
|
93
|
+
|
|
94
|
+
### 3.3 威胁建模 (Threat Modeling)
|
|
95
|
+
{威胁建模阶段做了什么,使用了什么框架}
|
|
96
|
+
|
|
97
|
+
### 3.4 漏洞分析 (Vulnerability Analysis)
|
|
98
|
+
{漏洞分析阶段做了什么,验证了哪些攻击路径}
|
|
99
|
+
|
|
100
|
+
### 3.5 利用 (Exploitation)
|
|
101
|
+
{利用阶段做了什么,实现了哪些攻击}
|
|
102
|
+
|
|
103
|
+
### 3.6 后利用 (Post-exploitation)
|
|
104
|
+
{后利用阶段做了什么,评估了持久化和横向移动}
|
|
105
|
+
|
|
106
|
+
### 3.7 报告 (Reporting)
|
|
107
|
+
{报告阶段说明}
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## 4. 技术发现详述
|
|
112
|
+
|
|
113
|
+
{每个发现一个独立小节,按严重性从高到低排列}
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
### F-001: {漏洞名称}
|
|
118
|
+
|
|
119
|
+
| 属性 | 值 |
|
|
120
|
+
|------|-----|
|
|
121
|
+
| **严重性** | {🔴 CRITICAL / 🟡 HIGH / 🟠 MEDIUM / 🟢 LOW} |
|
|
122
|
+
| **CVSS 3.1 评分** | **{X.X}** |
|
|
123
|
+
| **CVSS 向量** | `CVSS:3.1/{向量}` |
|
|
124
|
+
| **CWE** | {CWE-XXX: 描述} |
|
|
125
|
+
| **发现阶段** | {阶段名称} |
|
|
126
|
+
| **利用验证** | {阶段名称} |
|
|
127
|
+
|
|
128
|
+
#### 漏洞描述
|
|
129
|
+
|
|
130
|
+
{清晰描述漏洞原理}
|
|
131
|
+
|
|
132
|
+
#### CVSS 向量解析
|
|
133
|
+
|
|
134
|
+
| 度量 | 值 | 说明 |
|
|
135
|
+
|------|-----|------|
|
|
136
|
+
| AV:N | {值} | {说明} |
|
|
137
|
+
| AC:L | {值} | {说明} |
|
|
138
|
+
| PR:N | {值} | {说明} |
|
|
139
|
+
| UI:N | {值} | {说明} |
|
|
140
|
+
| S:C | {值} | {说明} |
|
|
141
|
+
| C:H | {值} | {说明} |
|
|
142
|
+
| I:H | {值} | {说明} |
|
|
143
|
+
| A:H | {值} | {说明} |
|
|
144
|
+
|
|
145
|
+
#### 复现步骤
|
|
146
|
+
|
|
147
|
+
{详细复现步骤,包含具体命令和参数}
|
|
148
|
+
|
|
149
|
+
#### 影响
|
|
150
|
+
|
|
151
|
+
- {影响点 1}
|
|
152
|
+
- {影响点 2}
|
|
153
|
+
- {影响点 3}
|
|
154
|
+
|
|
155
|
+
#### 证据
|
|
156
|
+
|
|
157
|
+
- {证据文件路径 1}
|
|
158
|
+
- {证据文件路径 2}
|
|
159
|
+
|
|
160
|
+
#### 修复建议
|
|
161
|
+
|
|
162
|
+
1. {修复建议 1}
|
|
163
|
+
2. {修复建议 2}
|
|
164
|
+
3. {修复建议 3}
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
### F-002: {漏洞名称}
|
|
169
|
+
|
|
170
|
+
{同上结构}
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
{继续添加更多发现...}
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## 5. 攻击链分析
|
|
179
|
+
|
|
180
|
+
### 5.1 最快攻击路径
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
{描述最高效攻击路径}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### 5.2 完整攻击链
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
{描述完整攻击链,分阶段展示}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### 5.3 攻击链组合
|
|
193
|
+
|
|
194
|
+
{使用 mermaid 流程图描绘攻击链组合}
|
|
195
|
+
|
|
196
|
+
```mermaid
|
|
197
|
+
flowchart LR
|
|
198
|
+
A[匿名攻击者] --> B{选择入口}
|
|
199
|
+
B -->|路径 A| C[入口A]
|
|
200
|
+
B -->|路径 B| D[入口B]
|
|
201
|
+
C --> E[权限]
|
|
202
|
+
D --> E
|
|
203
|
+
E --> F[目标]
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## 6. 影响评估
|
|
209
|
+
|
|
210
|
+
### 6.1 数据泄露统计
|
|
211
|
+
|
|
212
|
+
| 数据类型 | 数量 | 敏感度 | 详情 |
|
|
213
|
+
|----------|------|--------|------|
|
|
214
|
+
| {数据类型} | {数量} | {🔴 高 / 🟡 中 / 🟢 低} | {详情} |
|
|
215
|
+
|
|
216
|
+
### 6.2 泄露的 PII 详情
|
|
217
|
+
|
|
218
|
+
| 用户 | 邮箱 | 手机号 | 收货地址 |
|
|
219
|
+
|------|------|--------|----------|
|
|
220
|
+
| {用户名} | {邮箱} | {手机号} | {地址} |
|
|
221
|
+
|
|
222
|
+
### 6.3 CIA 三元组评估
|
|
223
|
+
|
|
224
|
+
| 维度 | 等级 | 说明 |
|
|
225
|
+
|------|------|------|
|
|
226
|
+
| **机密性** (Confidentiality) | {等级} | {说明} |
|
|
227
|
+
| **完整性** (Integrity) | {等级} | {说明} |
|
|
228
|
+
| **可用性** (Availability) | {等级} | {说明} |
|
|
229
|
+
|
|
230
|
+
### 6.4 合规风险
|
|
231
|
+
|
|
232
|
+
- {合规风险 1}
|
|
233
|
+
- {合规风险 2}
|
|
234
|
+
|
|
235
|
+
### 6.5 持久化评估
|
|
236
|
+
|
|
237
|
+
| 持久化方式 | 可行性 | 隐蔽性 | 持久性 | 说明 |
|
|
238
|
+
|-----------|--------|--------|--------|------|
|
|
239
|
+
| {方式} | {✅/❌} | {高/中/低} | {高/中/低} | {说明} |
|
|
240
|
+
|
|
241
|
+
### 6.6 横向移动
|
|
242
|
+
|
|
243
|
+
{横向移动评估}
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## 7. 修复优先级建议
|
|
248
|
+
|
|
249
|
+
### 7.1 P0 — 立即修复(24 小时内)
|
|
250
|
+
|
|
251
|
+
| # | 修复项 | 关联漏洞 | 修复方法 |
|
|
252
|
+
|---|--------|---------|---------|
|
|
253
|
+
| 1 | **{修复项}** | {漏洞ID} | {具体修复方法} |
|
|
254
|
+
|
|
255
|
+
### 7.2 P1 — 尽快修复(1 周内)
|
|
256
|
+
|
|
257
|
+
| # | 修复项 | 关联漏洞 | 修复方法 |
|
|
258
|
+
|---|--------|---------|---------|
|
|
259
|
+
|
|
260
|
+
### 7.3 P2 — 计划修复(1 月内)
|
|
261
|
+
|
|
262
|
+
| # | 修复项 | 关联漏洞 | 修复方法 |
|
|
263
|
+
|---|--------|---------|---------|
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## 8. 清理记录
|
|
268
|
+
|
|
269
|
+
### 8.1 已完成的清理
|
|
270
|
+
|
|
271
|
+
| 操作 | 目标 | 状态 |
|
|
272
|
+
|------|------|------|
|
|
273
|
+
| {操作} | {目标} | ✅ |
|
|
274
|
+
|
|
275
|
+
### 8.2 无法清理的项目
|
|
276
|
+
|
|
277
|
+
| 项目 | 数量 | 原因 |
|
|
278
|
+
|------|------|------|
|
|
279
|
+
| {项目} | {数量} | {原因} |
|
|
280
|
+
|
|
281
|
+
### 8.3 建议的后续清理
|
|
282
|
+
|
|
283
|
+
1. {建议 1}
|
|
284
|
+
2. {建议 2}
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## 9. 附录
|
|
289
|
+
|
|
290
|
+
### 9.1 技术栈总览
|
|
291
|
+
|
|
292
|
+
```
|
|
293
|
+
{技术栈架构图}
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
### 9.2 API 端点汇总
|
|
297
|
+
|
|
298
|
+
**公开端点** ({N} 个):
|
|
299
|
+
{列出公开端点}
|
|
300
|
+
|
|
301
|
+
**需认证端点** ({N} 个):
|
|
302
|
+
{列出需认证端点}
|
|
303
|
+
|
|
304
|
+
**管理员端点** ({N} 个):
|
|
305
|
+
{列出管理员端点}
|
|
306
|
+
|
|
307
|
+
### 9.3 漏洞汇总表
|
|
308
|
+
|
|
309
|
+
| ID | 漏洞名称 | 严重性 | CVSS | CWE | 阶段 |
|
|
310
|
+
|----|---------|--------|------|-----|------|
|
|
311
|
+
| F-001 | {名称} | {严重性} | {CVSS} | {CWE} | {阶段} |
|
|
312
|
+
|
|
313
|
+
### 9.4 交付物路径
|
|
314
|
+
|
|
315
|
+
| 阶段 | 路径 |
|
|
316
|
+
|------|------|
|
|
317
|
+
| 预参与 | `/workspace/stages/01-pre-engagement/summary.md` |
|
|
318
|
+
| 情报收集 | `/workspace/stages/02-intelligence-gathering/` |
|
|
319
|
+
| 威胁建模 | `/workspace/stages/03-threat-modeling/` |
|
|
320
|
+
| 漏洞分析 | `/workspace/stages/04-vulnerability-analysis/` |
|
|
321
|
+
| 利用 | `/workspace/stages/05-exploitation/` |
|
|
322
|
+
| 后利用 | `/workspace/stages/06-post-exploitation/` |
|
|
323
|
+
| 报告 | `/workspace/report/report.md` |
|
|
324
|
+
|
|
325
|
+
### 9.5 测试账号
|
|
326
|
+
|
|
327
|
+
{列出测试期间创建的账号,建议后续清理}
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
**报告结束**
|
|
332
|
+
|
|
333
|
+
*本报告为 {目标名称} 渗透测试的最终交付物,包含全部确认漏洞的详细分析、攻击链演示、影响评估和修复建议。报告仅供授权人员查阅,请勿外传。*
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
id: reporting
|
|
2
|
+
name: Reporting Agent
|
|
3
|
+
description: Final report assembly from the full pentest deliverable tree.
|
|
4
|
+
skills:
|
|
5
|
+
mcpServers:
|
|
6
|
+
systemPrompt: |
|
|
7
|
+
You are the Reporting specialist of an authorized pentest run.
|
|
8
|
+
Method: read the ENTIRE workspace deliverable tree — /workspace/stages/
|
|
9
|
+
(all stage dirs with summary.md and delegation dirs), /workspace/findings/,
|
|
10
|
+
/workspace/target/ — then write
|
|
11
|
+
the final report to /workspace/report/report.md (your delegation directory
|
|
12
|
+
is /workspace/stages/07-reporting/delegations/<D-XXX>/, but the report must
|
|
13
|
+
land in /workspace/report/). The report must cover: scope and RoE,
|
|
14
|
+
methodology per stage, confirmed findings (each with evidence references,
|
|
15
|
+
impact and remediation advice), unverified items with reasons, and an
|
|
16
|
+
executive summary. report.md is the canonical human-readable deliverable.
|
|
17
|
+
|
|
18
|
+
REPORT STRUCTURE — follow this exact template. Read
|
|
19
|
+
/pentester/REPORT_TEMPLATE.md for the full section-by-section structure.
|
|
20
|
+
The nine required sections are:
|
|
21
|
+
|
|
22
|
+
1. Executive Summary — overview, risk rating, key findings table, business
|
|
23
|
+
impact, fastest attack path.
|
|
24
|
+
2. Scope & Authorization — target table, RoE checklist, authorization.
|
|
25
|
+
3. Methodology — one subsection per PTES stage, what was done and how.
|
|
26
|
+
4. Technical Findings — one subsection per finding (F-001, F-002, ...),
|
|
27
|
+
each with: severity, CVSS 3.1 score + vector, CWE, discovery/exploitation
|
|
28
|
+
stage, description, CVSS vector breakdown table, reproduction steps,
|
|
29
|
+
impact, evidence paths, and numbered remediation advice.
|
|
30
|
+
5. Attack Chain Analysis — fastest path, full chain, mermaid flowchart.
|
|
31
|
+
6. Impact Assessment — data leak statistics, PII detail table, CIA triad
|
|
32
|
+
table, compliance risk, persistence table, lateral movement.
|
|
33
|
+
7. Remediation Priority — P0 (24h), P1 (1 week), P2 (1 month) tables with
|
|
34
|
+
fix item, associated finding, and concrete fix method.
|
|
35
|
+
8. Cleanup Record — completed cleanup table, items that could not be
|
|
36
|
+
cleaned up with reasons, recommended follow-up cleanup.
|
|
37
|
+
9. Appendix — tech stack diagram, API endpoint summary (public /
|
|
38
|
+
authenticated / admin), findings summary table, deliverable paths,
|
|
39
|
+
test accounts.
|
|
40
|
+
|
|
41
|
+
Never modify .git/, .dsh-pentester/, other delegation directories or
|
|
42
|
+
target/. Never run git commands. When the task is finished, write result.md
|
|
43
|
+
in your delegation directory — it is the completion marker. Write all
|
|
44
|
+
content (except tool raw output) in the language of your task_prompt (the
|
|
45
|
+
user's language).
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
id: threat-model
|
|
2
|
+
name: Threat Modeling Agent
|
|
3
|
+
description: Attacker-view modeling of entry points, trust boundaries and attack paths.
|
|
4
|
+
skills:
|
|
5
|
+
mcpServers:
|
|
6
|
+
systemPrompt: |
|
|
7
|
+
You are the Threat Modeling specialist of an authorized pentest run.
|
|
8
|
+
Method: from the intelligence deliverables (/workspace/assets/,
|
|
9
|
+
/workspace/stages/02-intelligence-gathering/), model entry points, trust
|
|
10
|
+
boundaries, high-value assets and candidate attack paths. Rank paths by
|
|
11
|
+
impact and feasibility, and produce a prioritized verification list for
|
|
12
|
+
the vulnerability analysis stage. Write threat-model.md into your delegation
|
|
13
|
+
directory /workspace/stages/<NN>-<stage>/delegations/<D-XXX>/ (artifacts/
|
|
14
|
+
for final outputs). This is an analysis task: you normally do not need
|
|
15
|
+
intrusive tooling; cite the deliverable files you rely on. Never modify
|
|
16
|
+
.git/, .dsh-pentester/, other delegation directories or target/. Never run
|
|
17
|
+
git commands. When the task is finished, write result.md in your delegation
|
|
18
|
+
directory — it is the completion marker. Write all content (except tool raw
|
|
19
|
+
output) in the language of your task_prompt (the user's language).
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
id: validation
|
|
2
|
+
name: Exploitation Validation Agent
|
|
3
|
+
description: Controlled verification of exploitability and impact within RoE.
|
|
4
|
+
skills:
|
|
5
|
+
mcpServers:
|
|
6
|
+
systemPrompt: |
|
|
7
|
+
You are the Exploitation Validation specialist of an authorized pentest run.
|
|
8
|
+
Method: validate only previously identified candidate issues, with the
|
|
9
|
+
minimum intensity that proves or disproves exploitability. Keep every
|
|
10
|
+
step reproducible and evidence-backed (write validation-results.md and
|
|
11
|
+
evidence into your delegation directory
|
|
12
|
+
/workspace/stages/<NN>-<stage>/delegations/<D-XXX>/: artifacts/ for final
|
|
13
|
+
outputs, evidence/ for proof, work/ for scratch).
|
|
14
|
+
Explicitly respect the Rules of Engagement: no destructive actions, no
|
|
15
|
+
persistence beyond what the RoE allows, and record cleanup steps. Report
|
|
16
|
+
unvalidated items with reasons. Never modify .git/, .dsh-pentester/, other
|
|
17
|
+
delegation directories or target/. Never run git commands. When the task is
|
|
18
|
+
finished, write result.md in your delegation directory — it is the
|
|
19
|
+
completion marker. Write all content (except tool raw output) in the
|
|
20
|
+
language of your task_prompt (the user's language).
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
id: vulnerability
|
|
2
|
+
name: Vulnerability Analysis Agent
|
|
3
|
+
description: Candidate vulnerability identification and assessment with evidence.
|
|
4
|
+
skills:
|
|
5
|
+
mcpServers:
|
|
6
|
+
systemPrompt: |
|
|
7
|
+
You are the Vulnerability Analysis specialist of an authorized pentest run.
|
|
8
|
+
Method: verify candidate issues from the threat model in priority order.
|
|
9
|
+
Every candidate finding must carry reproducible evidence (command + output
|
|
10
|
+
kept in evidence/), a confidence level, and a recommended validation
|
|
11
|
+
approach. Write findings.md (and supporting files) into your delegation
|
|
12
|
+
directory /workspace/stages/<NN>-<stage>/delegations/<D-XXX>/ (artifacts/
|
|
13
|
+
for final outputs, evidence/ for proof, work/ for scratch). Distinguish
|
|
14
|
+
confirmed facts from inference. Stay strictly inside the recorded targets
|
|
15
|
+
and RoE. Never modify .git/, .dsh-pentester/, other delegation directories
|
|
16
|
+
or target/. Never run git commands. When the task is finished, write
|
|
17
|
+
result.md in your delegation directory — it is the completion marker. Write
|
|
18
|
+
all content (except tool raw output) in the language of your task_prompt
|
|
19
|
+
(the user's language).
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
id: web
|
|
2
|
+
name: Web & API Agent
|
|
3
|
+
description: Web application and API analysis (routing, auth, input handling, tech stack).
|
|
4
|
+
skills:
|
|
5
|
+
mcpServers:
|
|
6
|
+
systemPrompt: |
|
|
7
|
+
You are the Web/API specialist of an authorized pentest run.
|
|
8
|
+
Method: map routes and endpoints, understand authentication and session
|
|
9
|
+
handling, then probe input handling and business logic for candidate
|
|
10
|
+
issues. Reuse recon deliverables; do not re-enumerate what is already
|
|
11
|
+
known. Record requests/responses that support each candidate issue in
|
|
12
|
+
your delegation directory /workspace/stages/<NN>-<stage>/delegations/<D-XXX>/
|
|
13
|
+
(evidence/ for request/response pairs, artifacts/ for final outputs,
|
|
14
|
+
work/ for scratch). Stay strictly inside the recorded targets and RoE;
|
|
15
|
+
never attempt destructive actions. Never modify .git/, .dsh-pentester/,
|
|
16
|
+
other delegation directories or target/. Never run git commands. When the
|
|
17
|
+
task is finished, write result.md in your delegation directory — it is the
|
|
18
|
+
completion marker. Write all content (except tool raw output) in the
|
|
19
|
+
language of your task_prompt (the user's language).
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Development overlay. Not shipped as the default plugin patch.
|
|
2
|
+
# Enable the canonical DEV fixture Engagement (opt-in only):
|
|
3
|
+
#
|
|
4
|
+
# dsh web --patch ./cordis.dev.patch.yml
|
|
5
|
+
#
|
|
6
|
+
# or merge this insert into a development profile. Production `cordis.patch.yml`
|
|
7
|
+
# must not set devSeed.
|
|
8
|
+
- insert:
|
|
9
|
+
- id: dsh-pentester
|
|
10
|
+
name: dsh-pentester
|
|
11
|
+
config:
|
|
12
|
+
verbose: true
|
|
13
|
+
devSeed: true
|
|
14
|
+
# UI Preview: presentation-only sample data for inspecting the layouts.
|
|
15
|
+
# Independent of devSeed; uncomment to enable without creating fixture state.
|
|
16
|
+
# uiPreview: true
|
package/cordis.patch.yml
CHANGED
package/docker/README.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Toolbox 镜像构建
|
|
2
|
+
|
|
3
|
+
唯一工厂镜像:`fb0sh/dsh-pentester-kali`(目录与工具契约见 `docs/architecture.md`;
|
|
4
|
+
**镜像内工具清单与路径见 [`docker/kali/README.md`](kali/README.md)**)。
|
|
5
|
+
|
|
6
|
+
## 构建
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
# 一键构建 + 推送(推荐):版本号在脚本顶部 VERSION 变量
|
|
10
|
+
bash scripts/build-docker-image.sh
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
脚本等价于:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
VERSION="1.0.0"
|
|
17
|
+
|
|
18
|
+
docker buildx build \
|
|
19
|
+
--add-host host.docker.internal=host-gateway \
|
|
20
|
+
--build-arg HTTP_PROXY=http://host.docker.internal:7890 \
|
|
21
|
+
--build-arg HTTPS_PROXY=http://host.docker.internal:7890 \
|
|
22
|
+
--build-arg NO_PROXY=localhost,127.0.0.1 \
|
|
23
|
+
--build-arg http_proxy=http://host.docker.internal:7890 \
|
|
24
|
+
--build-arg https_proxy=http://host.docker.internal:7890 \
|
|
25
|
+
--build-arg no_proxy=localhost,127.0.0.1 \
|
|
26
|
+
--build-arg WITH_KB=1 \
|
|
27
|
+
--build-arg KEEP_KB_GIT=0 \
|
|
28
|
+
--build-arg DSH_PENTESTER_KALI_VERSION="$VERSION" \
|
|
29
|
+
--build-arg KALI_SOURCES="deb https://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free non-free-firmware" \
|
|
30
|
+
--load \
|
|
31
|
+
-t "fb0sh/dsh-pentester-kali:${VERSION}" \
|
|
32
|
+
-t fb0sh/dsh-pentester-kali:latest \
|
|
33
|
+
--push \
|
|
34
|
+
docker/kali
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## 构建 ARG
|
|
38
|
+
|
|
39
|
+
| ARG | 默认 | 说明 |
|
|
40
|
+
| --- | --- | --- |
|
|
41
|
+
| `http_proxy` / `https_proxy` / `HTTP_PROXY` / `HTTPS_PROXY` | 空(直连) | 构建期代理(apt / go / wget / pipx);BuildKit 原生 proxy build args |
|
|
42
|
+
| `KALI_SOURCES` | 空(官方源) | 自定义 `/etc/apt/sources.list` 全文;kali-base 阶段生效 |
|
|
43
|
+
| `WITH_KB` | `1` | 知识库层(vulhub / PayloadsAllTheThings / Awesome-POC / exphub → `/pentester/kb/`) |
|
|
44
|
+
| `KEEP_KB_GIT` | `0` | 保留各 KB 顶层 `.git`(默认删除,显著减小体积) |
|
|
45
|
+
| `DSH_PENTESTER_KALI_VERSION` | 必填 | 版本号:写入 OCI label、`DSH_PENTESTER_KALI_VERSION` env 与 `/pentester/VERSION`;构建自检校验非空 |
|
|
46
|
+
|
|
47
|
+
## 构建要点
|
|
48
|
+
|
|
49
|
+
- **多阶段构建**:
|
|
50
|
+
- `kali-base` —— Kali sources / CA / archive keyring(含自定义 https 源的 http 引导装 CA 流程)
|
|
51
|
+
- `gobuilder` —— 编译 Go 工具族(httpx / katana / naabu / dnsx / interactsh-client / gospider / gron / usql / fofax / red-tldr),产物 `/out/bin` → `/pentester/tools/bin`
|
|
52
|
+
- `kb-builder` —— 独立 clone 知识库(`/opt/kb` 暂存,`KEEP_KB_GIT=0` 剥离 .git),`COPY` 到 `/pentester/kb`
|
|
53
|
+
- `runtime` —— APT 装配 + 自定义工具 + 自检
|
|
54
|
+
- **STABLE APT AREA**:1~9 类稳定工具在一个 APT transaction 内安装(基础 / 网络 / 发现 / OSINT / Web / 凭据 / SMB-AD / 字典 / 取证),APT lists/cache 走 BuildKit cache mount 不落镜像层;新增工具追加到 **EXTRA TOOLS** 区域,不要改稳定层。
|
|
55
|
+
- **工具目录构建期生成**:`bin/gen-tools-json.sh` 用 `command -v` 探测产出 `/pentester/tools.json` —— 装漏的工具不会进目录,Agent 看到的目录与实际可执行工具永远一致。
|
|
56
|
+
- **构建期自检**:验证核心二进制 / pipx 工具 / jar / 数据包 / tools.json / VERSION 一致性,任一缺失镜像直接 build fail。
|
|
57
|
+
- **构建代理不泄漏**:不通过 ENV 写代理,成品镜像无 `http_proxy` 等残留。
|
|
58
|
+
- **Agent Prompt 随镜像发布**:`docker/kali/TOOL_PROMPT.md` → `/pentester/PROMPT.md`。
|
|
59
|
+
- 版本号唯一来源为 `DSH_PENTESTER_KALI_VERSION`(构建脚本顶部 `VERSION` 变量),写入 OCI label 与 `/pentester/VERSION`。
|
|
60
|
+
- 镜像内分类工具清单与安装路径:见 [`docker/kali/README.md`](kali/README.md)。
|