detecting-evasion-techniques-in-endpoint-logs

检测端点日志中对手使用的防御规避技术,包括日志篡改、时间戳伪造、进程注入和安全工具禁用。 适用于调查可疑端点行为、为规避战术构建检测规则,或针对隐蔽对手活动进行威胁狩猎的场景。

9 stars

Best use case

detecting-evasion-techniques-in-endpoint-logs is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

检测端点日志中对手使用的防御规避技术,包括日志篡改、时间戳伪造、进程注入和安全工具禁用。 适用于调查可疑端点行为、为规避战术构建检测规则,或针对隐蔽对手活动进行威胁狩猎的场景。

Teams using detecting-evasion-techniques-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

$curl -o ~/.claude/skills/detecting-evasion-techniques-in-endpoint-logs/SKILL.md --create-dirs "https://raw.githubusercontent.com/killvxk/cybersecurity-skills-zh/main/skills/detecting-evasion-techniques-in-endpoint-logs/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/detecting-evasion-techniques-in-endpoint-logs/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How detecting-evasion-techniques-in-endpoint-logs Compares

Feature / Agentdetecting-evasion-techniques-in-endpoint-logsStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

检测端点日志中对手使用的防御规避技术,包括日志篡改、时间戳伪造、进程注入和安全工具禁用。 适用于调查可疑端点行为、为规避战术构建检测规则,或针对隐蔽对手活动进行威胁狩猎的场景。

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

# 检测端点日志中的规避技术

## 使用场景

在以下情况下使用本技能:
- 在端点遥测数据中狩猎对手的防御规避技术(MITRE ATT&CK TA0005)
- 为常见规避方法(进程注入、时间戳伪造、日志清除)构建检测规则
- 调查对手禁用或绕过安全工具的事件
- 分析端点日志中滥用离地攻击二进制文件(LOLBin)的指标

**不适用于**网络层面的规避(使用网络流量分析)或恶意软件逆向工程。

## 前置条件

- 已安装并配置全面日志记录规则的 Sysmon(SwiftOnSecurity 或 Olaf Hartong 配置)
- 已启用高级审计策略的 Windows 安全事件日志
- EDR 遥测数据(CrowdStrike、SentinelOne、Microsoft Defender for Endpoint)
- 用于日志关联的 SIEM 平台(Splunk、Elastic、Sentinel)
- MITRE ATT&CK 企业矩阵用于技术参考

## 操作流程

### 步骤 1:检测日志篡改(T1070)

**Windows 事件日志清除(T1070.001)**:
```
# 针对 wevtutil 的 Sysmon 事件 ID 1(进程创建)
EventID: 1
CommandLine 包含:"wevtutil cl" 或 "wevtutil clear-log"

# 安全事件 ID 1102 - 审计日志已清除
EventID: 1102
来源:Microsoft-Windows-Eventlog

# 系统事件 ID 104 - 事件日志已清除
EventID: 104

# PowerShell 日志清除
EventID: 1 (Sysmon)
CommandLine 包含:"Clear-EventLog" 或 "Remove-EventLog"

# Splunk 查询:
index=windows (EventCode=1102 OR EventCode=104)
  OR (EventCode=1 CommandLine="*wevtutil*cl*")
  OR (EventCode=1 CommandLine="*Clear-EventLog*")
| table _time host user CommandLine EventCode
```

**时间戳伪造(T1070.006)**:
```
# Sysmon 事件 ID 2 - 文件创建时间已修改
EventID: 2
# 查找最近写入的文件但创建时间设置为很久以前
# 与事件 ID 11(FileCreate)关联 - 如果 FileCreate 时间是近期,
# 但事件 ID 2 中的创建时间是旧的,则很可能发生了时间戳伪造

# MDE 高级搜寻(KQL):
DeviceFileEvents
| where ActionType == "FileTimestampModified"
| where Timestamp > ago(7d)
| extend TimeDiff = datetime_diff('day', Timestamp, ReportedFileCreationTime)
| where TimeDiff > 30
| project Timestamp, DeviceName, FileName, FolderPath,
    ReportedFileCreationTime, InitiatingProcessFileName
```

### 步骤 2:检测进程注入(T1055)

```
# Sysmon 事件 ID 8 - CreateRemoteThread
EventID: 8
# 当源进程异常时发出告警(非系统进程)
# 过滤已知合法来源:杀毒软件、调试工具
SourceImage 不在 ("C:\Windows\System32\csrss.exe",
                     "C:\Windows\System32\lsass.exe")

# Sysmon 事件 ID 10 - 带可疑访问掩码的 ProcessAccess
EventID: 10
GrantedAccess 包含:"0x1F0FFF" 或 "0x1FFFFF" 或 "0x001F0FFF"
# PROCESS_ALL_ACCESS = 0x1F0FFF(注入中常见)
# 过滤合法来源:访问所有进程的 AV

# Sysmon 事件 ID 25 - Process Tampering
EventID: 25
Type: "Image is replaced"  # 进程空洞(Process Hollowing)指示器

# Splunk 检测:
index=sysmon EventCode=8
| where NOT match(SourceImage, "(?i)(csrss|svchost|MsMpEng|defender)")
| stats count by SourceImage TargetImage host
| where count < 5
| sort - count
```

### 步骤 3:检测安全工具禁用(T1562)

```
# 安全服务的服务停止事件
EventID: 7045(新服务)或 7036(服务状态变更)
ServiceName 在 ("WinDefend", "Sense", "CrowdStrike Falcon Sensor",
                 "SentinelAgent", "csagent", "MBAMService")

# Sysmon 事件 ID 1 - 禁用 Defender 的进程
CommandLine 包含:"Set-MpPreference -DisableRealtimeMonitoring"
  或 "sc stop WinDefend"
  或 "sc config WinDefend start= disabled"
  或 "net stop" 且 ("windefend" 或 "sense" 或 "csagent")

# 注册表修改以禁用安全功能
# Sysmon 事件 ID 13 - 注册表值设置
TargetObject 包含:"DisableAntiSpyware"
  或 "DisableRealtimeMonitoring"
  或 "DisableBehaviorMonitoring"
Details: "DWORD (0x00000001)"

# MDE KQL:
DeviceRegistryEvents
| where RegistryValueName in ("DisableAntiSpyware", "DisableRealtimeMonitoring")
| where RegistryValueData == "1"
| project Timestamp, DeviceName, RegistryKey, InitiatingProcessFileName
```

### 步骤 4:检测伪装(T1036)

```
# Sysmon 事件 ID 1 - 从异常路径运行的具有合法名称的进程
EventID: 1
Image 包含:"svchost.exe" 且 Image 不以 "C:\Windows\System32\" 开头
Image 包含:"csrss.exe" 且 Image 不以 "C:\Windows\System32\" 开头
Image 包含:"lsass.exe" 且 Image 不以 "C:\Windows\System32\" 开头

# 进程名称不匹配(原始文件名与当前名称)
# Sysmon 从 PE 头部获取 OriginalFileName
EventID: 1
OriginalFileName != (从 Image 路径解析出的文件名)

# 双扩展名文件
EventID: 11 (FileCreate)
TargetFilename 匹配:"*\.pdf\.exe" 或 "*\.doc\.exe" 或 "*\.jpg\.exe"

# Splunk:
index=sysmon EventCode=1
| eval process_name=mvindex(split(Image,"\\"),-1)
| where (process_name="svchost.exe" AND NOT match(Image,"(?i)C:\\\\Windows\\\\System32"))
  OR (process_name="csrss.exe" AND NOT match(Image,"(?i)C:\\\\Windows\\\\System32"))
| table _time host Image ParentImage CommandLine User
```

### 步骤 5:检测 LOLBin 滥用(T1218、T1127)

```
# 常见 LOLBin 滥用模式:

# mshta.exe 执行远程内容
EventID: 1
Image 以 "mshta.exe" 结尾
CommandLine 包含:"http" 或 "javascript:" 或 "vbscript:"

# certutil.exe 下载文件
EventID: 1
Image 以 "certutil.exe" 结尾
CommandLine 包含:"-urlcache" 或 "-decode" 或 "-encode"

# regsvr32.exe 执行脚本
EventID: 1
Image 以 "regsvr32.exe" 结尾
CommandLine 包含:"/s /n /u /i:" 或 "scrobj.dll"

# rundll32.exe 加载异常 DLL
EventID: 1
Image 以 "rundll32.exe" 结尾
CommandLine 包含:"javascript:" 或 ".js" 或 "http:"

# MSBuild 执行内联任务
EventID: 1
Image 包含:"MSBuild.exe"
CommandLine 不含 ".sln" 且不含 ".csproj"
```

### 步骤 6:构建检测规则关联

```
# 将多个弱信号组合成高置信度检测:

# 规则:潜在的后渗透规避链
# 同一台主机在 1 小时内观察到 3+ 种规避技术时触发

# Splunk 关联搜索:
index=sysmon host=*
| eval technique=case(
    EventCode=2, "timestomping",
    EventCode=8 AND NOT match(SourceImage,"csrss|svchost"), "process_injection",
    EventCode=1 AND match(CommandLine,"(?i)wevtutil.*cl"), "log_clearing",
    EventCode=13 AND match(TargetObject,"DisableRealtimeMonitoring"), "security_disable",
    EventCode=1 AND match(CommandLine,"(?i)(mshta|certutil.*urlcache|regsvr32.*/s.*/n)"), "lolbin_abuse",
    true(), NULL
)
| where isnotnull(technique)
| bin _time span=1h
| stats dc(technique) as technique_count values(technique) as techniques by host _time
| where technique_count >= 3
| sort - technique_count
```

## 关键概念

| 术语 | 定义 |
|------|------|
| **防御规避(TA0005)** | MITRE ATT&CK 战术,对手在行动过程中试图规避检测 |
| **进程注入(T1055)** | 将代码注入另一进程内存空间以在受信任上下文中执行的技术 |
| **时间戳伪造(T1070.006)** | 修改文件时间戳使恶意文件看起来是旧文件以融入合法文件 |
| **伪装(T1036)** | 将恶意文件或进程命名为与合法系统文件相匹配以规避检测 |
| **LOLBin** | 离地攻击二进制文件(Living Off the Land Binary),被对手重用的合法 Windows 工具 |
| **痕迹清除(T1070)** | 清除日志、删除文件或修改产物以清除攻陷证据 |

## 工具与系统

- **Sysmon**:具有内核级可见性的高级 Windows 系统监控工具
- **Microsoft Defender for Endpoint**:具有高级搜寻(KQL)功能的 EDR,用于规避检测
- **CrowdStrike Falcon**:基于 IOA 的行为检测,用于规避技术
- **Elastic Security**:具有内置 ATT&CK 规避技术检测规则的 SIEM
- **Sigma 规则**:与厂商无关的检测规则格式,具有丰富的规避规则库

## 常见误区

- **进程注入规则引起的告警疲劳**:许多合法工具(AV、辅助功能)执行进程注入。维护已知合法源进程的白名单。
- **缺少 Sysmon 事件 ID 8/10**:默认 Sysmon 配置可能不捕获 CreateRemoteThread 或 ProcessAccess。使用全面的 Sysmon 配置。
- **忽略父进程上下文**:来自 cmd.exe 的可疑命令行只有在 cmd.exe 的父进程异常时才值得关注(例如 Excel 生成 cmd.exe)。
- **不跨事件类型关联**:单个事件通常是良性的。将多个弱信号组合(进程创建 + 网络连接 + 文件创建)以获得高置信度检测。

Related Skills

performing-endpoint-vulnerability-remediation

9
from killvxk/cybersecurity-skills-zh

通过基于风险评分对 CVE 进行优先级排序、部署补丁、应用配置变更和验证修复 来执行端点漏洞修复。适用于修复漏洞扫描发现的问题、响应严重 CVE 公告 或维护端点合规性与补丁管理 SLA 的场景。适用于涉及漏洞修复、CVE 补丁、 端点漏洞管理或安全修复部署的请求。

performing-endpoint-forensics-investigation

9
from killvxk/cybersecurity-skills-zh

对受损端点执行数字取证调查,包括内存获取、磁盘镜像、工件分析和时间线重建。 适用于调查安全事件、为法律诉讼收集证据或分析端点受损范围的场景。 适用于涉及端点取证、内存分析、磁盘取证或事件调查的请求。

mapping-mitre-attack-techniques

9
from killvxk/cybersecurity-skills-zh

将观察到的对手行为、安全告警和检测规则映射到 MITRE ATT&CK 技术和子技术,以量化检测覆盖率并指导控制优先级。当构建基于 ATT&CK 的覆盖热图、为 SIEM 告警标记技术 ID、将安全控制与对手攻击手册对齐,或向高层报告威胁暴露时使用。适用于涉及 ATT&CK Navigator、Sigma 规则、MITRE D3FEND 或覆盖缺口分析的请求。

implementing-osquery-for-endpoint-monitoring

9
from killvxk/cybersecurity-skills-zh

部署 osquery 计划查询进行持续终端监控,涵盖进程清单、网络连接、文件完整性和持久化机制。 生成包含查询包的 osquery.conf,配置差异结果日志记录,并分析查询结果以检测 可疑进程、未授权监听端口和系统目录中的文件修改。

implementing-endpoint-dlp-controls

9
from killvxk/cybersecurity-skills-zh

实施端点数据丢失防护(DLP)控制,检测并防止敏感数据通过电子邮件、USB、 云存储和打印进行泄露。适用于部署 DLP 代理、创建内容检查策略或防止 端点上未授权数据移动的场景。适用于涉及 DLP、数据泄露防护、内容检查 或端点敏感数据保护的请求。

implementing-endpoint-detection-with-wazuh

9
from killvxk/cybersecurity-skills-zh

部署并配置 Wazuh SIEM/XDR 进行终端检测,包括 Agent 管理、自定义解码器和规则 XML 创建、通过 Wazuh REST API 查询告警,以及自动化响应动作。

hunting-for-process-injection-techniques

9
from killvxk/cybersecurity-skills-zh

通过 Sysmon 事件 ID 8 和 10 以及 EDR 进程遥测,检测进程注入技术(T1055),包括 CreateRemoteThread、进程空洞化和 DLL 注入。

hunting-for-lolbins-execution-in-endpoint-logs

9
from killvxk/cybersecurity-skills-zh

通过分析终端进程创建日志,识别合法 Windows 系统二进制文件(LOLBin)被用于恶意目的的可疑执行模式,狩猎攻击者的 LOLBin 滥用行为。

hunting-for-living-off-the-cloud-techniques

9
from killvxk/cybersecurity-skills-zh

狩猎攻击者滥用合法云服务(Azure、AWS、GCP 和 SaaS 平台)进行 C2、数据暂存和数据外泄的行为。

hunting-for-defense-evasion-via-timestomping

9
from killvxk/cybersecurity-skills-zh

通过比较 MFT 中的 $STANDARD_INFORMATION 与 $FILE_NAME 时间戳, 检测 NTFS 时间戳篡改(MITRE T1070.006)。使用 analyzeMFT 和 Python 识别具有异常时序模式的文件, 表明存在反取证时间戳篡改活动。

hardening-windows-endpoint-with-cis-benchmark

9
from killvxk/cybersecurity-skills-zh

使用 CIS(互联网安全中心)Benchmark 建议对 Windows 端点进行加固, 以减少攻击面、执行安全基线并满足合规要求。适用于部署新 Windows 工作站或服务器、 修复审计发现或为组织建立全面安全基线的场景。适用于涉及 Windows 加固、 CIS Benchmark、GPO 安全基线或端点配置合规的请求。

hardening-linux-endpoint-with-cis-benchmark

9
from killvxk/cybersecurity-skills-zh

使用 CIS Benchmark 建议对 Ubuntu、RHEL 和 CentOS 的 Linux 端点进行加固, 以减少攻击面、执行安全基线并满足合规要求。适用于部署新 Linux 服务器、修复审计发现 或为 Linux 基础设施建立安全基线的场景。