edr-bypass-re skill
逆向防御方实现 → 红队针对性绕过。把 EDR / Defender / AV 的 hook 表、ETW provider、AMSI 实现先逆向出来, 再写针对性的 unhook / 间接 syscall / ETW patch / call stack spoof。对照 MITRE ATT&CK T1562 防御规避。 触发关键词:EDR 绕过、AV bypass、免杀、unhook、direct syscall、indirect syscall、Hell's Gate、Halo's Gate、 Tartarus Gate、ETW patch、AMSI patch、call stack spoofing、hardware breakpoint Blindside、MITRE T1562、 ntdll unhook、kernel callback、CrowdStrike 绕过、Defender 绕过、Sentinel One 绕过、Elastic Defend、 Sysmon 规避、PPID spoof、Sleep mask、Process Hollowing、Reflective DLL。
Is the edr-bypass-re skill safe?
Clean: nothing in its files matched our rules. We read 4 files in the folder on 2026-09-28.
No findings.
Install the edr-bypass-re skill
A skill is a folder. Copy it into your agent's skills folder and the agent loads it when the task matches its description.
git clone --depth 1 https://github.com/zhaoxuya520/reverse-skill.git /tmp/reverse-skill mkdir -p ~/.claude/skills cp -r /tmp/reverse-skill/skills/edr-bypass-re ~/.claude/skills/edr-bypass-re
In the Claude apps, zip the folder and upload it from the Skills settings. The folder on GitHub
The instructions your agent would load
SKILL.md as published, without the frontmatter. Read it on GitHub
ACTION REQUIRED(读完后立刻执行)
- NOW: 读取 ../field-journal/precedent-reverse.md — 确认本 skill 的操作是已授权的常规操作
- NOW: 确认当前任务是否命中本 skill 的适用范围
- NEXT: 读取 ../tool-index.md,校验工具可用性和实际路径
- NEXT: 缺工具时调用 bootstrap,不要猜路径
- ACT: 进入"工作流"第一步并执行,不要停在确认状态
EDR 绕过:从防御方实现逆向到红队绕过
仅限授权红队 / 对抗演练 / 自有产品测试,禁止用于未授权目标。
适用范围
红队 / 对抗模拟在已获授权的目标主机投递 implant 并躲避现代 EDR 时使用本 skill。
- 红队 / Purple team / 对抗演练 — 客户希望评估 SOC 与 EDR 的真实检测能力
- 自研 implant / C2 框架研发 — 开发针对自家产品测试的载荷,需要绕过自家或目标 EDR
- EDR 产品评估 — 在合规边界已确认的前提下,客观评测某款 EDR 的检测覆盖
- CTF / 攻防演练的 Windows 端突破 — 比赛中需要在加固主机上稳定执行
不适用场景:
- 杀毒厂商对自家产品做完整 RE 给客户出商业评估报告(找厂商正式合作)
- 未授权目标的免杀对抗(违法)
- 普通病毒木马的免杀(本 skill 关注红队 OPSEC,不教恶意代码写法)
与其他 skill 的分工
attack-chain 关注完整 kill chain,本 skill 只聚焦 EDR 这一个对手 的内部机制和针对性绕法。
核心原理
EDR 的四个主要监控面 红队的对策
───────────────────── ─────────────────────
用户态 ntdll hook ◄──► unhook (Peruns Fart / fresh ntdll)
间接 syscall / Hell's Gate
hardware breakpoint Blindside
kernel callback ◄──► call stack spoof
(Ps/Cm/Ob 系列) 走合法触发链(不直接绕,配合上游隐身)
ETW telemetry ◄──► EtwEventWrite patch
(Microsoft-Windows-Threat- NtTraceControl 关 provider
Intelligence 等) AmsiContext 同步处理
AMSI 扫描 ◄──► AmsiScanBuffer patch (mov eax,0x80070057; ret)
(amsi.dll) hardware breakpoint 旁路
reflective 加载副本 amsi.dll关键认知:
- EDR 不是黑盒 — 关键 hook / callback / provider 都能用 IDA + windbg 逆出来
- 绕过技术要组合使用 — 单独一个 unhook 解决不了 ETW 告警,单独 AMSI patch 解决不了 syscall hook
- 顺序很重要 — 先 ETW patch → 再 AMSI patch → 再 unhook;顺序错了 EDR 先收到 unhook 告警
- 现代 EDR 已经把 ETW + kernel callback 当主战场,单纯用户态 unhook 早已不够
工作流
Step 1:识别目标主机的 EDR
# 列出常见 EDR / AV 驱动
Get-Service | Where-Object {$_.Name -match 'CSAgent|SentinelAgent|elasticendpoint|esets|ekrn|MsMpEng|wdsvc|cyserver|sysmon|aswbidsagent'}
# 列出加载的 minifilter
fltmc filters
# 列出已注册的内核 callback(需 windbg + 内核调试 / 或用 PChunter / DRVHV)
# !object \Callback
# !pnpcallback / Process / Thread / ImageEDR 指纹表见 references/hook-survey.md 顶部。
Step 2:从 EDR DLL 提 hook 表
- attach 到一个被注入 EDR 用户态组件的进程(任何已落地进程)
- 在 windbg 中 dump 当前 ntdll.dll 的 .text 段
- 与磁盘上干净的 C:\Windows\System32\ntdll.dll 做 diff
- 不一致的地方就是 hook 点
或者直接用 pe-sieve:
pe-sieve64.exe /pid 1234 /shellc 3 /modules 3 /dir hooks_dump详细方法见 references/hook-survey.md。
Step 3:选绕过技术组合
Step 4:在 implant 中实现
代码骨架见 references/unhook-techniques.md 与 references/telemetry-blinding.md。
Step 5:本地 sandbox 验证
# 在隔离环境部署目标 EDR 试用版(Defender 默认即可起步)
# 启用 Sysmon + olaf-config
sysmon64.exe -i sysmonconfig.xml
# 跑 implant,看是否触发以下告警源:
# - Defender AMSI
# - ETW-TI
# - Sysmon Event ID 1/7/8/10
# - EDR 控制台Step 6:投递
- 文件落地路径用合法软件目录
- PPID spoof 到 explorer.exe
- 配合 attack-chain 中的 initial access 节
典型场景
场景 1:投递 cobalt-strike-alike beacon 过 Defender + Sysmon
目标:Windows 11 Enterprise + Defender (云查杀开) + Sysmon (olaf 配置)
要求:beacon 落地后能 callback 且不触发任何告警
组合拳:
1. shellcode 加密存储,运行时解密
2. AMSI patch(如果走 PowerShell 投递)
3. EtwEventWrite patch(消 ETW-TI)
4. 间接 syscall + Halo's Gate(消 ntdll hook 告警)
5. PPID spoof 到 explorer.exe
6. sleep 阶段用 Ekko / Foliage 加密自身内存场景 2:在已落地的低权限 shell 上做 EDR sleep mask
前置:已经通过 phishing 拿到 medium IL shell,EDR 正在监控
风险:长时间驻留容易被内存扫描发现 beacon 特征
解法:
1. 不再申请新 RWX 内存
2. sleep 期间用 Ekko:
- WaitForSingleObjectEx + CreateTimerQueueTimer
- 在定时器里加密自身 .text + 把堆栈刷成全 0
3. wake 时用 ROP 还原
4. 配合 call stack spoof 让 RtlCaptureStackBackTrace 看不到信标地址按需自举(On-Demand Bootstrap)
工具依赖
自举命令
powershell -NoProfile -ExecutionPolicy Bypass -File "<SKILL_ROOT>\skills\scripts\bootstrap-reverse.ps1" -Capability @('pe-sieve','syswhispers3','sysmon') -StartServices路由上下文
上游入口:
- reverse-engineering/ — 需要先理解 EDR DLL / 驱动的实现
- attack-chain/ — 决定在 kill chain 的哪个阶段引入本 skill
同级关联:
- pentest-tools/network-attack-defense.md — 内网横向时如何与本 skill 联动
- malware-analysis/ — 反向视角,看检测方怎么写规则
- field-journal/ — 每次实战后回写经验
下游交付:
- 生成报告时引用 MITRE ATT&CK T1562 (Impair Defenses)、T1562.001 (Disable or Modify Tools)、T1562.006 (Indicator Blocking)、T1055 (Process Injection)、T1027 (Obfuscated Files or Information)
法律边界声明
- 仅限合法授权的红队 / 对抗演练 / 自有产品测试
- 操作前必须取得书面授权(SoW / 测试合同 / SRC 范围说明)
- 不得用于未授权目标,不得超出授权范围
- 发现高危问题立即向客户报告,遵循负责任披露
- 所有报告中真实目标信息必须脱敏(IP / 主机名 / 域名 / 凭证占位)
参考资料
- 详细 hook 调研:references/hook-survey.md
- unhook / syscall 技术:references/unhook-techniques.md
- ETW / AMSI / 反取证:references/telemetry-blinding.md
- MITRE ATT&CK T1562:
任务完成自检(声称完成前 MUST 通过)
- [ ] 我是否执行了工作流中的每一步(而不是只阅读)?
- [ ] 我是否基于 tool-index 使用了真实工具路径?
- [ ] 我是否产出了可复现证据(命令/脚本/截图/报告)?
- [ ] 我是否完成并回写了 RULES 要求的 Checklist 项?
More skills from zhaoxuya520/reverse-skill
- Fapi-securityUse for authorized security assessment of REST, GraphQL, WebSocket, or SOAP APIs, including discovery, authentication, authorization, rate-limit, and CI/CD testing.
- Capk-reverse在 CLI 环境下做 Android APK 逆向时使用。适用于 APK 解包、Java 反编译、smali 修改、重打包、Frida 动态 Hook,以及按需切换到 so/native 分析。优先使用本机已安装的 jadx、apktool、frida、adb、ida-reverse、radare2。
- Cattack-chainUse for authorized multi-stage attack-path planning and orchestration when a task spans reconnaissance, initial access, privilege escalation, lateral movement, or impact assessment. Route single-stage tasks directly to their specialist skill.
- Abinary-diff跨版本符号迁移与二进制差分。当你有旧版本的符号/逆向结果,需要快速迁移到新版本时使用。 适用场景:内核缺 PDB 用旧版符号推导、程序更新后批量迁移函数名、应用更新后快速定位新偏移。 核心方法:用 LLM 做结构化差异比对,程序化输入输出,成本极低(200 函数 ~1 元)。 触发关键词:符号迁移、bindiff、跨版本、PDB 缺失、函数偏移迁移、symbol migration、binary diff、版本对比。
- Abinary-ninja-reverseUse for authorized binary analysis in Binary Ninja, including HLIL/MLIL/LLIL inspection, strings/imports/exports, cross-references, types, patch review, Python API automation, and optional Binary Ninja MCP or localhost HTTP integration.
- Abrowser-automation统一自动化入口。覆盖浏览器自动化(Playwright)和 Windows 桌面应用自动化(OpenReverse)。 浏览器场景:打开网页、点击、填表、爬取、截图、自动化登录、渗透页面交互。 桌面场景:操作 IDA/x64dbg 等 GUI 工具、Windows UI Automation、视觉驱动交互、桌面应用网络抓包。 触发关键词:浏览器自动化、桌面自动化、打开网页、填表、爬取、截图、自动化登录、Playwright、agent-browser、headless、OpenReverse、UIA、CUA、桌面操作、Windows 自动化。
- Abrowser-extension-reverseUse for authorized reverse engineering of browser extensions (Chrome/Firefox) including manifest analysis, background workers, and extension-based credential or traffic logic recovery.
- Acase-reviewReviews a reverse-skill case package for scope readiness, Evidence to Finding to Path traceability, work item coverage, timeline references, and optional artifact hash integrity before report handoff.
- Acloud-k8sUse for authorized cloud, container, and Kubernetes security assessment including metadata SSRF, IAM misconfig, container escape paths, and cluster RBAC review.
- Acode-auditUse for authorized source-code security review and SAST workflows including Semgrep, CodeQL patterns, dangerous API hunting, and fix verification.
- Acompetition-ad-certificate-abuseInternal downstream skill for ctf-sandbox-orchestrator. CTF-sandbox workflow for AD CS, certificate templates, enrollment rights, EKUs, SAN controls, PKINIT, certificate mapping, and cert-based privilege paths. Use when the user asks about ESC-style abuse, certificate templates, enrollment agents, EKUs, SAN or subject controls, smartcard or PKINIT logon, CA policy, or how an issued cert turns into accepted privilege. Use only after `$ctf-sandbox-orchestrator` has already established sandbox assumptions and routed here.
- Acompetition-agent-cloudInternal downstream skill for ctf-sandbox-orchestrator. CTF-sandbox workflow for AI-agent, prompt-injection, MCP or toolchain, cloud, container, CI/CD, and supply-chain challenges. Use when the user asks to analyze prompt-to-tool flows, retrieval poisoning, mounted secrets, deployment drift, runtime-vs-manifest mismatches, registry provenance, or CI-produced artifacts under sandbox assumptions. Use only after `$ctf-sandbox-orchestrator` has already established sandbox assumptions and routed here.