ccbot-cli 2.0.0 → 2.1.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/LICENSE +21 -0
- package/bin/adapters/claude.js +150 -0
- package/bin/adapters/codex.js +439 -0
- package/bin/install.js +509 -349
- package/bin/lib/ccline.js +82 -0
- package/bin/lib/utils.js +87 -34
- package/bin/uninstall.js +48 -0
- package/config/AGENTS.md +630 -0
- package/config/CLAUDE.md +229 -20
- package/config/ccline/config.toml +161 -0
- package/config/codex-config.example.toml +22 -0
- package/config/settings.example.json +32 -0
- package/output-styles/abyss-cultivator.md +399 -0
- package/package.json +14 -5
- package/skills/SKILL.md +159 -0
- package/skills/domains/ai/SKILL.md +34 -0
- package/skills/domains/ai/agent-dev.md +242 -0
- package/skills/domains/ai/llm-security.md +288 -0
- package/skills/domains/ai/prompt-and-eval.md +279 -0
- package/skills/domains/ai/rag-system.md +542 -0
- package/skills/domains/architecture/SKILL.md +42 -0
- package/skills/domains/architecture/api-design.md +225 -0
- package/skills/domains/architecture/caching.md +299 -0
- package/skills/domains/architecture/cloud-native.md +285 -0
- package/skills/domains/architecture/message-queue.md +329 -0
- package/skills/domains/architecture/security-arch.md +297 -0
- package/skills/domains/data-engineering/SKILL.md +207 -0
- package/skills/domains/development/SKILL.md +46 -0
- package/skills/domains/development/cpp.md +246 -0
- package/skills/domains/development/go.md +323 -0
- package/skills/domains/development/java.md +277 -0
- package/skills/domains/development/python.md +288 -0
- package/skills/domains/development/rust.md +313 -0
- package/skills/domains/development/shell.md +313 -0
- package/skills/domains/development/typescript.md +277 -0
- package/skills/domains/devops/SKILL.md +39 -0
- package/skills/domains/devops/cost-optimization.md +272 -0
- package/skills/domains/devops/database.md +217 -0
- package/skills/domains/devops/devsecops.md +198 -0
- package/skills/domains/devops/git-workflow.md +181 -0
- package/skills/domains/devops/observability.md +280 -0
- package/skills/domains/devops/performance.md +336 -0
- package/skills/domains/devops/testing.md +283 -0
- package/skills/domains/frontend-design/SKILL.md +38 -0
- package/skills/domains/frontend-design/claymorphism/SKILL.md +119 -0
- package/skills/domains/frontend-design/claymorphism/references/tokens.css +52 -0
- package/skills/domains/frontend-design/component-patterns.md +202 -0
- package/skills/domains/frontend-design/engineering.md +287 -0
- package/skills/domains/frontend-design/glassmorphism/SKILL.md +140 -0
- package/skills/domains/frontend-design/glassmorphism/references/tokens.css +32 -0
- package/skills/domains/frontend-design/liquid-glass/SKILL.md +137 -0
- package/skills/domains/frontend-design/liquid-glass/references/tokens.css +81 -0
- package/skills/domains/frontend-design/neubrutalism/SKILL.md +143 -0
- package/skills/domains/frontend-design/neubrutalism/references/tokens.css +44 -0
- package/skills/domains/frontend-design/state-management.md +680 -0
- package/skills/domains/frontend-design/ui-aesthetics.md +110 -0
- package/skills/domains/frontend-design/ux-principles.md +156 -0
- package/skills/domains/infrastructure/SKILL.md +200 -0
- package/skills/domains/mobile/SKILL.md +224 -0
- package/skills/domains/orchestration/SKILL.md +29 -0
- package/skills/domains/orchestration/multi-agent.md +263 -0
- package/skills/domains/security/SKILL.md +54 -0
- package/skills/domains/security/blue-team.md +436 -0
- package/skills/domains/security/code-audit.md +265 -0
- package/skills/domains/security/pentest.md +226 -0
- package/skills/domains/security/red-team.md +375 -0
- package/skills/domains/security/threat-intel.md +372 -0
- package/skills/domains/security/vuln-research.md +369 -0
- package/skills/orchestration/multi-agent/SKILL.md +493 -0
- package/skills/run_skill.js +129 -0
- package/skills/tools/gen-docs/SKILL.md +116 -0
- package/skills/tools/gen-docs/scripts/doc_generator.js +435 -0
- package/skills/tools/lib/shared.js +98 -0
- package/skills/tools/verify-change/SKILL.md +140 -0
- package/skills/tools/verify-change/scripts/change_analyzer.js +289 -0
- package/skills/tools/verify-module/SKILL.md +127 -0
- package/skills/tools/verify-module/scripts/module_scanner.js +171 -0
- package/skills/tools/verify-quality/SKILL.md +160 -0
- package/skills/tools/verify-quality/scripts/quality_checker.js +337 -0
- package/skills/tools/verify-security/SKILL.md +143 -0
- package/skills/tools/verify-security/scripts/security_scanner.js +283 -0
- package/bin/lib/registry.js +0 -61
- package/config/.claudeignore +0 -11
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: threat-intel
|
|
3
|
+
description: 威胁情报。OSINT、威胁狩猎、情报分析、IOC管理。当用户提到威胁情报、OSINT、开源情报、威胁狩猎、IOC、TTP、ATT&CK时使用。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 👁 天眼秘典 · 威胁情报 (Threat Intelligence)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## 情报层次
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
13
|
+
│ 威胁情报金字塔 │
|
|
14
|
+
├─────────────────────────────────────────────────────────────┤
|
|
15
|
+
│ 战略情报 │
|
|
16
|
+
│ (决策层/长期趋势) │
|
|
17
|
+
│ ───────────── │
|
|
18
|
+
│ 战术情报 │
|
|
19
|
+
│ (TTP/攻击手法) │
|
|
20
|
+
│ ───────────── │
|
|
21
|
+
│ 运营情报 │
|
|
22
|
+
│ (攻击活动/APT) │
|
|
23
|
+
│ ───────────── │
|
|
24
|
+
│ 技术情报 │
|
|
25
|
+
│ (IOC/IP/域名/Hash) │
|
|
26
|
+
└─────────────────────────────────────────────────────────────┘
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## OSINT 信息收集
|
|
30
|
+
|
|
31
|
+
### 域名/IP 情报
|
|
32
|
+
```bash
|
|
33
|
+
# DNS 查询
|
|
34
|
+
dig +short example.com
|
|
35
|
+
dig +short -x 1.2.3.4
|
|
36
|
+
host example.com
|
|
37
|
+
|
|
38
|
+
# WHOIS
|
|
39
|
+
whois example.com
|
|
40
|
+
whois 1.2.3.4
|
|
41
|
+
|
|
42
|
+
# 子域名枚举
|
|
43
|
+
subfinder -d example.com
|
|
44
|
+
amass enum -d example.com
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### 在线情报平台
|
|
48
|
+
```yaml
|
|
49
|
+
IP/域名信誉:
|
|
50
|
+
- VirusTotal: https://www.virustotal.com
|
|
51
|
+
- AbuseIPDB: https://www.abuseipdb.com
|
|
52
|
+
- Shodan: https://www.shodan.io
|
|
53
|
+
- Censys: https://search.censys.io
|
|
54
|
+
- GreyNoise: https://www.greynoise.io
|
|
55
|
+
|
|
56
|
+
恶意软件分析:
|
|
57
|
+
- Any.Run: https://any.run
|
|
58
|
+
- Hybrid Analysis: https://www.hybrid-analysis.com
|
|
59
|
+
- Joe Sandbox: https://www.joesandbox.com
|
|
60
|
+
- MalwareBazaar: https://bazaar.abuse.ch
|
|
61
|
+
|
|
62
|
+
威胁情报:
|
|
63
|
+
- AlienVault OTX: https://otx.alienvault.com
|
|
64
|
+
- MISP: https://www.misp-project.org
|
|
65
|
+
- ThreatFox: https://threatfox.abuse.ch
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 搜索引擎 Dorking
|
|
69
|
+
```
|
|
70
|
+
# Google Dorks
|
|
71
|
+
site:example.com filetype:pdf
|
|
72
|
+
site:example.com inurl:admin
|
|
73
|
+
site:example.com intitle:"index of"
|
|
74
|
+
"password" filetype:log site:example.com
|
|
75
|
+
|
|
76
|
+
# Shodan
|
|
77
|
+
hostname:example.com
|
|
78
|
+
org:"Target Company"
|
|
79
|
+
ssl.cert.subject.cn:example.com
|
|
80
|
+
http.title:"Dashboard"
|
|
81
|
+
|
|
82
|
+
# Censys
|
|
83
|
+
services.http.response.html_title:"Admin"
|
|
84
|
+
services.tls.certificates.leaf.subject.common_name:example.com
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### 社交媒体情报
|
|
88
|
+
```yaml
|
|
89
|
+
平台:
|
|
90
|
+
- LinkedIn: 员工信息、组织架构
|
|
91
|
+
- GitHub: 代码泄露、API密钥
|
|
92
|
+
- Twitter: 安全事件、漏洞披露
|
|
93
|
+
- Pastebin: 数据泄露
|
|
94
|
+
|
|
95
|
+
GitHub Dorks:
|
|
96
|
+
- "example.com" password
|
|
97
|
+
- "example.com" api_key
|
|
98
|
+
- "example.com" secret
|
|
99
|
+
- org:example filename:.env
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## IOC 管理
|
|
103
|
+
|
|
104
|
+
### IOC 类型
|
|
105
|
+
```yaml
|
|
106
|
+
网络层:
|
|
107
|
+
- IP 地址
|
|
108
|
+
- 域名
|
|
109
|
+
- URL
|
|
110
|
+
- User-Agent
|
|
111
|
+
|
|
112
|
+
主机层:
|
|
113
|
+
- 文件 Hash (MD5/SHA1/SHA256)
|
|
114
|
+
- 文件路径
|
|
115
|
+
- 注册表键
|
|
116
|
+
- 进程名
|
|
117
|
+
|
|
118
|
+
行为层:
|
|
119
|
+
- YARA 规则
|
|
120
|
+
- Sigma 规则
|
|
121
|
+
- Snort 规则
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### IOC 格式 (STIX/TAXII)
|
|
125
|
+
```json
|
|
126
|
+
{
|
|
127
|
+
"type": "indicator",
|
|
128
|
+
"id": "indicator--xxx",
|
|
129
|
+
"created": "2024-01-01T00:00:00.000Z",
|
|
130
|
+
"pattern": "[file:hashes.SHA256 = 'abc123...']",
|
|
131
|
+
"pattern_type": "stix",
|
|
132
|
+
"valid_from": "2024-01-01T00:00:00.000Z",
|
|
133
|
+
"labels": ["malicious-activity"],
|
|
134
|
+
"kill_chain_phases": [{
|
|
135
|
+
"kill_chain_name": "mitre-attack",
|
|
136
|
+
"phase_name": "execution"
|
|
137
|
+
}]
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### IOC 自动化查询
|
|
142
|
+
```python
|
|
143
|
+
#!/usr/bin/env python3
|
|
144
|
+
"""IOC 批量查询"""
|
|
145
|
+
import requests
|
|
146
|
+
|
|
147
|
+
class IOCChecker:
|
|
148
|
+
def __init__(self, vt_api_key):
|
|
149
|
+
self.vt_key = vt_api_key
|
|
150
|
+
|
|
151
|
+
def check_hash(self, file_hash):
|
|
152
|
+
"""VirusTotal Hash 查询"""
|
|
153
|
+
url = f"https://www.virustotal.com/api/v3/files/{file_hash}"
|
|
154
|
+
headers = {"x-apikey": self.vt_key}
|
|
155
|
+
resp = requests.get(url, headers=headers)
|
|
156
|
+
if resp.status_code == 200:
|
|
157
|
+
data = resp.json()
|
|
158
|
+
stats = data['data']['attributes']['last_analysis_stats']
|
|
159
|
+
return {
|
|
160
|
+
'malicious': stats['malicious'],
|
|
161
|
+
'suspicious': stats['suspicious'],
|
|
162
|
+
'harmless': stats['harmless']
|
|
163
|
+
}
|
|
164
|
+
return None
|
|
165
|
+
|
|
166
|
+
def check_ip(self, ip):
|
|
167
|
+
"""AbuseIPDB 查询"""
|
|
168
|
+
url = "https://api.abuseipdb.com/api/v2/check"
|
|
169
|
+
params = {"ipAddress": ip, "maxAgeInDays": 90}
|
|
170
|
+
# 需要 API Key
|
|
171
|
+
pass
|
|
172
|
+
|
|
173
|
+
def check_domain(self, domain):
|
|
174
|
+
"""域名信誉查询"""
|
|
175
|
+
pass
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## ATT&CK 映射
|
|
179
|
+
|
|
180
|
+
### TTP 分析
|
|
181
|
+
```yaml
|
|
182
|
+
# 攻击者画像
|
|
183
|
+
APT_Profile:
|
|
184
|
+
name: "APT-XX"
|
|
185
|
+
aliases: ["Group A", "Group B"]
|
|
186
|
+
targets:
|
|
187
|
+
- 金融行业
|
|
188
|
+
- 政府机构
|
|
189
|
+
techniques:
|
|
190
|
+
initial_access:
|
|
191
|
+
- T1566.001: Spearphishing Attachment
|
|
192
|
+
- T1566.002: Spearphishing Link
|
|
193
|
+
execution:
|
|
194
|
+
- T1059.001: PowerShell
|
|
195
|
+
- T1059.003: Windows Command Shell
|
|
196
|
+
persistence:
|
|
197
|
+
- T1547.001: Registry Run Keys
|
|
198
|
+
- T1053.005: Scheduled Task
|
|
199
|
+
c2:
|
|
200
|
+
- T1071.001: Web Protocols
|
|
201
|
+
- T1573.001: Encrypted Channel
|
|
202
|
+
tools:
|
|
203
|
+
- Cobalt Strike
|
|
204
|
+
- Mimikatz
|
|
205
|
+
- Custom Malware
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### ATT&CK Navigator
|
|
209
|
+
```python
|
|
210
|
+
# 生成 ATT&CK Navigator 层
|
|
211
|
+
def generate_navigator_layer(techniques):
|
|
212
|
+
layer = {
|
|
213
|
+
"name": "Threat Actor Coverage",
|
|
214
|
+
"versions": {"attack": "13", "navigator": "4.8"},
|
|
215
|
+
"domain": "enterprise-attack",
|
|
216
|
+
"techniques": []
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
for tech_id, score in techniques.items():
|
|
220
|
+
layer["techniques"].append({
|
|
221
|
+
"techniqueID": tech_id,
|
|
222
|
+
"score": score,
|
|
223
|
+
"color": "#ff6666" if score > 50 else "#ffcc66"
|
|
224
|
+
})
|
|
225
|
+
|
|
226
|
+
return layer
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
## 威胁狩猎
|
|
230
|
+
|
|
231
|
+
### 狩猎流程
|
|
232
|
+
```
|
|
233
|
+
假设生成 → 数据收集 → 分析调查 → 发现验证 → 知识沉淀
|
|
234
|
+
│ │ │ │ │
|
|
235
|
+
└─ ATT&CK ──┴─ SIEM ────┴─ 查询 ────┴─ IOC ────┴─ 规则
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### 狩猎假设模板
|
|
239
|
+
```yaml
|
|
240
|
+
hypothesis: "攻击者可能通过 PowerShell 下载执行恶意代码"
|
|
241
|
+
technique: T1059.001
|
|
242
|
+
data_sources:
|
|
243
|
+
- Windows PowerShell 日志 (4103, 4104)
|
|
244
|
+
- Sysmon 进程创建 (Event ID 1)
|
|
245
|
+
query: |
|
|
246
|
+
EventID=4104 AND ScriptBlockText CONTAINS
|
|
247
|
+
("IEX" OR "Invoke-Expression" OR "DownloadString" OR "Net.WebClient")
|
|
248
|
+
expected_results:
|
|
249
|
+
- 可疑脚本块
|
|
250
|
+
- 外部 URL 下载
|
|
251
|
+
- 编码命令
|
|
252
|
+
response:
|
|
253
|
+
- 隔离主机
|
|
254
|
+
- 提取样本
|
|
255
|
+
- 扩展狩猎
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### 狩猎查询库
|
|
259
|
+
```sql
|
|
260
|
+
-- 异常 PowerShell 执行
|
|
261
|
+
SELECT timestamp, hostname, user, command_line
|
|
262
|
+
FROM process_events
|
|
263
|
+
WHERE process_name = 'powershell.exe'
|
|
264
|
+
AND (command_line LIKE '%IEX%'
|
|
265
|
+
OR command_line LIKE '%DownloadString%'
|
|
266
|
+
OR command_line LIKE '%-enc%')
|
|
267
|
+
|
|
268
|
+
-- 异常网络连接
|
|
269
|
+
SELECT timestamp, process_name, remote_address, remote_port
|
|
270
|
+
FROM network_events
|
|
271
|
+
WHERE remote_port NOT IN (80, 443, 53, 22)
|
|
272
|
+
AND remote_address NOT LIKE '10.%'
|
|
273
|
+
AND remote_address NOT LIKE '192.168.%'
|
|
274
|
+
|
|
275
|
+
-- 可疑文件创建
|
|
276
|
+
SELECT timestamp, process_name, file_path
|
|
277
|
+
FROM file_events
|
|
278
|
+
WHERE file_path LIKE '%\Temp\%'
|
|
279
|
+
AND file_path LIKE '%.exe'
|
|
280
|
+
AND process_name IN ('powershell.exe', 'cmd.exe', 'wscript.exe')
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
## 情报共享
|
|
284
|
+
|
|
285
|
+
### MISP 集成
|
|
286
|
+
```python
|
|
287
|
+
from pymisp import PyMISP
|
|
288
|
+
|
|
289
|
+
misp = PyMISP(url, key, ssl=False)
|
|
290
|
+
|
|
291
|
+
# 创建事件
|
|
292
|
+
event = misp.new_event(
|
|
293
|
+
distribution=0,
|
|
294
|
+
info="Phishing Campaign 2024-01",
|
|
295
|
+
analysis=2,
|
|
296
|
+
threat_level_id=2
|
|
297
|
+
)
|
|
298
|
+
|
|
299
|
+
# 添加 IOC
|
|
300
|
+
misp.add_attribute(event, type='ip-dst', value='1.2.3.4')
|
|
301
|
+
misp.add_attribute(event, type='domain', value='malicious.com')
|
|
302
|
+
misp.add_attribute(event, type='sha256', value='abc123...')
|
|
303
|
+
|
|
304
|
+
# 添加标签
|
|
305
|
+
misp.tag(event, 'tlp:amber')
|
|
306
|
+
misp.tag(event, 'misp-galaxy:mitre-attack-pattern="T1566"')
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
## 工具清单
|
|
310
|
+
|
|
311
|
+
| 工具 | 用途 |
|
|
312
|
+
|------|------|
|
|
313
|
+
| MISP | 威胁情报平台 |
|
|
314
|
+
| OpenCTI | 威胁情报管理 |
|
|
315
|
+
| TheHive | 事件响应平台 |
|
|
316
|
+
| Maltego | 关系分析 |
|
|
317
|
+
| Shodan | 网络空间搜索 |
|
|
318
|
+
| VirusTotal | 恶意软件分析 |
|
|
319
|
+
| ATT&CK Navigator | TTP 可视化 |
|
|
320
|
+
|
|
321
|
+
## 威胁建模
|
|
322
|
+
|
|
323
|
+
### 建模流程
|
|
324
|
+
```
|
|
325
|
+
资产识别 → 架构分解 → 威胁枚举 → 风险评级 → 缓解措施 → 验证
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
### STRIDE 速查
|
|
329
|
+
| 威胁 | 含义 | 缓解 |
|
|
330
|
+
|------|------|------|
|
|
331
|
+
| Spoofing | 身份伪造 | 强认证、MFA |
|
|
332
|
+
| Tampering | 数据篡改 | 完整性校验、签名 |
|
|
333
|
+
| Repudiation | 否认操作 | 审计日志、数字签名 |
|
|
334
|
+
| Info Disclosure | 信息泄露 | 加密、访问控制 |
|
|
335
|
+
| DoS | 拒绝服务 | 限流、冗余 |
|
|
336
|
+
| EoP | 权限提升 | 最小权限、输入验证 |
|
|
337
|
+
|
|
338
|
+
### PASTA 七阶段
|
|
339
|
+
```
|
|
340
|
+
定义目标 → 技术范围 → 应用分解 → 威胁分析 → 漏洞分析 → 攻击建模 → 风险管理
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
### 攻击树建模
|
|
344
|
+
```yaml
|
|
345
|
+
# OR节点: 任一子成功即成功, 风险=1-∏(1-Pi)
|
|
346
|
+
# AND节点: 全部子成功才成功, 风险=∏Pi
|
|
347
|
+
# 每节点属性: goal, cost, skill, detection, success_rate, mitigations
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
### 风险矩阵
|
|
351
|
+
```
|
|
352
|
+
>=15 严重(立即) / >=10 高(优先) / >=6 中(计划) / <6 低(监控)
|
|
353
|
+
风险分 = 可能性(1-5) x 影响(1-5)
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
### 威胁建模检查清单
|
|
357
|
+
```yaml
|
|
358
|
+
准备: 识别关键资产 + 定义安全目标 + 组建跨职能团队
|
|
359
|
+
建模: 数据流图+信任边界 + STRIDE/PASTA枚举 + 风险评级 + 缓解措施
|
|
360
|
+
验证: 安全测试 + 定期更新模型 + 跟踪缓解实施 + 事件后复盘
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
### 工具
|
|
364
|
+
| 工具 | 特点 |
|
|
365
|
+
|------|------|
|
|
366
|
+
| Microsoft Threat Modeling Tool | STRIDE 自动化 |
|
|
367
|
+
| OWASP Threat Dragon | 开源、DFD 支持 |
|
|
368
|
+
| Threagile | CLI、代码化建模 |
|
|
369
|
+
| PyTM | Python 编程式建模 |
|
|
370
|
+
|
|
371
|
+
---
|
|
372
|
+
|