Detects defense evasion techniques in endpoint logs, including log tampering, timestamp forgery, process injection, and security tool disabling. Useful for threat hunting, building detection rules, and investigating suspicious endpoint behavior.
npx claudepluginhub killvxk/cybersecurity-skills-zhThis skill uses the workspace's default tool permissions.
在以下情况下使用本技能:
Detects evasion techniques like log tampering, timestomping, process injection, and tool disabling in endpoint logs (Sysmon, EDR, Windows Events). For threat hunting and detection rules.
Detects defense evasion techniques like log tampering, timestomping, process injection, and security tool disabling in endpoint logs. For threat hunting, incident investigation, and building detection rules per MITRE ATT&CK TA0005.
Detects fileless malware and in-memory attacks on endpoints evading traditional AV. Builds detection rules for PowerShell attacks, reflective DLL injection, WMI persistence, and registry-resident malware.
Share bugs, ideas, or general feedback.
在以下情况下使用本技能:
不适用于网络层面的规避(使用网络流量分析)或恶意软件逆向工程。
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
# 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
# 安全服务的服务停止事件
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
# 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
# 常见 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"
# 将多个弱信号组合成高置信度检测:
# 规则:潜在的后渗透规避链
# 同一台主机在 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) | 清除日志、删除文件或修改产物以清除攻陷证据 |