purpleailab/decepticon/defense-evasion
Claude Code and agent skill by purpleailab/decepticon
- community
Checking that the SKILL.md file is still in the repository.
Endpoint defense bypass — AMSI/ETW patching, ScareCrow framework, custom loaders, direct/indirect syscalls, LOLBAS execution, process injection.
Install
npx vskill@latest install purpleailab/decepticon/defense-evasionSKILL.md
The same SKILL.md was published earlier as purpleailab/decepticon/defense-evasion.
Defense Evasion Knowledge Base
Defense evasion techniques disable, bypass, or avoid endpoint security controls (AV, EDR, AMSI, ETW) to ensure payloads execute and implants persist without detection. Every technique here has a shelf life --- detections evolve constantly. Always test against the target's specific stack before deployment.
Quick Reference
| Task | Technique | Risk Level | |
|---|---|---|---|
| Disable AMSI | Memory patch AmsiScanBuffer | Medium | |
| Disable AMSI (stealthier) | Hardware breakpoint on AmsiScanBuffer | Low | |
| Disable ETW | Patch EtwEventWrite | Medium | |
| Unhook EDR DLLs | ScareCrow / manual ntdll reload | High | |
| Generate evasive payload | ScareCrow with AES encryption | Medium | |
| Execute via LOLBAS | mshta, certutil, rundll32, regsvr32 | Varies | |
| Process injection | Process hollowing, early bird | High | |
| Custom loader | Nim/Rust/Go shellcode runner | Low-Medium |
MITRE ATT&CK Mapping
| Technique ID | Name | Evasion Relevance | |
|---|---|---|---|
| T1562 | Impair Defenses | AMSI/ETW patching, disabling logging | |
| T1027 | Obfuscated Files or Information | AES-encrypted shellcode, encoding | |
| T1055 | Process Injection | Hollowing, APC injection, thread hijack | |
| T1218 | System Binary Proxy Execution | LOLBAS (mshta, rundll32, regsvr32) | |
| T1036 | Masquerading | Spoofed code signing, renamed binaries | |
| T1140 | Deobfuscate/Decode Files | Runtime decryption of payloads |
1. AMSI Bypass Techniques
Memory Patching (AmsiScanBuffer)
Hardware Breakpoint Method (Stealthier)
Reflection Method
AMSI Bypass OPSEC Notes
| Method | Detectable By | OPSEC Rating | |
|---|---|---|---|
| Memory patch | EDR memory scanning, Integrity checks | Medium | |
| Hardware breakpoint | Thread context inspection (rare) | High | |
| Reflection (amsiInitFailed) | Script block logging, known signature | Low | |
| Forcing AMSI error | Process monitor, event correlation | Medium |
2. ETW Patching
Patching EtwEventWrite
What ETW Patching Disables
- .NET assembly load events (used by EDR to detect execute-assembly)
- PowerShell ScriptBlock logging
- Process creation events via ETW providers
- Network connection telemetry from userland
ETW OPSEC Notes
- Patch BEFORE loading any tools or assemblies
- Some EDRs monitor
EtwEventWriteintegrity --- pair with unhooking - Kernel-level ETW (via ETW Threat Intelligence provider) is NOT affected by userland patches
- Consider patching
NtTraceEventas well for deeper coverage
3. ScareCrow Framework
Overview
ScareCrow generates payloads that bypass EDR by unhooking userland API hooks, using direct syscalls, and applying AES encryption with spoofed code signing certificates.
Basic Payload Generation
ScareCrow Features
| Feature | Flag | Description | |
|---|---|---|---|
| EDR unhooking | (default) | Loads clean ntdll.dll from disk, replaces hooked copy | |
| AES encryption | -encryptionmode AES | Encrypts shellcode, decrypts at runtime | |
| Code signing spoof | -domain microsoft.com | Spoofs authenticode signature from specified domain | |
| Process injection | -injection <path> | Injects into specified sacrificial process | |
| DLL loader | -Loader dll | Output as DLL for sideloading scenarios | |
| Console hiding | -console | Hides console window on execution | |
| Sandbox evasion | -sandbox | Adds anti-sandbox checks (sleep, mouse, CPU) |
Code Signing Spoofing
4. Custom Loaders
All loaders follow the same pattern: decrypt shellcode at runtime, allocate RW memory, copy shellcode, change to RX, execute via thread.
Nim Shellcode Loader
Rust Shellcode Loader
Go Shellcode Loader
Loader OPSEC Comparison
| Language | Binary Size | AV Detection Rate | Notes | |
|---|---|---|---|---|
| Nim | ~50-100 KB | Low | Small, good Win API bindings | |
| Rust | ~150-300 KB | Low | Strong type safety, no runtime | |
| Go | ~2-5 MB | Low-Medium | Larger binary, distinct import table | |
| C/C++ | ~10-50 KB | Medium | Well-known patterns, heavily signatured | |
| C# | ~10-30 KB | High | .NET metadata, AMSI applies |
5. Direct & Indirect Syscalls
Concept
Syscalls bypass userland API hooks placed by EDR on ntdll.dll functions. Instead of calling NtAllocateVirtualMemory through the hooked ntdll export, the code directly invokes the syscall instruction with the correct System Service Number (SSN).
Direct Syscalls
Indirect Syscalls
SSN Resolution Methods
| Method | Description | OPSEC | |
|---|---|---|---|
| Hardcoded | SSNs baked into binary (version-specific) | Brittle, easy to detect | |
| Halo's Gate | Scan neighboring ntdll exports for unhooked SSNs | Medium | |
| Hell's Gate | Parse ntdll in memory to find SSNs | Medium | |
| Tartarus' Gate | Handle both hooked and unhooked neighbors | High | |
| FreshyCalls | Sort Zw* exports by address to derive SSNs | High | |
| SysWhispers3 | Generates syscall stubs with multiple techniques | Medium-High |
Tools
6. LOLBAS (Living Off the Land Binaries and Scripts)
mshta.exe (T1218.005)
certutil.exe (T1140)
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingpackages/decepticon/decepticon/skills/shared/defense-evasion/SKILL.md
Popularity
- Repository stars
- 4,278
- Repository forks
- 849
- 7-day trend score
- 42
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Grok Build (Cursor)
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/purpleailab/decepticon/defense-evasion)