yushen7chen/home-lab-siem
GitHub: yushen7chen/home-lab-siem
一个家庭实验室SIEM系统,用于模拟ATT&CK攻击并验证自定义检测规则。
Stars: 0 | Forks: 0
# 家庭实验室 SIEM — 检测工程
基于 Splunk Enterprise 构建的检测工程实验室,配备隔离的
Windows 10 目标机和 Kali Linux 攻击机虚拟机。文档记录了真实的
攻击模拟、自定义 SPL 检测规则,以及映射到 MITRE ATT&CK 的 Sigma 签名。
\*\*作者:\*\* Yushen Chen
\*\*最后更新:\*\* 2026年5月
\*\*框架:\*\* MITRE ATT&CK v14
\---
\## 实验室架构
宿主机
├── Windows 10 虚拟机 (192.168.10.10) — 目标
│ ├── Splunk Enterprise 9.x (SIEM)
│ └── Splunk Universal Forwarder (日志收集)
└── Kali Linux 虚拟机 (192.168.10.20) — 攻击者
└── 隔离的内部网络 (labnet)
| 组件 | 详情 |
|-----------|---------|
| SIEM | Splunk Enterprise 9.x |
| 目标 | Windows 10 Pro 虚拟机 |
| 攻击者 | Kali Linux 虚拟机 |
| 网络 | 隔离的内部网络 192.168.10.0/24 |
| Hypervisor | VirtualBox |
\---
\## 已配置的日志源
| 来源 | 事件 ID | 用途 |
|--------|-----------|---------|
| WinEventLog:Security | 4688, 4624, 4625 | 进程创建、登录事件 |
| WinEventLog:Windows PowerShell | 400, 403 | PowerShell 引擎生命周期 |
| WinEventLog:Microsoft-Windows-PowerShell/Operational | 4104 | 脚本块日志记录 |
\---
\## 模拟的 ATT&CK 技术
| ATT&CK ID | 技术 | 战术 | 严重性 | 已检测 |
|-----------|-----------|--------|----------|---------|
| T1059.001 | PowerShell 执行 | 执行 | 高 | 是 |
| T1087 | 账户发现 | 发现 | 中 | 是 |
| T1082 | 系统信息发现 | 发现 | 低 | 是 |
| T1057 | 进程发现 | 发现 | 低 | 是 |
| 组合 | 侦察链 | 执行 + 发现 | 高 | 是 |
| T1046 | 网络服务发现 | 发现 | 高 | 是 |
\---
\## 检测规则
\### Splunk SPL 规则
\*\*T1059.001 — 可疑的 PowerShell 执行\*\*
```
index=main source="WinEventLog:Windows PowerShell" EventCode=400
OR (source="WinEventLog:Microsoft-Windows-PowerShell/Operational" EventCode=4104)
| eval suspicious=if(match(Message,"(?i)(bypass|encoded|hidden|downloadstring|iex|invoke-expression|net user|Get-LocalUser)"),1,0)
| where suspicious=1
| table \_time, EventCode, Message
| sort -\_time
```
\*\*T1087 — 账户发现\*\*
```
index=main source="WinEventLog:Windows PowerShell"
| search Message="\*net user\*" OR Message="\*Get-LocalUser\*" OR Message="\*Get-LocalGroup\*"
| table \_time, EventCode, Message
| sort -\_time
```
\*\*T1082 — 系统信息发现\*\*
```
index=main source="WinEventLog:Windows PowerShell"
| search Message="\*systeminfo\*" OR Message="\*Get-ComputerInfo\*"
| table \_time, EventCode, Message
| sort -\_time
```
\*\*T1057 — 进程发现\*\*
```
index=main source="WinEventLog:Windows PowerShell"
| search Message="\*Get-Process\*" OR Message="\*tasklist\*"
| table \_time, EventCode, Message
| sort -\_time
```
\*\*组合 — 侦察链(最高价值)\*\*
```
index=main source="WinEventLog:Windows PowerShell"
| eval t1059=if(match(Message,"(?i)(bypass|encoded|iex)"),1,0)
| eval t1087=if(match(Message,"(?i)(net user|Get-LocalUser|Get-LocalGroup)"),1,0)
| eval t1082=if(match(Message,"(?i)(systeminfo|Get-ComputerInfo)"),1,0)
| eval t1057=if(match(Message,"(?i)(Get-Process|tasklist)"),1,0)
| eval recon\_score=t1059+t1087+t1082+t1057
| where recon\_score >= 2
| stats max(recon\_score) as score, values(Message) as commands by \_time span=5m
| where score >= 2
| sort -score
```
**注意:** T1046 是通过外部 Kali Linux 攻击机虚拟机 (192.168.10.20) 使用 Nmap 模拟的——所有其他技术都在目标机上本地执行,以模拟后渗透活动。
\### Sigma 规则
以 Sigma 格式编写的可移植检测规则——可与任何 SIEM 配合使用:
| 文件 | 技术 | 级别 |
|------|-----------|-------|
| \[T1059\_suspicious\_powershell.yml](./sigma-rules/T1059\_suspicious\_powershell.yml) | T1059.001 | 高 |
| \[T1087\_account\_discovery.yml](./sigma-rules/T1087\_account\_discovery.yml) | T1087 | 中 |
| \[T1082\_system\_info\_discovery.yml](./sigma-rules/T1082\_system\_info\_discovery.yml) | T1082 | 低 |
| \[T1057\_process\_discovery.yml](./sigma-rules/T1057\_process\_discovery.yml) | T1057 | 低 |
| \[T1059\_T1087\_T1082\_T1057\_recon\_chain.yml](./sigma-rules/T1059\_T1087\_T1082\_T1057\_recon\_chain.yml) | 组合 | 高 |
\---
\## 威胁检测报告
包含攻击时间线、误报分析和缓解建议的完整分析:
\[THREAT-DETECTION-REPORT.md](./THREAT-DETECTION-REPORT.md)
\*\*报告涵盖:\*\*
\- 攻击模拟方法论
\- 每个技术的日志证据
\- 每条检测规则的误报分析
\- 组合侦察链检测
\- 生产环境实施建议
\---
\## 关键发现
\*\*1. Windows 默认日志记录不足\*\*
Windows 10 默认审核策略不捕获 PowerShell 命令内容。要实现有意义的检测覆盖,必须启用脚本块日志记录(事件 ID 4104)。
\*\*2. 组合检测显著降低误报\*\*
单个技术检测的误报率较高。在同一会话中关联多个技术(侦察评分 ≥ 2)可产生高置信度、低噪声的警报。
\*\*3. PowerShell 操作日志是最高价值来源\*\*
事件 ID 4104 捕获实际执行的命令,使其成为针对基于 PowerShell 攻击的最具可操作性的日志源。
\---
\## 设置指南
\### 前置条件
\- VirtualBox
\- Windows 10 ISO
\- Kali Linux ISO
\- Splunk Enterprise(免费许可证)
\- Splunk Universal Forwarder
\### 网络配置
Windows 10 虚拟机:192.168.10.10(内部网络:labnet)
Kali Linux 虚拟机:192.168.10.20(内部网络:labnet)
\### 启用 PowerShell 日志记录(Windows 10 虚拟机)
```
\# Enable Script Block Logging
reg add "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\PowerShell\\ScriptBlockLogging" /v EnableScriptBlockLogging /t REG\_DWORD /d 1 /f
\# Enable Process Creation Command Line
reg add "HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\Audit" /v ProcessCreationIncludeCmdLine\_Enabled /t REG\_DWORD /d 1 /f
```
\### Splunk Universal Forwarder inputs.conf
\[WinEventLog://Security]
disabled = 0
index = main
\[WinEventLog://System]
disabled = 0
index = main
\[WinEventLog://Microsoft-Windows-PowerShell/Operational]
disabled = 0
index = main
\[WinEventLog://Windows PowerShell]
disabled = 0
index = main
\---
\## 工具与参考
\- \[Splunk Enterprise](https://www.splunk.com)
\- \[MITRE ATT&CK 框架](https://attack.mitre.org)
\- \[Sigma 规则](https://github.com/SigmaHQ/sigma)
\- \[Atomic Red Team](https://github.com/redcanaryco/atomic-red-team)
\- \[OWASP LLM Top 10](https://github.com/yushen7chen/owasp-llm-top10)
\---
\## 相关项目
\- \[OWASP LLM Top 10 研究仓库](https://github.com/yushen7chen/owasp-llm-top10)
\- \[AI 代理信任边界监控器](https://github.com/yushen7chen/agent-trust-monitor)
标签:AI合规, AMSI绕过, Cloudflare, MITRE ATT&CK, OpenCanary, Sigma规则, SPL, Windows 10, 事件日志, 威胁情报, 威胁检测, 安全事件响应, 安全实验室, 开发者工具, 插件系统, 攻击模拟, 无线安全, 目标导入, 网络安全, 虚拟化, 隐私保护, 驱动签名利用