opencode-api-security-testing 4.0.0 → 5.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/SKILL.md +74 -1795
- package/agents/api-cyber-supervisor.md +9 -3
- package/agents/api-probing-miner.md +10 -2
- package/agents/api-resource-specialist.md +44 -35
- package/agents/api-vuln-verifier.md +56 -24
- package/package.json +48 -29
- package/postinstall.mjs +149 -0
- package/preuninstall.mjs +87 -0
- package/references/references/README.md +72 -0
- package/references/references/asset-discovery.md +119 -0
- package/references/references/fuzzing-patterns.md +129 -0
- package/references/references/graphql-guidance.md +108 -0
- package/references/references/intake.md +84 -0
- package/references/references/pua-agent.md +192 -0
- package/references/references/report-template.md +156 -0
- package/references/references/rest-guidance.md +76 -0
- package/references/references/severity-model.md +76 -0
- package/references/references/test-matrix.md +86 -0
- package/references/references/validation.md +78 -0
- package/references/references/vulnerabilities/01-sqli-tests.md +1128 -0
- package/references/references/vulnerabilities/02-user-enum-tests.md +423 -0
- package/references/references/vulnerabilities/03-jwt-tests.md +499 -0
- package/references/references/vulnerabilities/04-idor-tests.md +362 -0
- package/references/references/vulnerabilities/05-sensitive-data-tests.md +466 -0
- package/references/references/vulnerabilities/06-biz-logic-tests.md +501 -0
- package/references/references/vulnerabilities/07-security-config-tests.md +511 -0
- package/references/references/vulnerabilities/08-brute-force-tests.md +457 -0
- package/references/references/vulnerabilities/09-vulnerability-chains.md +465 -0
- package/references/references/vulnerabilities/10-auth-tests.md +537 -0
- package/references/references/vulnerabilities/11-graphql-tests.md +355 -0
- package/references/references/vulnerabilities/12-ssrf-tests.md +396 -0
- package/references/references/vulnerabilities/README.md +148 -0
- package/references/references/workflows.md +192 -0
- package/src/index.ts +450 -91
- package/src/src/index.ts +535 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Asset Discovery Guidance
|
|
2
|
+
|
|
3
|
+
将原始 API 材料转换为紧凑的安全相关清单。
|
|
4
|
+
|
|
5
|
+
## 目标
|
|
6
|
+
|
|
7
|
+
识别对安全测试最重要的 API 部分。
|
|
8
|
+
|
|
9
|
+
## 核心表面
|
|
10
|
+
|
|
11
|
+
- base URL(s)
|
|
12
|
+
- versioning scheme
|
|
13
|
+
- routes 或 operations
|
|
14
|
+
- methods
|
|
15
|
+
- content types
|
|
16
|
+
- auth schemes
|
|
17
|
+
|
|
18
|
+
## 信任边界
|
|
19
|
+
|
|
20
|
+
- public vs authenticated endpoints
|
|
21
|
+
- user vs admin operations
|
|
22
|
+
- internal vs external APIs
|
|
23
|
+
- service-to-service 或 callback flows
|
|
24
|
+
- tenant 或 organization 边界
|
|
25
|
+
|
|
26
|
+
## 敏感对象
|
|
27
|
+
|
|
28
|
+
关注以下对象:
|
|
29
|
+
- users
|
|
30
|
+
- roles
|
|
31
|
+
- teams
|
|
32
|
+
- organizations
|
|
33
|
+
- invoices
|
|
34
|
+
- payments
|
|
35
|
+
- orders
|
|
36
|
+
- files
|
|
37
|
+
- secrets
|
|
38
|
+
- API keys
|
|
39
|
+
- tokens
|
|
40
|
+
- audit logs
|
|
41
|
+
- exports
|
|
42
|
+
- configuration objects
|
|
43
|
+
|
|
44
|
+
## 高风险操作模式
|
|
45
|
+
|
|
46
|
+
标记与以下相关的 endpoints 或 mutations:
|
|
47
|
+
- create/update/delete user
|
|
48
|
+
- role assignment
|
|
49
|
+
- permission change
|
|
50
|
+
- password reset
|
|
51
|
+
- token issue 或 refresh
|
|
52
|
+
- export 或 bulk download
|
|
53
|
+
- import 或 bulk update
|
|
54
|
+
- file upload
|
|
55
|
+
- webhook registration
|
|
56
|
+
- callback URL configuration
|
|
57
|
+
- search 或 filter on sensitive entities
|
|
58
|
+
- internal admin dashboards 或 debug endpoints
|
|
59
|
+
|
|
60
|
+
## REST 提示
|
|
61
|
+
|
|
62
|
+
优先包含模式的 endpoints:
|
|
63
|
+
- `/admin`
|
|
64
|
+
- `/internal`
|
|
65
|
+
- `/users`
|
|
66
|
+
- `/roles`
|
|
67
|
+
- `/permissions`
|
|
68
|
+
- `/export`
|
|
69
|
+
- `/import`
|
|
70
|
+
- `/search`
|
|
71
|
+
- `/upload`
|
|
72
|
+
- `/files`
|
|
73
|
+
- `/billing`
|
|
74
|
+
- `/settings`
|
|
75
|
+
- `/token`
|
|
76
|
+
- `/auth`
|
|
77
|
+
- `/debug`
|
|
78
|
+
|
|
79
|
+
同时注意:
|
|
80
|
+
- bulk 操作
|
|
81
|
+
- object IDs in path 或 query
|
|
82
|
+
- 同一资源上隐藏的替代方法
|
|
83
|
+
- 不一致的版本化 endpoints
|
|
84
|
+
|
|
85
|
+
## GraphQL 提示
|
|
86
|
+
|
|
87
|
+
优先:
|
|
88
|
+
- 变更 roles、permissions 或 state 的 mutations
|
|
89
|
+
- 暴露嵌套对象遍历的 fields
|
|
90
|
+
- admin-only resolvers
|
|
91
|
+
- schema introspection 暴露
|
|
92
|
+
- 带敏感链接数据的宽对象图
|
|
93
|
+
- 可能意外扩展访问的 connection 或 pagination 模式
|
|
94
|
+
|
|
95
|
+
## 资产摘要格式
|
|
96
|
+
|
|
97
|
+
优先简洁输出:
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
- Base URLs:
|
|
101
|
+
- API type:
|
|
102
|
+
- Auth schemes:
|
|
103
|
+
- Roles observed or assumed:
|
|
104
|
+
- Sensitive objects:
|
|
105
|
+
- High-risk operations:
|
|
106
|
+
- Trust boundaries:
|
|
107
|
+
- Unknown areas:
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## 优先级规则
|
|
111
|
+
|
|
112
|
+
当表面较大时,优先深度在:
|
|
113
|
+
1. auth 和 role 变更
|
|
114
|
+
2. user 和 tenant 数据
|
|
115
|
+
3. export/import 和 bulk 操作
|
|
116
|
+
4. file 和 callback 流程
|
|
117
|
+
5. 金融或行政操作
|
|
118
|
+
|
|
119
|
+
不要在低风险的只读 metadata endpoints 上浪费空间,除非它们支持更广泛的滥用路径。
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Fuzzing 字典
|
|
2
|
+
|
|
3
|
+
## API前缀字典
|
|
4
|
+
|
|
5
|
+
```python
|
|
6
|
+
common_api_prefixes = [
|
|
7
|
+
# 协议/网关
|
|
8
|
+
"/gateway", "/proxy", "/route", "/ingress",
|
|
9
|
+
"/api-gateway", "/openapi", "/open/api",
|
|
10
|
+
# 版本前缀
|
|
11
|
+
"/v1", "/v2", "/v3", "/v4", "/v5",
|
|
12
|
+
"/api/v1", "/api/v2", "/api/v3",
|
|
13
|
+
"/rest", "/rest/api", "/graphql",
|
|
14
|
+
# 管理后台
|
|
15
|
+
"/admin", "/admin/api", "/manager", "/backend",
|
|
16
|
+
"/backoffice", "/cms",
|
|
17
|
+
# 业务模块
|
|
18
|
+
"/user", "/users", "/member", "/members",
|
|
19
|
+
"/order", "/orders", "/trade", "/transaction",
|
|
20
|
+
"/product", "/goods", "/shop", "/store",
|
|
21
|
+
"/payment", "/pay", "/finance", "/account",
|
|
22
|
+
"/file", "/upload", "/oss", "/storage",
|
|
23
|
+
"/message", "/notify", "/sms", "/email",
|
|
24
|
+
"/admin", "/authority", "/system", "/config",
|
|
25
|
+
# 微服务
|
|
26
|
+
"/service", "/services", "/rpc", "/grpc",
|
|
27
|
+
"/auth", "/oauth", "/sso", "/cas",
|
|
28
|
+
# 移动端
|
|
29
|
+
"/mobile", "/app", "/ios", "/android",
|
|
30
|
+
"/miniapp", "/wechat", "/applet",
|
|
31
|
+
]
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## API端点字典
|
|
35
|
+
|
|
36
|
+
```python
|
|
37
|
+
common_api_endpoints = [
|
|
38
|
+
# 通用CRUD
|
|
39
|
+
"login", "logout", "register", "list", "add", "delete", "modify",
|
|
40
|
+
"getList", "getListOfPage", "detail", "getInfo", "profile",
|
|
41
|
+
# 用户相关
|
|
42
|
+
"user", "user/list", "user/add", "user/delete", "user/modify",
|
|
43
|
+
"user/profile", "user/restPassword", "user/enable", "user/disable",
|
|
44
|
+
# 角色权限
|
|
45
|
+
"role", "role/list", "role/add", "role/delete", "role/modify",
|
|
46
|
+
"menu", "menu/list", "menu/add", "menu/delete", "menu/modify",
|
|
47
|
+
# 文件操作
|
|
48
|
+
"file", "upload", "download", "import", "export",
|
|
49
|
+
"imgUpload", "avatar", "attachment",
|
|
50
|
+
]
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Fuzzing测试流程
|
|
54
|
+
|
|
55
|
+
```python
|
|
56
|
+
for prefix in common_api_prefixes:
|
|
57
|
+
for endpoint in common_api_endpoints:
|
|
58
|
+
url = target + prefix + "/" + endpoint
|
|
59
|
+
response = requests.get(url)
|
|
60
|
+
# 记录返回200的接口
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## API根路径探测
|
|
64
|
+
|
|
65
|
+
```python
|
|
66
|
+
root_paths = [
|
|
67
|
+
"/", "/login", "/auth", "/oauth", "/sso", "/cas",
|
|
68
|
+
"/health", "/healthz", "/ready", "/status", "/info",
|
|
69
|
+
"/metrics", "/ping", "/actuator",
|
|
70
|
+
]
|
|
71
|
+
|
|
72
|
+
for path in root_paths:
|
|
73
|
+
url = api_base + path
|
|
74
|
+
response = requests.get(url)
|
|
75
|
+
if "json" in response.headers.get("Content-Type", ""):
|
|
76
|
+
# 发现可访问的接口
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## 业务端点模板扩展
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
发现的模式: /{module}/{operation}
|
|
83
|
+
可能存在的端点:
|
|
84
|
+
- /{module}/list → 列表查询
|
|
85
|
+
- /{module}/add → 新增创建
|
|
86
|
+
- /{module}/modify → 修改更新
|
|
87
|
+
- /{module}/delete → 删除操作
|
|
88
|
+
- /{module}/detail → 详情查看
|
|
89
|
+
- /{module}/getInfo → 信息获取
|
|
90
|
+
- /{module}/export → 导出数据
|
|
91
|
+
- /{module}/import → 导入数据
|
|
92
|
+
|
|
93
|
+
RESTful风格:
|
|
94
|
+
- GET /{resource}/{id} → 获取详情
|
|
95
|
+
- PUT /{resource}/{id} → 完整更新
|
|
96
|
+
- DELETE /{resource}/{id} → 删除资源
|
|
97
|
+
- PATCH /{resource}/{id} → 部分更新
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## 非通用base_path字典
|
|
101
|
+
|
|
102
|
+
```python
|
|
103
|
+
extended_base_paths = [
|
|
104
|
+
# 协议/网关
|
|
105
|
+
"/gateway", "/proxy", "/route", "/ingress",
|
|
106
|
+
"/api-gateway", "/openapi", "/open/api",
|
|
107
|
+
# 版本前缀
|
|
108
|
+
"/v1", "/v2", "/v3", "/v4", "/v5",
|
|
109
|
+
"/api/v1", "/api/v2", "/api/v3",
|
|
110
|
+
"/rest", "/rest/api", "/graphql",
|
|
111
|
+
# 管理后台
|
|
112
|
+
"/admin", "/manager", "/manage", "/console",
|
|
113
|
+
"/backend", "/backoffice", "/cms",
|
|
114
|
+
# 业务模块
|
|
115
|
+
"/user", "/users", "/member", "/members",
|
|
116
|
+
"/order", "/orders", "/trade", "/transaction",
|
|
117
|
+
"/product", "/goods", "/shop", "/store",
|
|
118
|
+
"/payment", "/pay", "/finance", "/account",
|
|
119
|
+
"/file", "/upload", "/oss", "/storage",
|
|
120
|
+
"/message", "/notify", "/sms", "/email",
|
|
121
|
+
"/admin", "/authority", "/system", "/config",
|
|
122
|
+
# 微服务
|
|
123
|
+
"/service", "/services", "/rpc", "/grpc",
|
|
124
|
+
"/auth", "/oauth", "/sso", "/cas",
|
|
125
|
+
# 移动端
|
|
126
|
+
"/mobile", "/app", "/ios", "/android",
|
|
127
|
+
"/miniapp", "/wechat", "/applet",
|
|
128
|
+
]
|
|
129
|
+
```
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# GraphQL Guidance
|
|
2
|
+
|
|
3
|
+
分析 GraphQL API 时使用。
|
|
4
|
+
|
|
5
|
+
## 关注领域
|
|
6
|
+
|
|
7
|
+
### 字段级授权
|
|
8
|
+
|
|
9
|
+
- resolver 是否正确检查权限
|
|
10
|
+
- 嵌套查询是否泄露数据
|
|
11
|
+
- 是否缺少 admin-only 字段
|
|
12
|
+
|
|
13
|
+
### 嵌套遍历
|
|
14
|
+
|
|
15
|
+
- `type User { friends: [User!]! }` 可导致递归查询
|
|
16
|
+
- `type Post { author: User }` 允许遍历
|
|
17
|
+
- 是否限制遍历深度
|
|
18
|
+
|
|
19
|
+
### Resolver 边界
|
|
20
|
+
|
|
21
|
+
- 一个 resolver 是否调用另一个 service
|
|
22
|
+
- 是否存在 SSRF 风险
|
|
23
|
+
- 是否有命令注入点
|
|
24
|
+
|
|
25
|
+
### Mutation 滥用
|
|
26
|
+
|
|
27
|
+
- 未经授权的状态变更
|
|
28
|
+
- 条件 mutation(如 admin-only mutation)
|
|
29
|
+
- 批量 mutation 导致的问题
|
|
30
|
+
|
|
31
|
+
### Introspection 暴露
|
|
32
|
+
|
|
33
|
+
- 是否禁用 introspection
|
|
34
|
+
- 是否暴露敏感字段
|
|
35
|
+
- Schema 文档是否包含敏感信息
|
|
36
|
+
|
|
37
|
+
## 常见风险信号
|
|
38
|
+
|
|
39
|
+
- ` IntrospectionQuery` 可访问
|
|
40
|
+
- 缺少 query 复杂度限制
|
|
41
|
+
- 缺少 query 深度限制
|
|
42
|
+
- 缺少字段权限检查
|
|
43
|
+
- mutation 接受任意输入
|
|
44
|
+
- 嵌套查询无限制
|
|
45
|
+
|
|
46
|
+
## 测试重点
|
|
47
|
+
|
|
48
|
+
### 1. 枚举攻击
|
|
49
|
+
|
|
50
|
+
```graphql
|
|
51
|
+
# 枚举所有用户
|
|
52
|
+
query {
|
|
53
|
+
users {
|
|
54
|
+
id
|
|
55
|
+
username
|
|
56
|
+
email
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### 2. 嵌套遍历
|
|
62
|
+
|
|
63
|
+
```graphql
|
|
64
|
+
# 递归遍历 friendships
|
|
65
|
+
query {
|
|
66
|
+
user(id: 1) {
|
|
67
|
+
friends {
|
|
68
|
+
friends {
|
|
69
|
+
friends {
|
|
70
|
+
id
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### 3. 权限绕过
|
|
79
|
+
|
|
80
|
+
```graphql
|
|
81
|
+
# 尝试 admin 字段
|
|
82
|
+
query {
|
|
83
|
+
user(id: 1) {
|
|
84
|
+
isAdmin
|
|
85
|
+
role
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### 4. mutation 滥用
|
|
91
|
+
|
|
92
|
+
```graphql
|
|
93
|
+
# 未经授权的 mutation
|
|
94
|
+
mutation {
|
|
95
|
+
updateUser(id: 1, role: "admin") {
|
|
96
|
+
id
|
|
97
|
+
role
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## 防护检查
|
|
103
|
+
|
|
104
|
+
- [ ] 是否限制查询复杂度
|
|
105
|
+
- [ ] 是否限制查询深度
|
|
106
|
+
- [ ] 是否禁用 introspection
|
|
107
|
+
- [ ] resolver 是否有权限检查
|
|
108
|
+
- [ ] 是否过滤敏感字段
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Intake Checklist
|
|
2
|
+
|
|
3
|
+
确认输入和评估模式。
|
|
4
|
+
|
|
5
|
+
## 确认提供的内容
|
|
6
|
+
|
|
7
|
+
### 必须确认
|
|
8
|
+
|
|
9
|
+
- [ ] 目标 URL 或 base URL
|
|
10
|
+
- [ ] API 类型 (REST/GraphQL/混合)
|
|
11
|
+
- [ ] 认证方式 (Bearer Token/JWT/Session/API Key/OAuth)
|
|
12
|
+
- [ ] 测试账户 (如有)
|
|
13
|
+
- [ ] 授权范围
|
|
14
|
+
|
|
15
|
+
### 需要明确的
|
|
16
|
+
|
|
17
|
+
- [ ] 是否允许主动测试
|
|
18
|
+
- [ ] 是否有速率限制
|
|
19
|
+
- [ ] 测试环境还是生产环境
|
|
20
|
+
- [ ] 是否有 IP 白名单
|
|
21
|
+
|
|
22
|
+
## 评估模式
|
|
23
|
+
|
|
24
|
+
### 1. 文档驱动审查 (Document-Driven Review)
|
|
25
|
+
|
|
26
|
+
**条件**: 只有规范、schema、collection 可用
|
|
27
|
+
|
|
28
|
+
**方法**:
|
|
29
|
+
- 分析 OpenAPI/Swagger
|
|
30
|
+
- 分析 Postman collection
|
|
31
|
+
- 分析 API 文档
|
|
32
|
+
- 分析 GraphQL schema
|
|
33
|
+
|
|
34
|
+
**限制**:
|
|
35
|
+
- 无法验证运行时行为
|
|
36
|
+
- 无法确认绕过
|
|
37
|
+
- 标记为 hypothesis
|
|
38
|
+
|
|
39
|
+
### 2. 被动目标审查 (Passive Target Review)
|
|
40
|
+
|
|
41
|
+
**条件**: 存在活动目标,但凭证或主动测试受限
|
|
42
|
+
|
|
43
|
+
**方法**:
|
|
44
|
+
- 观察公开端点行为
|
|
45
|
+
- 分析响应结构
|
|
46
|
+
- 识别认证边界
|
|
47
|
+
- 检查信息泄露
|
|
48
|
+
|
|
49
|
+
**限制**:
|
|
50
|
+
- 无法测试所有边界
|
|
51
|
+
- 无法验证授权问题
|
|
52
|
+
|
|
53
|
+
### 3. 授权主动评估 (Authorized Active Assessment)
|
|
54
|
+
|
|
55
|
+
**条件**: 用户提供足够授权和上下文
|
|
56
|
+
|
|
57
|
+
**方法**:
|
|
58
|
+
- 测试认证机制
|
|
59
|
+
- 验证授权边界
|
|
60
|
+
- 测试输入处理
|
|
61
|
+
- 验证业务逻辑
|
|
62
|
+
|
|
63
|
+
**要求**:
|
|
64
|
+
- 明确的书面授权
|
|
65
|
+
- 测试账户
|
|
66
|
+
- 速率限制说明
|
|
67
|
+
|
|
68
|
+
## 假设声明
|
|
69
|
+
|
|
70
|
+
如有任何不明确,声明假设:
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
Assumptions:
|
|
74
|
+
- [假设 1]
|
|
75
|
+
- [假设 2]
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## 范围限制
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
Scope Limitations:
|
|
82
|
+
- [限制 1]
|
|
83
|
+
- [限制 2]
|
|
84
|
+
```
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# API Security Testing PUA Agent
|
|
2
|
+
|
|
3
|
+
## 角色定义
|
|
4
|
+
|
|
5
|
+
你是一个API安全测试专家,代号"渗透测试员P9"。
|
|
6
|
+
|
|
7
|
+
你的职责是:
|
|
8
|
+
1. **不放弃** - 任何线索都要追到底
|
|
9
|
+
2. **自动化** - 不等待用户指令
|
|
10
|
+
3. **压力升级** - 遇到失败自动换方法
|
|
11
|
+
4. **进度追踪** - 每一项都要完成
|
|
12
|
+
|
|
13
|
+
## 自动触发条件
|
|
14
|
+
|
|
15
|
+
### 压力升级触发
|
|
16
|
+
|
|
17
|
+
| 失败次数 | 级别 | 行动 |
|
|
18
|
+
|---------|------|------|
|
|
19
|
+
| 1次 | L1 | 换一种方法继续 |
|
|
20
|
+
| 2次 | L2 | 强制搜索更多信息 |
|
|
21
|
+
| 3次 | L3 | 7点检查清单 |
|
|
22
|
+
| 4次 | L4 | 报告并尝试其他方向 |
|
|
23
|
+
|
|
24
|
+
### 必须自动执行的情况
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
□ 发现配置文件 → 自动分析所有URL
|
|
28
|
+
□ 发现API路径 → 自动批量测试
|
|
29
|
+
□ 发现CORS漏洞 → 自动检查所有端点
|
|
30
|
+
□ 发现登录接口 → 自动测试绕过
|
|
31
|
+
□ 测试完成一项 → 自动检查遗漏
|
|
32
|
+
□ 发现新线索 → 自动开启测试
|
|
33
|
+
□ 用户说"继续" → 不等待,直接执行
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## 进度追踪表
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
【当前进度】
|
|
40
|
+
|
|
41
|
+
阶段1: 基础探测 [██████████] 100%
|
|
42
|
+
├─ □ HTTP探测
|
|
43
|
+
├─ □ 技术栈识别
|
|
44
|
+
├─ □ SPA判断
|
|
45
|
+
└─ □ 配置文件发现
|
|
46
|
+
|
|
47
|
+
阶段2: JS采集 [████████░░] 80%
|
|
48
|
+
├─ □ Playwright采集
|
|
49
|
+
├─ □ JS分析
|
|
50
|
+
└─ □ API路径提取
|
|
51
|
+
|
|
52
|
+
阶段3: API测试 [████░░░░░░░] 40%
|
|
53
|
+
├─ □ curl批量探测
|
|
54
|
+
├─ □ CORS测试 ← 当前
|
|
55
|
+
├─ □ SQL注入测试
|
|
56
|
+
└─ □ 其他漏洞
|
|
57
|
+
|
|
58
|
+
阶段4: 漏洞验证 [░░░░░░░░░░░] 0%
|
|
59
|
+
├─ □ 漏洞确认
|
|
60
|
+
├─ □ 误报排除
|
|
61
|
+
└─ □ 报告输出
|
|
62
|
+
|
|
63
|
+
【发现清单】
|
|
64
|
+
├─ CORS漏洞: 3个端点
|
|
65
|
+
├─ SQL注入: 待测试
|
|
66
|
+
├─ 新线索:
|
|
67
|
+
│ └─ /ipark-wxlite/* (404)
|
|
68
|
+
└─ API端点: 18个
|
|
69
|
+
|
|
70
|
+
【下一步行动】
|
|
71
|
+
→ 自动执行: curl批量探测剩余端点
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## 不放弃原则
|
|
75
|
+
|
|
76
|
+
### 遇到以下情况必须继续
|
|
77
|
+
|
|
78
|
+
| 情况 | 正确做法 |
|
|
79
|
+
|------|----------|
|
|
80
|
+
| 端点404 | 尝试POST方法 |
|
|
81
|
+
| 需要认证 | 尝试绕过方法 |
|
|
82
|
+
| 被WAF拦截 | 换payload测试 |
|
|
83
|
+
| 返回HTML | 这是路由,继续API测试 |
|
|
84
|
+
| 找不到JS | 分析配置文件 |
|
|
85
|
+
| 配置文件为空 | 搜索其他配置 |
|
|
86
|
+
| 单个端点失败 | 测试同类端点 |
|
|
87
|
+
| 说"无法测试" | 必须说明尝试了哪些 |
|
|
88
|
+
|
|
89
|
+
### 必须穷举的方法
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
【CORS测试】
|
|
93
|
+
1. curl测试GET
|
|
94
|
+
2. curl测试POST
|
|
95
|
+
3. 检查所有端点
|
|
96
|
+
4. 对比响应差异
|
|
97
|
+
|
|
98
|
+
【SQL注入测试】
|
|
99
|
+
1. ' OR '1'='1
|
|
100
|
+
2. ' OR 1=1--
|
|
101
|
+
3. ' AND SLEEP(3)--
|
|
102
|
+
4. ' UNION SELECT--
|
|
103
|
+
5. ' AND (SELECT...
|
|
104
|
+
|
|
105
|
+
【暴力破解】
|
|
106
|
+
1. 多线程并发
|
|
107
|
+
2. 延时处理
|
|
108
|
+
3. 验证码识别
|
|
109
|
+
4. 换IP测试
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## 自动执行模板
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
用户输入: 测试 http://target.com
|
|
116
|
+
|
|
117
|
+
【PUA Agent自动执行】
|
|
118
|
+
|
|
119
|
+
→ 阶段1: 基础探测 [自动执行]
|
|
120
|
+
→ GET http://target.com
|
|
121
|
+
→ 发现Vue SPA
|
|
122
|
+
→ 发现 /_app.config.js
|
|
123
|
+
→ 【发现配置文件】→ 自动下载分析
|
|
124
|
+
|
|
125
|
+
→ 阶段2: JS采集 [自动执行]
|
|
126
|
+
→ Playwright访问
|
|
127
|
+
→ 拦截所有请求
|
|
128
|
+
→ 【发现API路径】→ 批量curl探测
|
|
129
|
+
|
|
130
|
+
→ 阶段3: API测试 [自动执行]
|
|
131
|
+
→ 【发现CORS】→ 自动检查所有端点
|
|
132
|
+
→ 【发现登录接口】→ 自动测试绕过
|
|
133
|
+
→ 【发现新线索】→ 自动深入
|
|
134
|
+
|
|
135
|
+
→ 阶段4: 漏洞验证 [自动执行]
|
|
136
|
+
→ 【检查清单完成判定】
|
|
137
|
+
→ 【输出报告】
|
|
138
|
+
|
|
139
|
+
【每一项都不等待用户指令】
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## 压力升级检查清单
|
|
143
|
+
|
|
144
|
+
当失败3次后,必须执行:
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
【7点检查清单】
|
|
148
|
+
|
|
149
|
+
1. 我测试了所有端点吗?
|
|
150
|
+
→ 没有 → 继续测试
|
|
151
|
+
|
|
152
|
+
2. 我尝试了所有HTTP方法吗?
|
|
153
|
+
→ 没有 → GET/POST/PUT/DELETE/OPTIONS
|
|
154
|
+
|
|
155
|
+
3. 我尝试了不同的payload吗?
|
|
156
|
+
→ 没有 → 换payload继续
|
|
157
|
+
|
|
158
|
+
4. 我检查了所有响应头吗?
|
|
159
|
+
→ 没有 → curl -I 完整检查
|
|
160
|
+
|
|
161
|
+
5. 我分析了所有JS文件吗?
|
|
162
|
+
→ 没有 → 递归下载分析
|
|
163
|
+
|
|
164
|
+
6. 我测试了绕过方法吗?
|
|
165
|
+
→ 没有 → 换WAF绕过方式
|
|
166
|
+
|
|
167
|
+
7. 我记录了所有发现吗?
|
|
168
|
+
→ 没有 → 记录后继续
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## 输出格式
|
|
172
|
+
|
|
173
|
+
```
|
|
174
|
+
【发现】
|
|
175
|
+
- 漏洞: CORS配置错误
|
|
176
|
+
- 端点: 18个
|
|
177
|
+
- 风险: 中危
|
|
178
|
+
|
|
179
|
+
【证据】
|
|
180
|
+
curl -I -H "Origin: https://evil.com" http://target.com/api/user/info
|
|
181
|
+
ACAO: https://evil.com
|
|
182
|
+
ACAC: true
|
|
183
|
+
|
|
184
|
+
【下一步行动】
|
|
185
|
+
→ 自动执行: 检查其他18个端点的CORS
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## 使用方式
|
|
189
|
+
|
|
190
|
+
在API Testing Skill中,所有测试都是**自动执行**,不需要用户说"继续"。
|
|
191
|
+
|
|
192
|
+
**触发词**: 发现任何线索都自动深入
|