meetdave-sec/WindowsSOC-Detection-Lab

GitHub: meetdave-sec/WindowsSOC-Detection-Lab

基于 Sysmon 和 Microsoft Sentinel 构建的 Windows SOC 检测实战实验室,通过模拟攻击场景来培养端点遥测分析与行为检测工程能力。

Stars: 0 | Forks: 0

# WindowsSOC-Detection-Lab 一个使用 Sysmon 和 Microsoft Sentinel 构建的 Windows SOC 检测实战实验室,用于威胁检测、攻击模拟、遥测分析和行为检测工程。 本项目在 Windows 11 虚拟机上模拟了真实的攻击者技术,并使用 Microsoft Sentinel 和 KQL 对生成的遥测数据进行分析。 # 项目概述 本实验室旨在通过模拟攻击者行为和分析端点遥测数据,来提升实用的 SOC 分析和检测工程技能。 该环境侧重于: - Windows 遥测数据收集 - Sysmon 监控 - Microsoft Sentinel 集成 - 使用 KQL 进行威胁狩猎 - 行为检测工程 - 持久化检测 - 侦察分析 - 攻击模拟工作流 # 实验室架构 ``` Windows 11 VM ↓ Sysmon ↓ Windows Event Logs ↓ Azure Monitor Agent ↓ Azure Arc ↓ Data Collection Rules ↓ Log Analytics Workspace ↓ Microsoft Sentinel ↓ KQL Detection & Threat Hunting ``` # 使用的技术 | 技术 | 用途 | |---|---| | Windows 11 VM | 攻击模拟环境 | | Sysmon | 端点遥测收集 | | Microsoft Sentinel | SIEM 平台 | | Azure Arc | 将本地 VM 载入 Azure | | Azure Monitor Agent | 遥测数据转发 | | Log Analytics Workspace | 集中式日志存储 | | KQL | 威胁狩猎与检测 | | PowerShell | 攻击模拟 | # 攻击模拟 ## 1. PowerShell 执行检测 模拟了 PowerShell 执行活动,并验证了 Sysmon Event ID 1 的遥测收集。 ### 攻击模拟 ![PowerShell 执行](https://static.pigsec.cn/wp-content/uploads/repos/2026/05/ec93d29888075933.png) ### 检测示例 ![PowerShell 检测](https://static.pigsec.cn/wp-content/uploads/repos/2026/05/c30d4e6cbe075933.png) ## 2. 编码的 PowerShell 检测 模拟了通常与攻击者混淆技术相关的 Base64 编码 PowerShell 执行。 ### 攻击模拟 ![编码的 PowerShell 执行](https://static.pigsec.cn/wp-content/uploads/repos/2026/05/114d3d48ae075934.png) ### 检测示例 ![编码的 PowerShell 检测](https://static.pigsec.cn/wp-content/uploads/repos/2026/05/5699d8c6d7075935.png) ## 3. 注册表持久化检测 使用注册表修改模拟了 Windows Run Key 持久化。 ### 攻击模拟 ![注册表持久化创建](https://static.pigsec.cn/wp-content/uploads/repos/2026/05/fdf2300574075935.png) ### 检测示例 ![注册表持久化检测](https://static.pigsec.cn/wp-content/uploads/repos/2026/05/78537433f9075936.png) ## 4. 计划任务持久化检测 使用 schtasks.exe 模拟了计划任务持久化。 ### 攻击模拟 ![计划任务持久化](https://static.pigsec.cn/wp-content/uploads/repos/2026/05/aad1dd408d075937.png) ### 检测示例 ![计划任务检测](https://static.pigsec.cn/wp-content/uploads/repos/2026/05/aa168ff004075937.png) ## 5. 侦察活动检测 使用常见的 Windows 发现命令模拟了攻击者的侦察行为。 ### 执行的命令 ``` whoami hostname ipconfig tasklist net user ``` ### 攻击模拟 ![侦察命令 1](https://static.pigsec.cn/wp-content/uploads/repos/2026/05/0ca072859f075938.png) ![侦察命令 2](https://static.pigsec.cn/wp-content/uploads/repos/2026/05/1ebf3b9ec9075938.png) ### 检测示例 ![侦察检测](https://static.pigsec.cn/wp-content/uploads/repos/2026/05/5ed226f18d075939.png) # 检测工程 本实验室侧重于行为检测工程,而非简单的基于签名的检测。 检测逻辑包括: - 编码的 PowerShell 执行 - 注册表持久化 - 计划任务持久化 - 侦察活动 - 可疑的 PowerShell 行为 - 父子进程分析 # KQL 查询示例 ## 编码的 PowerShell 检测 ``` Event | where Source == "Microsoft-Windows-Sysmon" | where EventID == 1 | where RenderedDescription has_any ("-enc","EncodedCommand") | sort by TimeGenerated desc ``` ## 注册表持久化检测 ``` Event | where Source == "Microsoft-Windows-Sysmon" | where EventID == 13 | where RenderedDescription has "CurrentVersion\\Run" | sort by TimeGenerated desc ``` ## 侦察检测 ``` Event | where Source == "Microsoft-Windows-Sysmon" | where EventID == 1 | where RenderedDescription has_any ("whoami.exe","hostname.exe","ipconfig.exe","tasklist.exe","net.exe") | sort by TimeGenerated desc ``` # Sysmon 与 Sentinel 集成 ## Azure Arc 连接的计算机 ![Azure Arc 已连接](https://static.pigsec.cn/wp-content/uploads/repos/2026/05/5d5d5e9477075940.png) ## Sentinel Sysmon 遥测 ![Sentinel Sysmon 日志](https://static.pigsec.cn/wp-content/uploads/repos/2026/05/09643abae8075940.png) # 仓库结构 ``` WINDOWSSOC-DETECTION-LAB/ │ ├── architecture/ ├── attack-simulations/ ├── detection-rules/ ├── documentation/ ├── kql-queries/ ├── logs-analysis/ ├── screenshots/ ├── sysmon-config/ └── README.md ``` # 展现的关键技能 - SOC 运营 - 威胁狩猎 - 检测工程 - Microsoft Sentinel - KQL 查询 - Sysmon 分析 - Windows 遥测 - 行为分析 - 持久化检测 - 进程关联 - 安全监控 # 涵盖的 MITRE ATT&CK 技术 | 技术 ID | 技术 | |---|---| | T1059.001 | PowerShell | | T1027 | 混淆/编码的文件和信息 | | T1547.001 | 注册表 Run Keys / 启动文件夹 | | T1053.005 | 计划任务 | | T1033 | 系统所有者/用户发现 | | T1082 | 系统信息发现 | | T1016 | 系统网络配置发现 | | T1057 | 进程发现 | | T1087 | 账户发现 | # 学习成果 通过这个项目我学到了: - 端点遥测如何流入 SIEM - Sysmon 如何提升 Windows 可见性 - 攻击者如何建立持久化 - 行为检测是如何被工程化的 - 如何调查可疑的进程活动 - 如何分析 PowerShell 遥测数据 - 如何构建 KQL 狩猎查询 - SOC 分析师如何调查攻击者行为 # 未来改进 未来潜在的增强功能: - Sigma 规则转换 - 自动化的 Sentinel 分析规则 - MITRE ATT&CK 仪表板 - Defender for Endpoint 集成 - 额外的攻击模拟 - 自动化告警工作流 # 免责声明 本项目仅出于教育和防御性安全目的而创建。 所有攻击模拟均在隔离的实验室环境中进行。
标签:AI合规, AMSI绕过, Azure Arc, Azure Monitor, DNS 反向解析, IPv6, KQL, Microsoft Sentinel, OpenCanary, PowerShell, Sysmon, Windows 11, 威胁检测, 安全实验室, 安全运营中心, 攻击模拟, 日志遥测, 端点安全, 网络安全, 网络映射, 蓝队演练, 补丁管理, 隐私保护, 驱动签名利用