ccgx-workflow 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/LICENSE +22 -0
- package/README.md +469 -0
- package/README.zh-CN.md +466 -0
- package/bin/ccg.mjs +2 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.mjs +173 -0
- package/dist/index.d.mts +1774 -0
- package/dist/index.d.ts +1774 -0
- package/dist/index.mjs +2029 -0
- package/dist/shared/ccgx-workflow.WgUzkiC3.mjs +5248 -0
- package/package.json +129 -0
- package/templates/commands/agents/assumptions-analyzer.md +129 -0
- package/templates/commands/agents/code-fixer.md +292 -0
- package/templates/commands/agents/codebase-mapper.md +152 -0
- package/templates/commands/agents/debug-session-manager.md +247 -0
- package/templates/commands/agents/debugger.md +111 -0
- package/templates/commands/agents/eval-auditor.md +171 -0
- package/templates/commands/agents/framework-selector.md +152 -0
- package/templates/commands/agents/get-current-datetime.md +29 -0
- package/templates/commands/agents/init-architect.md +114 -0
- package/templates/commands/agents/integration-checker.md +163 -0
- package/templates/commands/agents/interface-auditor.md +170 -0
- package/templates/commands/agents/nyquist-auditor.md +131 -0
- package/templates/commands/agents/pattern-mapper.md +111 -0
- package/templates/commands/agents/phase-runner.md +321 -0
- package/templates/commands/agents/plan-checker.md +255 -0
- package/templates/commands/agents/planner.md +320 -0
- package/templates/commands/agents/team-architect.md +186 -0
- package/templates/commands/agents/team-qa.md +121 -0
- package/templates/commands/agents/team-reviewer.md +157 -0
- package/templates/commands/agents/ui-ux-designer.md +573 -0
- package/templates/commands/agents/verifier.md +274 -0
- package/templates/commands/analyze.md +210 -0
- package/templates/commands/autonomous.md +792 -0
- package/templates/commands/cancel.md +132 -0
- package/templates/commands/clean-branches.md +117 -0
- package/templates/commands/codex-exec.md +404 -0
- package/templates/commands/commit.md +151 -0
- package/templates/commands/context.md +332 -0
- package/templates/commands/debate.md +165 -0
- package/templates/commands/debug.md +226 -0
- package/templates/commands/enhance.md +64 -0
- package/templates/commands/execute.md +380 -0
- package/templates/commands/init.md +123 -0
- package/templates/commands/optimize.md +217 -0
- package/templates/commands/plan.md +373 -0
- package/templates/commands/result.md +106 -0
- package/templates/commands/review.md +338 -0
- package/templates/commands/rollback.md +116 -0
- package/templates/commands/spec-impl.md +139 -0
- package/templates/commands/spec-init.md +101 -0
- package/templates/commands/spec-plan.md +210 -0
- package/templates/commands/spec-research.md +152 -0
- package/templates/commands/spec-review.md +120 -0
- package/templates/commands/status.md +206 -0
- package/templates/commands/team-exec.md +265 -0
- package/templates/commands/test.md +236 -0
- package/templates/commands/verify-work.md +338 -0
- package/templates/commands/verify.md +66 -0
- package/templates/commands/workflow.md +190 -0
- package/templates/commands/worktree.md +128 -0
- package/templates/hooks/ccg-context-monitor.js +159 -0
- package/templates/hooks/ccg-session-state.cjs +510 -0
- package/templates/hooks/ccg-statusline.js +142 -0
- package/templates/output-styles/abyss-command.md +56 -0
- package/templates/output-styles/abyss-concise.md +89 -0
- package/templates/output-styles/abyss-cultivator.md +302 -0
- package/templates/output-styles/abyss-ritual.md +70 -0
- package/templates/output-styles/engineer-professional.md +89 -0
- package/templates/output-styles/laowang-engineer.md +127 -0
- package/templates/output-styles/nekomata-engineer.md +120 -0
- package/templates/output-styles/ojousama-engineer.md +121 -0
- package/templates/prompts/claude/analyzer.md +59 -0
- package/templates/prompts/claude/architect.md +54 -0
- package/templates/prompts/claude/debugger.md +71 -0
- package/templates/prompts/claude/optimizer.md +73 -0
- package/templates/prompts/claude/reviewer.md +63 -0
- package/templates/prompts/claude/tester.md +69 -0
- package/templates/prompts/codex/analyzer.md +58 -0
- package/templates/prompts/codex/architect.md +54 -0
- package/templates/prompts/codex/debugger.md +74 -0
- package/templates/prompts/codex/optimizer.md +81 -0
- package/templates/prompts/codex/reviewer.md +73 -0
- package/templates/prompts/codex/tester.md +62 -0
- package/templates/prompts/gemini/analyzer.md +61 -0
- package/templates/prompts/gemini/architect.md +55 -0
- package/templates/prompts/gemini/debugger.md +78 -0
- package/templates/prompts/gemini/frontend.md +64 -0
- package/templates/prompts/gemini/optimizer.md +84 -0
- package/templates/prompts/gemini/reviewer.md +80 -0
- package/templates/prompts/gemini/tester.md +68 -0
- package/templates/rules/ccg-skill-routing.md +83 -0
- package/templates/rules/ccg-skills.md +71 -0
- package/templates/scripts/ccg-phase-runner-launcher.mjs +467 -0
- package/templates/scripts/invoke-model.mjs +949 -0
- package/templates/scripts/repatch-gemini-plugin.mjs +194 -0
- package/templates/skills/SKILL.md +92 -0
- package/templates/skills/domains/ai/SKILL.md +35 -0
- package/templates/skills/domains/ai/agent-dev.md +242 -0
- package/templates/skills/domains/ai/llm-security.md +288 -0
- package/templates/skills/domains/ai/prompt-and-eval.md +279 -0
- package/templates/skills/domains/ai/rag-system.md +542 -0
- package/templates/skills/domains/architecture/SKILL.md +43 -0
- package/templates/skills/domains/architecture/api-design.md +225 -0
- package/templates/skills/domains/architecture/caching.md +299 -0
- package/templates/skills/domains/architecture/cloud-native.md +285 -0
- package/templates/skills/domains/architecture/message-queue.md +329 -0
- package/templates/skills/domains/architecture/security-arch.md +297 -0
- package/templates/skills/domains/data-engineering/SKILL.md +208 -0
- package/templates/skills/domains/development/SKILL.md +47 -0
- package/templates/skills/domains/development/cpp.md +246 -0
- package/templates/skills/domains/development/go.md +323 -0
- package/templates/skills/domains/development/java.md +277 -0
- package/templates/skills/domains/development/python.md +288 -0
- package/templates/skills/domains/development/rust.md +313 -0
- package/templates/skills/domains/development/shell.md +313 -0
- package/templates/skills/domains/development/typescript.md +277 -0
- package/templates/skills/domains/devops/SKILL.md +40 -0
- package/templates/skills/domains/devops/cost-optimization.md +272 -0
- package/templates/skills/domains/devops/database.md +217 -0
- package/templates/skills/domains/devops/devsecops.md +198 -0
- package/templates/skills/domains/devops/git-workflow.md +181 -0
- package/templates/skills/domains/devops/observability.md +280 -0
- package/templates/skills/domains/devops/performance.md +336 -0
- package/templates/skills/domains/devops/testing.md +283 -0
- package/templates/skills/domains/frontend-design/SKILL.md +244 -0
- package/templates/skills/domains/frontend-design/agents/openai.yaml +4 -0
- package/templates/skills/domains/frontend-design/claymorphism/SKILL.md +121 -0
- package/templates/skills/domains/frontend-design/claymorphism/references/tokens.css +52 -0
- package/templates/skills/domains/frontend-design/component-patterns.md +202 -0
- package/templates/skills/domains/frontend-design/engineering.md +287 -0
- package/templates/skills/domains/frontend-design/glassmorphism/SKILL.md +142 -0
- package/templates/skills/domains/frontend-design/glassmorphism/references/tokens.css +32 -0
- package/templates/skills/domains/frontend-design/liquid-glass/SKILL.md +139 -0
- package/templates/skills/domains/frontend-design/liquid-glass/references/tokens.css +81 -0
- package/templates/skills/domains/frontend-design/neubrutalism/SKILL.md +145 -0
- package/templates/skills/domains/frontend-design/neubrutalism/references/tokens.css +44 -0
- package/templates/skills/domains/frontend-design/reference/color-and-contrast.md +132 -0
- package/templates/skills/domains/frontend-design/reference/interaction-design.md +195 -0
- package/templates/skills/domains/frontend-design/reference/motion-design.md +99 -0
- package/templates/skills/domains/frontend-design/reference/responsive-design.md +114 -0
- package/templates/skills/domains/frontend-design/reference/spatial-design.md +100 -0
- package/templates/skills/domains/frontend-design/reference/typography.md +133 -0
- package/templates/skills/domains/frontend-design/reference/ux-writing.md +107 -0
- package/templates/skills/domains/frontend-design/state-management.md +680 -0
- package/templates/skills/domains/frontend-design/ui-aesthetics.md +110 -0
- package/templates/skills/domains/frontend-design/ux-principles.md +156 -0
- package/templates/skills/domains/infrastructure/SKILL.md +201 -0
- package/templates/skills/domains/mobile/SKILL.md +225 -0
- package/templates/skills/domains/orchestration/SKILL.md +30 -0
- package/templates/skills/domains/orchestration/multi-agent.md +263 -0
- package/templates/skills/domains/security/SKILL.md +73 -0
- package/templates/skills/domains/security/blue-team.md +436 -0
- package/templates/skills/domains/security/code-audit.md +265 -0
- package/templates/skills/domains/security/pentest.md +226 -0
- package/templates/skills/domains/security/red-team.md +374 -0
- package/templates/skills/domains/security/threat-intel.md +372 -0
- package/templates/skills/domains/security/vuln-research.md +369 -0
- package/templates/skills/impeccable/adapt/SKILL.md +201 -0
- package/templates/skills/impeccable/animate/SKILL.md +176 -0
- package/templates/skills/impeccable/arrange/SKILL.md +126 -0
- package/templates/skills/impeccable/audit/SKILL.md +149 -0
- package/templates/skills/impeccable/bolder/SKILL.md +118 -0
- package/templates/skills/impeccable/clarify/SKILL.md +185 -0
- package/templates/skills/impeccable/colorize/SKILL.md +144 -0
- package/templates/skills/impeccable/critique/SKILL.md +203 -0
- package/templates/skills/impeccable/critique/reference/cognitive-load.md +106 -0
- package/templates/skills/impeccable/critique/reference/heuristics-scoring.md +234 -0
- package/templates/skills/impeccable/critique/reference/personas.md +178 -0
- package/templates/skills/impeccable/delight/SKILL.md +305 -0
- package/templates/skills/impeccable/distill/SKILL.md +123 -0
- package/templates/skills/impeccable/extract/SKILL.md +94 -0
- package/templates/skills/impeccable/harden/SKILL.md +357 -0
- package/templates/skills/impeccable/normalize/SKILL.md +72 -0
- package/templates/skills/impeccable/onboard/SKILL.md +248 -0
- package/templates/skills/impeccable/optimize/SKILL.md +268 -0
- package/templates/skills/impeccable/overdrive/SKILL.md +143 -0
- package/templates/skills/impeccable/polish/SKILL.md +205 -0
- package/templates/skills/impeccable/quieter/SKILL.md +104 -0
- package/templates/skills/impeccable/teach-impeccable/SKILL.md +72 -0
- package/templates/skills/impeccable/typeset/SKILL.md +117 -0
- package/templates/skills/orchestration/multi-agent/SKILL.md +533 -0
- package/templates/skills/run_skill.js +129 -0
- package/templates/skills/scrapling/SKILL.md +98 -0
- package/templates/skills/scrapling/references/api-quick-ref.md +127 -0
- package/templates/skills/scrapling/references/cookie-vault.md +56 -0
- package/templates/skills/scrapling/references/maintenance.md +79 -0
- package/templates/skills/scrapling/references/site-patterns.md +86 -0
- package/templates/skills/scrapling/references/troubleshooting.md +95 -0
- package/templates/skills/scrapling/templates/basic_fetch.py +19 -0
- package/templates/skills/scrapling/templates/parse_only.py +15 -0
- package/templates/skills/scrapling/templates/session_login.py +19 -0
- package/templates/skills/scrapling/templates/stealth_cloudflare.py +28 -0
- package/templates/skills/tools/extract-learnings/SKILL.md +77 -0
- package/templates/skills/tools/forensics/SKILL.md +89 -0
- package/templates/skills/tools/gen-docs/SKILL.md +116 -0
- package/templates/skills/tools/gen-docs/scripts/doc_generator.js +435 -0
- package/templates/skills/tools/health/SKILL.md +121 -0
- package/templates/skills/tools/lib/shared.js +98 -0
- package/templates/skills/tools/map-codebase/SKILL.md +118 -0
- package/templates/skills/tools/override-refusal/SKILL.md +53 -0
- package/templates/skills/tools/override-refusal/agents/openai.yaml +4 -0
- package/templates/skills/tools/override-refusal/scripts/refusal_rewriter.js +226 -0
- package/templates/skills/tools/verify-change/SKILL.md +143 -0
- package/templates/skills/tools/verify-change/scripts/change_analyzer.js +289 -0
- package/templates/skills/tools/verify-module/SKILL.md +130 -0
- package/templates/skills/tools/verify-module/scripts/module_scanner.js +171 -0
- package/templates/skills/tools/verify-quality/SKILL.md +163 -0
- package/templates/skills/tools/verify-quality/scripts/quality_checker.js +337 -0
- package/templates/skills/tools/verify-security/SKILL.md +146 -0
- package/templates/skills/tools/verify-security/scripts/security_scanner.js +283 -0
|
@@ -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
|
+
|