srikanth-sec/siem-detection-lab

GitHub: srikanth-sec/siem-detection-lab

一个基于 Splunk 的 SIEM 检测实验室,通过 BOTS 数据集实践 MITRE ATT&CK 映射的威胁检测规则编写与调优。

Stars: 0 | Forks: 0

# SIEM 检测实验室 — Splunk Enterprise ## 目标 本实验室展示实用的基于 SIEM 的威胁检测技能,包括: - 编写和调优 **SPL (Splunk Processing Language)** 检测规则 - 将检测映射到 **MITRE ATT&CK** 战术和技术 - 分析来自 **Boss of the SOC (BOTS)** 数据集的真实攻击数据 - 记录误报注意事项和修复上下文 ## 环境 | 组件 | 详情 | |-----------|---------| | SIEM 平台 | Splunk Enterprise(免费许可证) | | 数据集 | Boss of the SOC (BOTS) v1 & v2 — Splunk 开放的 SOC 训练数据集 | | 操作系统 | windows 11 | | 部署方式 | 本地 VM / 独立安装 | ### 关于 BOTS 数据集 Boss of the SOC 是 Splunk 创建的免费公开数据集,包含真实世界的攻击场景,包括钓鱼、恶意软件、命令与控制、暴力破解和数据泄露。它广泛用于 SOC 分析师培训和检测工程实践。 ## MITRE ATT&CK 覆盖图 | 战术 | 技术 | 检测规则 | 状态 | |--------|-----------|----------------|--------| | 凭证访问 | T1110 — 暴力破解 | 多次失败登录后成功 | ✅ 完成 | | 初始访问 | T1566 — 钓鱼 | 可疑邮件附件检测 | ✅ 完成 | | 执行 | T1059.001 — PowerShell | 编码 PowerShell 命令执行 | ✅ 完成 | | 命令与控制 | T1071 — C2 over HTTP | 到已知恶意 IP 的出站连接 | ✅ 完成 | | 持久化 | T1136 — 创建账户 | 新建本地管理员账户 | ✅ 完成 | | 数据泄露 | T1048 — 通过替代协议泄露 | 大型出站数据传输检测 | ✅ 完成 | ## 检测规则 每个检测都包含 SPL 查询、数据源、MITRE 映射、截图和调优指南。 | # | 文件 | 技术 | 严重程度 | |---|------|-----------|----------| | 1 | [T1110 — 暴力破解](detections/T1110-brute-force.md) | 多次失败登录 → 成功 | 高 | | 2 | [T1566 — 钓鱼](detections/T1566-phishing.md) | 可疑邮件附件 | 高 | | 3 | [T1059.001 — PowerShell](detections/T1059-powershell-encoded.md) | 编码 PowerShell 执行 | 高 | | 4 | [T1071 — C2 over HTTP](detections/T1071-c2-http.md) | 到恶意 IP 的出站连接 | 严重 | | 5 | [T1136 — 创建账户](detections/T1136-new-admin-account.md) | 新建本地管理员账户 | 中 | | 6 | [T1048 — 数据泄露](detections/T1048-data-exfiltration.md) | 大型出站数据传输 | 高 | ## 仓库结构 ``` siem-detection-lab/ │ ├── README.md ← This file │ ├── /detections ← One file per detection rule │ ├── T1110-brute-force.md │ ├── T1566-phishing.md │ ├── T1059-powershell-encoded.md │ ├── T1071-c2-http.md │ ├── T1136-new-admin-account.md │ └── T1048-data-exfiltration.md │ ├── /screenshots ← Alert firing screenshots per detection │ ├── T1110-alert-fired.png │ ├── T1566-alert-fired.png │ ├── T1059-alert-fired.png │ ├── T1071-alert-fired.png │ ├── T1136-alert-fired.png │ └── T1048-alert-fired.png │ └── /setup └── splunk-lab-setup.md ← How to replicate this environment ``` ## 检测规则模板 `/detections` 中的每个检测都遵循以下结构: ``` ## 检测: **MITRE ATT&CK Technique:** T[ID] — [Name] **Tactic:** [Tactic] **Data Source:** [e.g. Windows Security Event Logs, Sysmon, Network logs] **Severity:** Critical / High / Medium / Low --- ### 检测内容 [2–3 sentences explaining the threat behaviour being detected and why it is suspicious in a real enterprise environment] ### SPL 查询 [paste SPL here] ### 截图 ![Detection firing](https://raw.githubusercontent.com/srikanth-sec/siem-detection-lab/main/../screenshots/TXXXX-alert-fired.png) ### 告警逻辑说明 [Walk through the key parts of the SPL and why each component is necessary] ### 误报注意事项 - [Scenario 1 that could trigger this legitimately] - [Scenario 2] - [How to reduce FP rate — whitelisting, threshold tuning] ### 调优建议 - [How to adjust threshold for noisy environments] - [Fields to whitelist] - [How to enrich the alert with additional context] ### 修复上下文 - [What an analyst should do when this fires] - [Escalation path] - [Containment actions] ``` ## 示例检测 — T1110 暴力破解 以下是完整的一个检测规则示例,展示本实验室所有规则使用的格式。 ### 检测:多次失败登录后成功认证 **MITRE ATT&CK 技术:** T1110 — 暴力破解 **战术:** 凭证访问 **数据源:** Windows 安全日志(事件 ID 4625 — 失败登录,事件 ID 4624 — 成功登录) **严重程度:** 高 #### 检测内容 识别在 10 分钟内经历 5 次或更多次失败登录尝试,然后成功认证的账户。此模式与暴力破解或密码喷洒攻击一致,攻击者最终猜到了有效凭证。 #### SPL 查询 ``` index=wineventlog EventCode=4625 | bucket _time span=10m | stats count as failed_attempts by _time, user, src_ip | where failed_attempts >= 5 | join user [ search index=wineventlog EventCode=4624 | stats count as success_count by user, src_ip | where success_count >= 1 ] | table _time, user, src_ip, failed_attempts, success_count | sort - failed_attempts ``` #### 告警逻辑说明 - `EventCode=4625` 捕获失败的 Windows 登录事件 - `bucket _time span=10m` 将事件分组为 10 分钟窗口 - `stats count` 统计每个用户每个窗口的失败尝试次数 - `where failed_attempts >= 5` 过滤出有 5 次以上失败的账户 - `join` 将同一用户的成功登录(4624)进行关联 - 结果:仅显示多次失败且随后成功的账户 #### 误报注意事项 - 休假归来忘记更新密码的用户 - 凭证已过期或最近轮换的服务账户 - 客服人员测试账户锁定策略 - **缓解措施:** 使用 `| where user!="svc_*"` 将已知服务账户列入白名单 #### 调优建议 - 在有很多远程员工的嘈杂环境中,将阈值提高到 10 次失败 - 在 join 中添加 `src_ip` 以确保检测到同一来源的暴力破解 - 与账户锁定事件(EventCode 4740)关联以确认严重程度 #### 修复上下文 - 通过检查 `src_ip` 的地理位置确认成功登录是否合法 - 如果是外部 IP — 立即升级,考虑暂停账户 - 如果是内部 IP — 与用户确认,可能是忘记密码的合法情况 - 检查该账户登录后的后续活动,查找横向移动迹象 ## 实验室设置指南 有关完整说明,请参阅 [/setup/splunk-lab-setup.md](setup/splunk-lab-setup.md): - 安装 Splunk Enterprise 免费许可证 - 下载和摄取 BOTS 数据集 - 配置 Windows 事件日志的索引设置 - 启用 Sysmon 以增强端点遥测 ## 展示的技能 - **SPL 查询编写** — stats、join、bucket、eval、rex、transaction 命令 - **检测工程** — 将 MITRE ATT&CK 技术转化为可操作的检测逻辑 - **告警调优** — 误报分析、阈值调整、白名单 - **SOC 分析师工作流** — 分诊上下文、升级路径、修复指导 - **文档编写** — 结构化、可用于面试的每个检测说明 ## 参考资料 - [Splunk Boss of the SOC (BOTS) 数据集](https://github.com/splunk/botsv1) - [MITRE ATT&CK 框架](https://attack.mitre.org) - [Splunk SPL 参考](https://docs.splunk.com/Documentation/Splunk/latest/SearchReference) - [Windows 安全事件 ID — Microsoft 文档](https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/security-auditing-overview) - [Sysmon 配置指南 — SwiftOnSecurity](https://github.com/SwiftOnSecurity/sysmon-config) *维护者:Srikanth Muppidi — 网络安全分析师* *印度海得拉巴 | muppidi.s@outlook.com*
标签:AMSI绕过, Boss of the SOC, BOTS数据集, C2检测, CCTV/网络接口发现, Cloudflare, IP 地址批量处理, MITRE ATT&CK, OpenCanary, PoC, PowerShell安全, SPL, Splunk Processing Language, 凭证访问, 初始访问, 命令与控制, 威胁检测, 安全运营, 库, 应急响应, 异常行为检测, 扫描框架, 暴力破解, 网络流量分析, 钓鱼检测