Bikash-Raya/Threat-Hunting-Lab-Sentinel-Sysmon--lummac2-
GitHub: Bikash-Raya/Threat-Hunting-Lab-Sentinel-Sysmon--lummac2-
一个使用 Microsoft Sentinel 和 Sysmon 针对 LummaC2 恶意软件进行假设驱动威胁狩猎的完整安全实验报告与实操项目。
Stars: 0 | Forks: 0
# 🔍 LummaC2 威胁狩猎实验室 – 使用 Microsoft Sentinel & Sysmon 进行假设驱动的威胁狩猎



**编制:** Bikash Raya
**项目类型:** 假设驱动的威胁狩猎 — CISA 咨询通告 AA25-141b (LummaC2 / Lumma Stealer)
## 📁 仓库结构
| 文件 | 描述 |
| --- | --- |
| [LummaC2_Threat_Hunting_Lab_Report.pdf](./LummaC2_Threat_Hunting_Lab_Report.pdf) | 包含所有截图的完整实验室报告 |
| README.md | 项目概述 |
## 📋 概述
本实验室演示了一个完整的**假设驱动的威胁狩猎**工作流,使用了 **Microsoft Sentinel**、**Sysmon v15.21** 和 **KQL**,并与 CISA 网络安全咨询通告保持一致:
该实验室遵循完整的威胁狩猎生命周期:
* 🧠 **假设** — 如果 LummaC2 在此环境中执行会怎样?我该如何检测它?
* 🛠️ **模拟** — 创建了一个安全的 `LummaC2.exe`(仅启动 calc.exe)以生成指定的 IOC 遥测数据
* 🔬 **遥测** — 安装 Sysmon v15.21 以捕获进程创建、网络、DNS、DLL 加载
* 📡 **接入** — 创建了自定义 DCR 以将 Sysmon 日志发送到 Microsoft Sentinel
* 🔍 **狩猎** — 编写了 5 个 KQL 查询,映射到 CISA 咨询通告指标和 MITRE ATT&CK 技术
* ✅ **发现** — 狩猎 1 确认了 3 个结果,IOC 狩猎确认了 1 个结果,狩猎 2-5 无结果(符合预期)
## 🛠️ 使用的技术
* Microsoft Sentinel(日志 / KQL 狩猎)
* Microsoft Defender XDR (security.microsoft.com)
* Sysmon v15.21 (Microsoft Sysinternals)
* PS2EXE(PowerShell 转 EXE 编译器)
* Azure Data Collection Rule(自定义 Windows 日志)
* Log Analytics Workspace (Bik-SOC-Lab)
* KQL (Kusto Query Language)
* CISA 咨询通告 AA25-141b
* MITRE ATT&CK 框架
* any.run(IOC 研究)
* Windows Server 2022 (Web01)
## 🧪 实验室环境
| 组件 | 值 |
| --- | --- |
| 宿主机 VM | Web01 -- Windows Server 2022(公网 IP: 20.5.48.127) |
| Log Analytics Workspace | Bik-SOC-Lab |
| SIEM | Microsoft Sentinel |
| 端点监控 | Sysmon v15.21 |
| DCR | Sysmon-DCR -- Microsoft-Windows-Sysmon/Operational!* |
| 模拟文件 | LummaC2.exe(安全 -- PS2EXE 编译,仅启动 calc.exe) |
| 模拟 IOC IP | 94.158.244.69(从 Web01 进行 nslookup) |
## 🦠 威胁背景 — LummaC2 / Lumma Stealer
LummaC2(Lumma Stealer)是一种作为**恶意软件即服务**出售的信息窃取恶意软件,首次被发现于 2022 年 8 月。它主要针对加密货币钱包、浏览器凭证、登录数据和敏感文件。
| 属性 | 详情 |
| --- | --- |
| 又名 | Lumma Stealer \| LummaC2 Stealer |
| 类型 | 信息窃取器 |
| 来源 | ex-USSR |
| 首次发现 | 2022 年 8 月 1 日 |
| 知名 DLL | `iphlpapi.dll`(IP Helper API) \| `winhttp.dll`(Windows HTTP 服务) |
| C2 方式 | 基于 Web 的命令与控制 |
| 传播途径 | 钓鱼、伪装、 ingress Tool Transfer |
### MITRE ATT&CK 技术(CISA 咨询通告)
| 技术 | 名称 | 战术 |
| --- | --- | --- |
| T1566 | 钓鱼 | 初始访问 |
| T1036 | 伪装 | 防御规避 |
| T1217 | 浏览器信息发现 | 发现 |
| T1119 | 自动化收集 | 收集 |
| T1102 | Web 服务 (C2) | 命令与控制 |
| T1105 | Ingress Tool Transfer | 命令与控制 |
| T1041 | 通过 C2 通道外渗 | 外渗 |
## 🧠 狩猎假设
## 🔬 实验阶段
### 阶段 1 — LummaC2 模拟
创建了一个安全的 PowerShell 脚本,并使用 PS2EXE 将其编译为 `LummaC2.exe`:
**文件:`LummaStealer_Simulation.ps1`**
```
Write-Output "Lumma Stealer Simulation Started"
Start-Process calc.exe
Write-Output "Simulation Complete"
```
**编译为 EXE:**
```
Install-Module PS2EXE -Scope CurrentUser
Import-Module PS2EXE
Invoke-PS2EXE `
-InputFile .\LummaStealer_Simulation.ps1 `
-OutputFile .\LummaC2.exe
```
**执行:**
```
.\LummaC2.exe
```
✅ `LummaC2.exe` 已执行,`calc.exe` 作为子进程启动,生成了 Sysmon Event ID 1。
### 阶段 2 — Sysmon 安装
```
cd C:\Users\bikashsoc1\Downloads\Sysmon
.\Sysmon64.exe -accepteula -i
```
**验证:**
```
Get-Service Sysmon64
# 状态: Running | 名称: Sysmon64
```
**受监控的 Sysmon Event ID:**
| Event ID | 描述 |
| --- | --- |
| 1 | 进程创建 |
| 3 | 网络连接 |
| 7 | 镜像加载 (DLL) |
| 11 | 文件创建 |
| 13 | 注册表修改 |
| 22 | DNS 查询 |
### 阶段 3 — 将 Sysmon 日志接入 Sentinel
创建了新的 Data Collection Rule:
| 设置 | 值 |
| --- | --- |
| DCR 名称 | Sysmon-DCR |
| 日志源 | 自定义 Windows 日志:`Microsoft-Windows-Sysmon/Operational!*` |
| 目标 | Bik-SOC-Lab (Log Analytics Workspace) |
**在 Sentinel 中验证:**
```
Event
| where EventLog == "Microsoft-Windows-Sysmon/Operational"
| where EventID == 1
| take 20
```
✅ 确认来自 Web01 的 13 个以上结果。
### 阶段 4 — IOC 模拟
通过针对已知的 IOC IP 运行 nslookup 来模拟 LummaC2 的网络活动:
```
nslookup 94.158.244.69
# 解析至: no-rdns.mivocloud.com
```
这生成了 `nslookup.exe` 的 Sysmon Event ID 1,其命令行中包含 IOC IP — 可通过 Sentinel KQL 检测到。
## 🔍 KQL 威胁狩猎查询
### 狩猎 1 — LummaC2 进程执行(模拟 IOC)
```
Event
| where TimeGenerated > ago(24h)
| where EventLog == "Microsoft-Windows-Sysmon/Operational"
| where EventID == 1
| where RenderedDescription has_any ("LummaC2.exe")
| project
TimeGenerated,
Computer,
SysmonEventID = EventID,
Activity = "LummaC2 Simulation Process Execution",
RenderedDescription
| order by TimeGenerated desc
```
✅ **确认 3 个结果** — Web01 上的 LummaC2.exe 进程创建及完整遥测数据。
### IOC 调查狩猎 — 94.158.244.69
```
Event
| where TimeGenerated > ago(24h)
| where EventLog == "Microsoft-Windows-Sysmon/Operational"
| where RenderedDescription contains "94.158.244.69"
| project TimeGenerated, Computer, EventID, RenderedDescription
| order by TimeGenerated desc
```
✅ **确认 1 个结果** — 捕获到带有 IOC IP 的 `nslookup.exe` (C:\Windows\System32\nslookup.exe)。
### 狩猎 2 — Sysmon DLL 镜像加载 (iphlpapi.dll / winhttp.dll)
```
Event
| where TimeGenerated > ago(24h)
| where EventLog == "Microsoft-Windows-Sysmon/Operational"
| where EventID == 7
| where RenderedDescription contains "iphlpapi.dll"
or RenderedDescription contains "winhttp.dll"
| project TimeGenerated, Computer, RenderedDescription
| order by TimeGenerated desc
```
⬜ 无结果 — 符合预期(模拟不会加载这些 DLL)。
### 狩猎 3 — 可疑网络 / C2 活动
```
Event
| where TimeGenerated > ago(24h)
| where EventLog == "Microsoft-Windows-Sysmon/Operational"
| where EventID == 3
| where RenderedDescription contains "LummaC2.exe"
| project TimeGenerated, Computer, RenderedDescription
| order by TimeGenerated desc
```
⬜ 无结果 — 符合预期(模拟未进行任何网络连接)。
### 狩猎 4 — 针对 LummaC2 C2 域名的 DNS 查询
```
let LummaDomains = dynamic([
"blast-hubs.com",
"blastikcn.com",
"friendseforever.help",
"shiningrstars.help",
"generalmills.pro",
"hoyoverse.blog"
]);
Event
| where TimeGenerated > ago(24h)
| where EventLog == "Microsoft-Windows-Sysmon/Operational"
| where EventID == 22
| where RenderedDescription has_any (LummaDomains)
| project TimeGenerated, Computer, RenderedDescription
| order by TimeGenerated desc
```
⬜ 无结果 — 符合预期(模拟中没有 C2 DNS 查询)。
### 狩猎 5 — 可疑下载 / 传输活动
```
SecurityEvent
| where TimeGenerated > ago(24h)
| where EventID == 4688
| where CommandLine has_any (
"Invoke-WebRequest", "curl", "wget", "bitsadmin", "certutil"
)
| project TimeGenerated, Computer, Account, NewProcessName, CommandLine
| order by TimeGenerated desc
```
⬜ 无结果 — 符合预期(模拟中未使用下载工具)。
## 📊 狩猎结果摘要
| 狩猎 | 描述 | Sysmon Event | MITRE | 结果 |
| --- | --- | --- | --- | --- |
| 1 | LummaC2.exe 进程执行 | Event ID 1 | T1036 | ✅ 3 个结果 |
| IOC | nslookup 94.158.244.69 | Event ID 1 | T1046 | ✅ 1 个结果 |
| 2 | DLL 加载 (iphlpapi / winhttp) | Event ID 7 | T1574 | ⬜ 无结果(符合预期) |
| 3 | 网络 / C2 活动 | Event ID 3 | T1071 | ⬜ 无结果(符合预期) |
| 4 | LummaC2 域名 DNS 查询 | Event ID 22 | T1071 | ⬜ 无结果(符合预期) |
| 5 | 下载工具使用 | Event ID 4688 | T1105 | ⬜ 无结果(符合预期) |
## 🎯 展示的技能
* 假设驱动的威胁狩猎方法论
* 基于 CISA 咨询通告的 IOC 研究与分析
* Sysmon 安装、配置与日志验证
* 用于将 Sysmon 日志接入 Sentinel 的自定义 DCR
* PS2EXE 模拟工程(安全的恶意软件模拟)
* KQL 高级狩猎查询(5 个狩猎查询)
* IOC 调查(nslookup / 基于 IP 的狩猎)
* MITRE ATT&CK 技术映射 (T1036, T1105, T1071, T1574)
* Microsoft Sentinel 日志分析与狩猎
* 针对 Sysmon Event ID 1, 3, 7, 22 编写 KQL 检测查询(查询已编写;确认了 Event ID 1 结果)
* 检测工程验证
* 端点遥测分析(Sysmon Event ID 1 — 确认了进程创建)
## 🎯 核心收获
## 🔗 相关项目
## 🔗 与我联系
[](https://www.linkedin.com/in/bikash-raya/)
[](https://github.com/Bikash-Raya)
⭐ 如果您觉得这个项目有用,欢迎给仓库点个 Star ⭐
标签:AI合规, DNS 解析, IP 地址批量处理, KQL, LummaC2, Microsoft Sentinel, Sysmon, 网络信息收集