vetementsvmnts/Window-SIEM-Lab

GitHub: vetementsvmnts/Window-SIEM-Lab

基于 Windows Server 2022 搭建的端到端 SIEM 实验环境,使用 Sysmon 采集遥测、Splunk 进行检测分析,并将事件映射到 MITRE ATT&CK 以支持威胁狩猎与事件响应模拟。

Stars: 0 | Forks: 0

``` ╔══════════════════════════════════════════════════════════════════════════════╗ ║ ║ ║ ██╗ ██╗██╗███╗ ██╗██████╗ ██████╗ ██╗ ██╗ ║ ║ ██║ ██║██║████╗ ██║██╔══██╗██╔═══██╗██║ ██║ ║ ║ ██║ █╗ ██║██║██╔██╗ ██║██║ ██║██║ ██║██║ █╗ ██║ ║ ║ ██║███╗██║██║██║╚██╗██║██║ ██║██║ ██║██║███╗██║ ║ ║ ╚███╔███╔╝██║██║ ╚████║██████╔╝╚██████╔╝╚███╔███╔╝ ║ ║ ╚══╝╚══╝ ╚═╝╚═╝ ╚═══╝╚═════╝ ╚═════╝ ╚══╝╚══╝ ║ ║ ║ ║ S I E M · L A B — S P L U N K + S Y S M O N ║ ║ ║ ╚══════════════════════════════════════════════════════════════════════════════╝ ``` ### windows-siem-lab **Windows Server 上的企业级 SIEM pipeline —— Sysmon 遥测、Splunk 采集, 以及与 MITRE ATT&CK 对齐的检测工程。** ![Platform](https://img.shields.io/badge/platform-Windows%20Server%202022-0078D4?style=flat-square&logo=windows&logoColor=white) ![Splunk](https://img.shields.io/badge/Splunk-Enterprise%209.x-FF6600?style=flat-square&logo=splunk&logoColor=white) ![Sysmon](https://img.shields.io/badge/Sysmon-v15.x-00ADEF?style=flat-square&logo=microsoft&logoColor=white) ![MITRE ATT&CK](https://img.shields.io/badge/MITRE%20ATT%26CK-mapped-E8001A?style=flat-square) ![Status](https://img.shields.io/badge/status-operational-00C853?style=flat-square) ![Author](https://img.shields.io/badge/author-Kitsana%20Thuekoh-7B61FF?style=flat-square)
## `>_ 概述` 本代码库记录了基于 Windows 的 SIEM 环境的端到端部署,专为**检测工程**、**威胁狩猎**和**事件响应模拟**而构建。该 pipeline 通过 Sysmon 捕获丰富的主机遥测数据,经由 Splunk Universal Forwarder 进行传输,并在自定义的 Splunk 仪表板中展示检测逻辑——所有这些都在一个隔离的实验网络中进行。 按照企业标准构建。按照生产质量记录。 ``` ┌─────────────────────────────────────────────────────────────────────────┐ │ L A B A R C H I T E C T U R E │ ├─────────────────────────────────────────────────────────────────────────┤ │ │ │ ┌──────────────────────┐ ┌──────────────────────────────────┐ │ │ │ Windows Server │ │ Splunk Enterprise │ │ │ │ 2022 — WIN-DC01 │ │ Linux VM — SIEM-01 │ │ │ │ │ │ │ │ │ │ ┌────────────────┐ │ │ ┌────────────┐ ┌───────────┐ │ │ │ │ │ Sysmon │ │ 9997 │ │ Indexer │ │ Search │ │ │ │ │ │ (telemetry) │──┼───────►│ │ :9997 │ │ Head │ │ │ │ │ └────────────────┘ │ │ └────────────┘ └───────────┘ │ │ │ │ ┌────────────────┐ │ │ │ │ │ │ │ │ │ UF (Forwarder)│ │ │ ┌──────▼───────────────▼────┐ │ │ │ │ │ inputs.conf │ │ │ │ Dashboard / Alerts │ │ │ │ │ └────────────────┘ │ │ └───────────────────────────┘ │ │ │ │ │ │ │ │ │ │ AD DS · DNS · GPO │ │ :8000 Web UI │ │ │ └──────────────────────┘ └──────────────────────────────────┘ │ │ │ │ Network: Host-Only · 192.168.10.0/24 · Domain: lab.local │ └─────────────────────────────────────────────────────────────────────────┘ ``` ## `>_ 技术栈` | 层级 | 技术 | 版本 | |-------|-----------|---------| | 宿主机 OS | Windows Server Standard (Desktop Experience) | 2022 | | 目录服务 | Active Directory Domain Services | — | | 遥测代理 | Sysinternals Sysmon | v15.x | | Sysmon 配置 | SwiftOnSecurity `sysmonconfig.xml` | latest | | 日志转发器 | Splunk Universal Forwarder | 9.x | | SIEM 平台 | Splunk Enterprise | 9.x | | Hypervisor | VMware Workstation Pro / VirtualBox | — | ## `>_ 检测覆盖范围` 收集、索引并映射到 ATT&CK 战术的事件。 | 事件 ID | 来源 | 描述 | ATT&CK 战术 | |----------|--------|-------------|---------------| | `4624` | Security | 成功登录 | Initial Access | | `4625` | Security | 登录失败 | Credential Access | | `4648` | Security | 使用显式凭据登录 | Lateral Movement | | `4688` + CLI | Security | 进程创建及命令行 | Execution | | `4720` | Security | 创建用户账户 | Persistence | | `4722` | Security | 启用用户账户 | Persistence | | `4740` | Security | 账户锁定 | Credential Access | | `4719` | Security | 审计策略已更改 | Defence Evasion | | `1` | Sysmon | 进程创建 | Execution | | `3` | Sysmon | 网络连接 | C2 / Exfiltration | | `11` | Sysmon | 文件创建 | Persistence | | `13` | Sysmon | 注册表值设置 | Persistence | | `22` | Sysmon | DNS 查询 | Discovery | ## `>_ 快速开始` ### 前置条件 - VMware Workstation Pro 或 VirtualBox - Windows Server 2022 评估版 ISO - Splunk Enterprise 安装程序 (Linux, `.deb`) - Splunk Universal Forwarder 安装程序 (Windows, `.msi`) - [Sysmon v15+](https://learn.microsoft.com/en-us/sysinternals/downloads/sysmon) - [SwiftOnSecurity sysmonconfig.xml](https://github.com/SwiftOnSecurity/sysmon-config) ### 1 · 部署 Windows Server ``` # 安装后:设置静态 IP 和主机名 Rename-Computer -NewName "WIN-DC01" -Restart # 安装 AD DS 角色 Install-WindowsFeature -Name AD-Domain-Services -IncludeManagementTools # 提升为 Domain Controller Install-ADDSForest ` -DomainName "lab.local" ` -DomainNetbiosName "LAB" ` -ForestMode "WinThreshold" ` -DomainMode "WinThreshold" ` -InstallDns ` -Force ``` ### 2 · 部署 Sysmon ``` # 下载 SwiftOnSecurity config(或提供您自己的配置) Invoke-WebRequest ` -Uri "https://raw.githubusercontent.com/SwiftOnSecurity/sysmon-config/master/sysmonconfig-export.xml" ` -OutFile "sysmonconfig.xml" # 使用 config 安装 .\sysmon64.exe -accepteula -i sysmonconfig.xml # 验证 Get-Service Sysmon64 Get-WinEvent -LogName "Microsoft-Windows-Sysmon/Operational" -MaxEvents 5 ``` ### 3 · 配置审计策略 ``` # 在进程创建事件中启用命令行日志记录 Set-ItemProperty ` -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit" ` -Name "ProcessCreationIncludeCmdLine_Enabled" ` -Value 1 # 通过 auditpol 应用高级审核策略 auditpol /set /subcategory:"Logon" /success:enable /failure:enable auditpol /set /subcategory:"Credential Validation" /success:enable /failure:enable auditpol /set /subcategory:"Process Creation" /success:enable auditpol /set /subcategory:"User Account Management" /success:enable /failure:enable ``` ### 4 · 配置 Splunk Universal Forwarder ``` # %SPLUNK_HOME%\etc\system\local\inputs.conf [WinEventLog://Security] index = windows_security disabled = false [WinEventLog://System] index = windows_system disabled = false [WinEventLog://Microsoft-Windows-Sysmon/Operational] index = sysmon disabled = false renderXml = true ``` ``` # %SPLUNK_HOME%\etc\system\local\outputs.conf [tcpout] defaultGroup = splunk_indexer [tcpout:splunk_indexer] server = 192.168.10.20:9997 ``` ``` # 重启 forwarder 以应用 Restart-Service SplunkForwarder ``` ### 5 · 在 Splunk 中验证 ``` # 确认数据正在流动 index=windows_security | stats count by sourcetype # 登录失败摘要 index=windows_security EventCode=4625 | stats count by Account_Name, Source_Network_Address | sort - count # 进程创建时间线 (Sysmon) index=sysmon EventCode=1 | table _time, User, Image, CommandLine, ParentImage | sort - _time # 账户创建审核 index=windows_security EventCode=4720 | table _time, Account_Name, SubjectUserName, src_ip ``` ## `>_ 代码库结构` ``` windows-siem-lab/ ├── docs/ │ ├── Windows_SIEM_Lab_Report.docx # Full technical lab report │ └── architecture.png # Lab network diagram ├── configs/ │ ├── sysmonconfig.xml # Sysmon ruleset (SwiftOnSecurity base) │ ├── inputs.conf # Splunk UF input configuration │ └── outputs.conf # Splunk UF output configuration ├── splunk/ │ ├── dashboards/ │ │ └── siem_overview.xml # Splunk dashboard XML │ └── searches/ │ └── detection_queries.spl # SPL detection library ├── scripts/ │ ├── deploy_sysmon.ps1 # Sysmon install + config script │ ├── audit_policy.ps1 # Audit policy hardening script │ └── create_lab_users.ps1 # AD user provisioning script └── README.md ``` ## `>_ SPL 检测库` 本实验中包含的一系列生产就绪 SPL 搜索。 ``` ────────────────────────────────────────────── BRUTE FORCE DETECTION — EID 4625 ────────────────────────────────────────────── index=windows_security EventCode=4625 | bucket _time span=5m | stats count by _time, Account_Name, Source_Network_Address | where count > 5 | eval alert="Potential brute force: " + Account_Name ────────────────────────────────────────────── LOLBAS EXECUTION — SYSMON EID 1 ────────────────────────────────────────────── index=sysmon EventCode=1 | eval lolbas=if(match(Image,"(?i)(certutil|bitsadmin|mshta|wscript|cscript|regsvr32|rundll32|msiexec|wmic)"),1,0) | where lolbas=1 | table _time, User, Image, CommandLine, ParentImage ────────────────────────────────────────────── PERSISTENCE VIA RUN KEY — SYSMON EID 13 ────────────────────────────────────────────── index=sysmon EventCode=13 | where match(TargetObject,"(?i)\\\\Run\\\\|\\\\RunOnce\\\\") | table _time, User, TargetObject, Details, Image ``` ## `>_ 作者`
**Kitsana Thuekoh** 渗透测试员 · 安全研究员 [![CPTS](https://img.shields.io/badge/HTB-CPTS-9FEF00?style=flat-square&logo=hackthebox&logoColor=black)](https://www.hackthebox.com) [![PenTest+](https://img.shields.io/badge/CompTIA-PenTest%2B-C8202F?style=flat-square&logo=comptia&logoColor=white)](https://www.comptia.org) [![Security+](https://img.shields.io/badge/CompTIA-Security%2B-C8202F?style=flat-square&logo=comptia&logoColor=white)](https://www.comptia.org) [![NASA VDP](https://img.shields.io/badge/NASA-VDP%20Recognition-0B3D91?style=flat-square&logo=nasa&logoColor=white)](https://www.nasa.gov)
``` [ MITRE ATT&CK ] · [ NIST SP 800-53 ] · [ CIS Benchmarks ] ``` *为教育、检测工程和安全运营研究而构建。*
标签:AI合规, Sysmon, Windows Server, 安全运营, 扫描框架, 知识库安全, 红队行动