agnideepa12/siem-detection-lab

GitHub: agnideepa12/siem-detection-lab

基于 Splunk 和 Sysmon 搭建的 SOC 安全运营实验环境,通过模拟真实攻击场景来培养日志分析与威胁检测的实战能力。

Stars: 0 | Forks: 0

# 🛡️ SIEM 日志监控与威胁检测实验环境 ![Splunk](https://img.shields.io/badge/Splunk-10.2.1-black?style=for-the-badge&logo=splunk&logoColor=white) ![Kali Linux](https://img.shields.io/badge/Kali_Linux-557C94?style=for-the-badge&logo=kali-linux&logoColor=white) ![Windows](https://img.shields.io/badge/Windows_10-0078D6?style=for-the-badge&logo=windows&logoColor=white) ![Ubuntu](https://img.shields.io/badge/Ubuntu_22.04-E95420?style=for-the-badge&logo=ubuntu&logoColor=white) **一个功能完备的企业级 SOC 家庭实验室,模拟** **真实世界中的一级 (Tier 1) 和二级 (Tier 2) 分析师工作流程** [查看检测规则](#detection-rules) • [查看截图](#screenshots) • [查看 MITRE 映射](#mitre-attck-mapping)
## 📋 项目概述 构建了一个完整的多虚拟机网络安全家庭实验室,模拟真实的企业 SOC 环境。该实验室将来自 Windows 和 Linux 端点的日志摄入到 Splunk SIEM 中,使用行业标准工具模拟真实世界的攻击,并使用自定义设计的 SPL 检测规则进行检测——这完全复刻了一级和二级 SOC 分析师的日常工作流程。 ## 🏗️ 实验架构 ``` ┌────────────────────────────────────────────────────────────┐ │ ISOLATED LAB NETWORK │ │ VirtualBox NAT Network │ │ │ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ │ │ Windows 10 │ │ Kali Linux │ │Ubuntu Server │ │ │ │ Victim │ │ Attacker │ │ SIEM Node │ │ │ │ 10.0.2.15 | │ 10.0.2.4 │ │ 10.0.2.3 │ │ │ │ │ │ │ │ │ │ │ │ • Sysmon │ │ • Hydra │ │ • Splunk │ │ │ │ • Splunk UF │ │ • Nmap │ │ 10.2.1 │ │ │ │ • Win Logs │ │ • Netcat │ │ │ │ │ └──────┬───────┘ └──────┬───────┘ └──────┬───────┘ │ │ │ │ Attacks │ │ │ └──────────────────┼────────────────────┘ │ │ Logs via port 9997 │ └────────────────────────────────────────────────────────────┘ ``` ## 🛠️ 工具与技术 | 类别 | 工具 | 版本 | 用途 | |---|---|---|---| | SIEM | Splunk Enterprise | 10.2.1 | 日志聚合、搜索、告警 | | 端点监控 | Sysmon | 最新版 | 深度 Windows 遥测数据 | | Sysmon 配置 | SwiftOnSecurity | 最新版 | 社区检测规则集 | | 日志转发 | Splunk Universal Forwarder | 10.2.1 | 基于代理的日志传输 | | 攻击平台 | Kali Linux | 2024 | 对手模拟 | | 暴力破解 | Hydra | 9.6 | 凭证攻击模拟 | | 侦察 | Nmap | 7.94 | 网络扫描模拟 | | Hypervisor | Oracle VirtualBox | 7.2.6 | 虚拟机管理 | | SIEM 操作系统 | Ubuntu Server | 22.04 LTS | Splunk 主机 | | 受害者操作系统 | Windows 10 | 22H2 | 目标端点 | ## ⚔️ 模拟的攻击 ### 1. SSH 暴力破解攻击 - **使用工具:** Hydra v9.6 - **目标:** Ubuntu SSH 服务 (端口 22) - **方法:** 使用自定义字典进行字典攻击 - **结果:** 在 10 秒内成功破解凭证 - **生成的日志:** /var/log/auth.log — 失败/接受密码事件 - **MITRE ATT&CK:** T1110.001 — 暴力破解:密码猜测 ### 2. Windows 凭证暴力破解 - **使用工具:** net use 命令模拟 - **目标:** Windows SMB 服务 (端口 445) - **方法:** 多次失败的认证尝试 - **结果:** 超过阈值后触发账户锁定 - **生成的日志:** 事件 ID 4625 (登录失败),事件 ID 4740 (账户锁定) - **MITRE ATT&CK:** T1110 — 暴力破解 ### 3. 网络侦察 - **使用工具:** Nmap 7.94 - **目标:** Windows 受害者机器 - **方法:** 对所有端口进行 SYN 扫描 - **结果:** 识别出开放端口 135, 139, 445 - **生成的日志:** Sysmon 事件 ID 3 — 网络连接 - **MITRE ATT&CK:** T1046 — 网络服务发现 ### 4. 可疑的 PowerShell 执行 - **使用工具:** PowerShell (内置) - **目标:** Windows 受害者机器 - **方法:** Base64 编码命令执行和下载器模拟 - **生成的日志:** Sysmon 事件 ID 1 — 包含编码命令行的进程创建 - **MITRE ATT&CK:** T1059.001 — 命令和脚本解释器:PowerShell ## 检测规则 ### 规则 1 — SSH 暴力破解检测 **严重程度:** 🔴 高危 **触发条件:** 60 秒内来自同一 IP 的 SSH 失败尝试超过 3 次 ``` index=linux_logs source="/var/log/auth.log" "Failed password" | rex field=_raw "from (?\d+\.\d+\.\d+\.\d+)" | bucket _time span=60s | stats count as failures by src_ip _time | where failures > 3 | sort -failures ``` ### 规则 2 — 暴力破解后的成功登录 **严重程度:** 🔴 严重 **触发条件:** 任何成功的 SSH 认证 — 表明可能存在入侵 ``` index=linux_logs source="/var/log/auth.log" "Accepted password" | rex field=_raw "from (?\d+\.\d+\.\d+\.\d+)" | table _time src_ip host | sort -_time ``` ### 规则 3 — Windows 账户锁定 **严重程度:** 🔴 严重 **触发条件:** 任何账户锁定事件 — 自动化攻击的强烈指标 ``` index=windows_logs EventCode=4740 | table _time ComputerName Account_Name | sort -_time ``` ### 规则 4 — Windows 暴力破解检测 **严重程度:** 🟠 高危 **触发条件:** 同一账户超过 5 次 Windows 登录失败 ``` index=windows_logs EventCode=4625 | stats count as failures by Account_Name | where failures > 5 | sort -failures | table Account_Name failures ``` ### 规则 5 — 可疑的 PowerShell 执行 **严重程度:** 🟠 高危 **触发条件:** PowerShell 使用编码命令或下载器执行 ``` index=windows_logs EventCode=1 | search CommandLine="*-EncodedCommand*" OR CommandLine="*-enc*" OR CommandLine="*IEX*" OR CommandLine="*DownloadString*" | table _time ComputerName User CommandLine | sort -_time ``` ## MITRE ATT&CK 映射 | 战术 | 技术ID | 技术名称 | 检测规则 | |---|---|---|---| | 侦察 | T1046 | 网络服务发现 | Nmap 检测 | | 凭证访问 | T1110 | 暴力破解 | Windows 暴力破解规则 | | 凭证访问 | T1110.001 | 密码猜测 | SSH 暴力破解规则 | | 持久化 | T1078 | 有效账户 | 成功登录规则 | | 防御规避 | T1059.001 | PowerShell | PowerShell 检测规则 | | 影响 | T1531 | 账户访问移除 | 账户锁定规则 | ## 📊 关键发现 | 发现 | 详情 | |---|---| | SSH 凭证被破解 | 使用 9 次密码尝试,在 10 秒内完成 | | 捕获的总攻击事件 | 57+ 个 Windows 安全事件 | | 检测到的 SSH 失败尝试 | 来自单个源 IP 的 7 次尝试 | | 账户锁定触发 | 5 次 Windows 登录失败后 | | 检测规则覆盖范围 | 5 条规则覆盖 6 项 MITRE 技术 | | 告警响应时间 | 通过计划任务每 5 分钟 | ## 截图 ### SOC 监控仪表板 ![Dashboard 1](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/4fe043cfd0184458.png) ![Dashboard 2](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/abdd7819ca184501.png) ### Splunk 中检测到的 SSH 暴力破解攻击 ![SSH Brute Force](https://raw.githubusercontent.com/agnideepa12/siem-detection-lab/main/screenshots/ssh_brute_force.png) ### Windows 安全事件 — 登录失败和账户锁定 ![Windows Events](https://raw.githubusercontent.com/agnideepa12/siem-detection-lab/main/screenshots/windows_events.png) ### 从 Kali 运行的 Hydra 暴力破解攻击 ![Hydra Attack](https://raw.githubusercontent.com/agnideepa12/siem-detection-lab/main/screenshots/hydra_attack.png) ### Splunk 检测告警 — 所有 5 条规则均已激活 ![Alerts 1](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/e9f69e3ed4184503.png) ![Alerts 2](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/d39f501258184505.png) ### Windows 事件查看器中的 Sysmon 操作日志 ![Sysmon](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/98dccc540e184507.png) ![Sysmon](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/abfaf754f2184509.png) ## 🎯 展示的技能 ``` Security Operations Detection Engineering ├── SIEM Administration ├── SPL Query Writing ├── Log Analysis ├── Alert Configuration ├── Alert Triage ├── Threshold Tuning ├── Incident Investigation └── MITRE ATT&CK Mapping └── Dashboard Creation Attack Simulation System Administration ├── Credential Attacks ├── Linux Administration ├── Network Reconnaissance ├── Windows Event Logging ├── PowerShell Attacks ├── VM Management └── Living Off The Land └── Network Configuration ``` ## 📚 我学到了什么 - 企业 SIEM 管道如何从端点运行到仪表板 - 原始 Windows 日志与 Sysmon 增强遥测数据之间的区别 - 攻击者如何使用暴力破解,以及为什么速度特征能揭示自动化行为 - 如何编写最大程度减少误报的 SPL 检测逻辑 - MITRE ATT&CK 框架如何映射到真实可观察事件 - 从告警到调查的完整 SOC 分析师工作流程 ## 🔮 未来改进 - [ ] 添加 Elastic SIEM 作为 Splunk 的替代方案 - [ ] 实施 Sigma 规则以实现跨平台检测 - [ ] 添加 Atomic Red Team 用于自动化攻击模拟 - [ ] 构建 Python 脚本以通过 REST API 自动生成 Splunk 告警 - [ ] 添加威胁情报源集成 - [ ] 实施 SOAR 剧本以实现自动化响应 ## 📬 联系我 [![LinkedIn](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white)](https://linkedin.com/in/agnideepa-majumder) [![GitHub](https://img.shields.io/badge/GitHub-100000?style=for-the-badge&logo=github&logoColor=white)](https://github.com/agnideepa12)
**⭐ 如果您觉得这个项目有帮助,请点亮 Star!** *作为动手网络安全家庭实验室的一部分构建,旨在培养* **真实的 SOC 分析师技能*
标签:AMSI绕过, Cloudflare, Conpot, MITRE ATT&CK, PE 加载器, PoC, PowerShell攻击, SPL搜索, Sysmon, Tier 1分析师, Tier 2分析师, VirtualBox, Windows安全, 企业级安全, 威胁检测, 安全仪表盘, 安全运营中心, 实验室环境, 已泄露账号检查, 攻击模拟, 时间线生成, 暴力破解, 渗透测试模拟, 端点安全, 网络安全, 网络映射, 虚拟化环境, 补丁管理, 账户锁定, 防御态势, 隐私保护, 驱动签名利用