rmedagam06/soc-investigation-sim
GitHub: rmedagam06/soc-investigation-sim
通过自动化攻击链与 SIEM 检测体系的完整集成,在隔离的 Docker 环境中模拟真实安全事件的发现、调查与报告全流程。
Stars: 0 | Forks: 0
# SOC 调查模拟
**端到端 SOC 调查模拟** — 一条从端口扫描到数据泄露的全自动化攻击链,包含完整的 SIEM 集成、9 条自定义 Sigma 检测规则以及自动化事件报告。
只需一条命令即可运行整个模拟:`python run.py`
## 演示内容
| 技能领域 | 工具与技术 |
|-------------|-------------------|
| **红队 / 进攻方** | Nmap(侦察)、Metasploit(漏洞利用、后渗透)、vsftpd CVE-2011-2523、GTFOBins 权限提升、DNS 隧道、HTTP 数据泄露 |
| **蓝队 / 检测方** | Suricata IDS、Zeek NSM、ELK SIEM(Elasticsearch + Logstash + Kibana)、9 条 Sigma 检测规则、Splunk SPL 转换 |
| **数字取证与响应** | Wireshark/tshark PCAP 捕获、IOC 提取、威胁情报富化(VirusTotal、AbuseIPDB)、证据保管链封装 |
| **威胁情报** | MITRE ATT&CK 框架映射、ATT&CK Navigator 层级生成、STIX 2.1 包导出 |
| **报告** | 自动化 PDF 报告(高管层 + 技术层)、vis.js 交互式时间轴、Streamlit 实时仪表板 |
| **工程化** | Docker Compose 实验环境隔离、Python 编排、Jinja2 模板化、Jupyter 威胁狩猎 |
## 快速开始
```
# 1. 克隆和配置
git clone
cd soc-investigation-sim
cp .env.example .env # Edit .env with your settings
# 2. 启动 Docker 实验环境 (Kali + 漏洞靶标 + ELK + Suricata/Zeek)
docker compose up -d
# 3. 运行完整模拟
python run.py # Runs attack → detection → timeline → reports → dashboard
# 4. 查看结果
# Kibana: http://localhost:5601
# Dashboard: http://localhost:8501 (自动打开)
# Timeline: reporting/output/timeline.html
# Reports: reporting/output/executive_summary.pdf
```
**环境要求:** Docker Desktop、Python 3.11+、`pip install -r requirements.txt`
## 架构
```
attack_net (172.20.0.0/24)
├── Attacker (172.20.0.5) — Kali: Nmap, Metasploit, Python orchestration
├── Target (172.20.0.10) — Ubuntu: vsftpd 2.3.4, Apache 2.4.49, weak SSH
└── IDS (172.20.0.254) — Suricata + Zeek (passive sniff → monitoring_net)
monitoring_net (172.21.0.0/24)
└── SIEM (172.21.0.10) — Elasticsearch + Logstash + Kibana
```
完整网络拓扑图请参阅 [docs/architecture.md](docs/architecture.md)。
## 攻击链(杀伤阶段)
```
Recon → Initial Access → Execution → Privilege Escalation → Lateral Movement → Persistence → Exfiltration
│ │ │ │ │ │ │
Nmap vsftpd Shell SUID SSH creds Cron DNS tunnel
T1046 CVE-2011-2523 T1059 python3 T1021.004 backdoor T1048.003
T1548.001 T1053.003
```
## 检测规则(Sigma)
9 条自定义 Sigma 规则覆盖了整个杀伤链。每条规则均被转换为
ELK KQL 和 Splunk SPL (`detection/rules/splunk_spl/`)。
| 规则 | 技术 | 严重性 |
|------|-----------|----------|
| 网络端口扫描 | T1046 | 中危 |
| vsftpd 后门(端口 6200) | T1190 | 严重 |
| 源自非交互式父进程的 Shell | T1059 | 高危 |
| SUID 二进制文件滥用(GTFOBins) | T1548.001 | 严重 |
| 新增 Cron 任务(远程信标) | T1053.003 | 高危 |
| DNS 隧道 | T1048.003 | 高危 |
| HTTP POST 数据泄露 | T1041 | 中危 |
| SSH 授权密钥被修改 | T1098.004 | 高危 |
| SSH 凭据重用 | T1078 | 高危 |
## 输出产物
每次运行都会生成:
| 产物 | 描述 |
|----------|-------------|
| `reporting/output/timeline.html` | 交互式 vis.js 时间轴 — 点击事件查看证据 |
| `reporting/output/executive_summary.pdf` | 1 页非技术性事件总结 |
| `reporting/output/technical_report.pdf` | 完整的 SOC 技术报告 |
| `reporting/output/mitre_layer.json` | ATT&CK Navigator 热力图层级 |
| `reporting/output/iocs.stix.json` | STIX 2.1 威胁情报包 |
| `reporting/output/ioc_report.json` | 提取的 IOC 及威胁情报富化结果 |
| `reporting/output/evidence_*.zip` | 所有产物 + SHA-256 证据保管链 |
| `detection/capture/evidence/*.pcap` | 原始数据包捕获(可使用 Wireshark 打开) |
## 项目结构
```
soc-investigation-sim/
├── run.py # Single-command demo runner
├── docker-compose.yml # 4-container isolated lab
├── attack/ # Red team: Nmap, Metasploit, post-exploitation
├── detection/ # Blue team: Sigma rules, PCAP analysis, IOC extraction
├── timeline/ # Incident timeline engine
├── reporting/ # PDF reports, MITRE mapper, STIX exporter
├── dashboard/ # Streamlit live demo dashboard
├── lab/ # Docker build contexts (attacker, target, SIEM, IDS)
├── notebooks/ # Jupyter threat hunting notebook
└── docs/ # Architecture, playbooks, recruiter guide
```
## 文档
- [架构](docs/architecture.md) — 网络拓扑与数据流
- [MITRE 覆盖范围](docs/mitre-coverage.md) — 完整的 ATT&CK 技术映射
- [招聘者指南](docs/recruiter-guide.md) — 项目能力证明及 5 分钟演示脚本
- [攻击剧本](docs/attack-playbooks/) — 分阶段 TTP 文档
- [威胁狩猎笔记本](notebooks/threat_hunting.ipynb) — 引导式调查演练
标签:CTI, Docker, IP 地址批量处理, Kubernetes, Metaprompt, SOC模拟, Web报告查看器, XXE攻击, 内容过滤, 威胁情报, 安全防御评估, 开发者工具, 插件系统, 版权保护, 请求拦截, 越狱测试, 逆向工具