/cybersecurity-skills-zh:detecting-fileless-attacks-on-endpointsfrom cybersecurity-skills-zh
Detects fileless malware and memory-only attacks (PowerShell, reflective DLL injection, WMI persistence) using Sysmon, AMSI, and EDR. Provides detection rules and configuration.
Ships in cybersecurity-skills-zh. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
在以下情况下使用本技能:
不适用于检测基于文件的恶意软件或进行恶意软件逆向工程。
# 启用 PowerShell 脚本块日志记录(GPO 或注册表)
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging" `
-Name EnableScriptBlockLogging -Value 1 -PropertyType DWORD -Force
# 启用 PowerShell 模块日志记录
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ModuleLogging" `
-Name EnableModuleLogging -Value 1 -PropertyType DWORD -Force
# 启用 PowerShell 转录
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\Transcription" `
-Name EnableTranscripting -Value 1 -PropertyType DWORD -Force
# 用于无文件检测的 Sysmon 配置(关键事件):
# 事件 ID 1:进程创建(捕获 CommandLine)
# 事件 ID 7:镜像加载(DLL 加载)
# 事件 ID 8:CreateRemoteThread(注入)
# 事件 ID 10:进程访问(LSASS 访问)
# 事件 ID 19/20/21:WMI 事件
# 恶意 PowerShell 的指标:
# 编码命令执行
EventID: 1
CommandLine 包含:"powershell" 且 ("-enc" 或 "-e " 或 "-encodedcommand" 或 "FromBase64String")
# 下载摇篮(Download Cradle)模式
CommandLine 包含:"IEX" 且 ("Net.WebClient" 或 "DownloadString" 或 "Invoke-WebRequest")
CommandLine 包含:"Invoke-Expression" 且 "New-Object"
# AMSI 绕过尝试(事件 ID 4104 - 脚本块)
ScriptBlock 包含:"AmsiUtils" 或 "amsiInitFailed" 或 "SetValue.*amsi"
# 可疑 PowerShell 的 Splunk 查询:
index=windows source="WinEventLog:Microsoft-Windows-PowerShell/Operational" EventCode=4104
| where match(ScriptBlockText, "(?i)(iex|invoke-expression|downloadstring|net\.webclient|frombase64|bypass|amsiutils)")
| table _time host ScriptBlockText
# 反射式 DLL 注入 - 从内存加载 DLL 而不接触磁盘
# 检测:Sysmon 事件 7(ImageLoaded)其中镜像路径异常
EventID: 7
ImageLoaded 不以 "C:\Windows\" 开头 且不以 "C:\Program Files" 开头
# 进程空洞 - 创建挂起状态的进程,替换内存
# 检测:进程创建后紧接着内存写入
EventID: 1 + 10 关联
# 进程被创建然后以 PROCESS_VM_WRITE 访问
# APC 注入 - 将代码排队到线程的异步过程调用队列
# 检测:来自非系统进程的 Sysmon CreateRemoteThread
EventID: 8
SourceImage 不在 (已知合法来源) 中
# MDE KQL:
DeviceEvents
| where ActionType in ("CreateRemoteThreadApiCall", "NtAllocateVirtualMemoryApiCall")
| where InitiatingProcessFileName !in ("MsMpEng.exe", "svchost.exe")
| project Timestamp, DeviceName, ActionType, InitiatingProcessFileName,
InitiatingProcessCommandLine, FileName
# WMI 事件的 Sysmon 事件 ID 19/20/21
EventID: 19 # 检测到 WmiEventFilter 活动
EventID: 20 # 检测到 WmiEventConsumer 活动
EventID: 21 # 检测到 WmiEventConsumerToFilter 活动
# 除非预期,否则任何 WMI 事件订阅创建都是可疑的
# 常见恶意 WMI 持久化:
Consumer 包含:"CommandLineEventConsumer" 或 "ActiveScriptEventConsumer"
# 通过 osquery 或 PowerShell 查询 WMI 订阅:
Get-WMIObject -Namespace root\Subscription -Class __EventFilter
Get-WMIObject -Namespace root\Subscription -Class __EventConsumer
Get-WMIObject -Namespace root\Subscription -Class __FilterToConsumerBinding
# 存储在注册表值中并通过 PowerShell 执行的恶意软件
# Sysmon 事件 13 - 设置了含编码内容的注册表值
EventID: 13
TargetObject 包含:"CurrentVersion\Run"
Details:异常长的值或 Base64 编码内容
# 检测查询:
index=sysmon EventCode=13
| where match(Details, "[A-Za-z0-9+/=]{100,}")
| table _time host TargetObject Details Image
| 术语 | 定义 |
|---|---|
| 无文件恶意软件 | 完全在内存中运行、不向磁盘写入可执行文件的恶意软件 |
| AMSI | 反恶意软件扫描接口(Antimalware Scan Interface),允许安全产品在执行前检查脚本内容的 Windows API |
| 反射式 DLL 注入 | 从内存而非磁盘加载 DLL,避免基于文件的检测 |
| 进程空洞(Process Hollowing) | 创建合法进程的挂起状态,并用恶意代码替换其内存 |
| 脚本块日志记录 | 捕获反混淆脚本内容的 PowerShell 日志功能(事件 ID 4104) |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub killvxk/cybersecurity-skills-zh --plugin cybersecurity-skills-zh735 skills in this plugin
/acquiring-disk-image-with-dd-and-dcfldd使用 dd 和 dcfldd 创建取证级逐位磁盘镜像,通过哈希验证保持证据完整性。/analyzing-active-directory-acl-abuse使用 ldap3 检测 Active Directory 中危险的 ACL 配置错误,识别 GenericAll、WriteDACL 和 WriteOwner 等滥用路径/analyzing-android-malware-with-apktool使用 apktool 进行反编译、jadx 恢复 Java 源码、androguard 进行权限分析,对 Android APK 恶意软件样本执行静态分析,包括清单检查和可疑 API 调用检测。Other plugins' skills for the same job