reverser-yara-hunting
Skill này làm gì
Skill giải thích cách viết luật YARA mô tả mẫu của mã độc và cách tránh báo động giả. Dành cho nhà phân tích mã độc và người săn mối đe dọa.
Khi nào nên dùng
- ✓Khi người săn mối đe dọa muốn một luật tìm được một họ mã độc cụ thể trong tập file.
- ✓Khi nhà phân tích cần giảm báo động giả trong một luật YARA đang có.
- ✓Khi một đội muốn tìm kiếm một mẫu trong các bộ sưu tập mẫu mã độc công khai.
Liên kết skill
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/reverser/yara-hunting/SKILL.mdSao 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
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Viết một luật YARA tìm các file thuộc họ mã độc này dựa trên các chuỗi đặc trưng của nó.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill hướng dẫn AI viết luật có metadata, mẫu chuỗi hoặc byte cụ thể và các điều kiện như kích thước file hay trạng thái ký số. Sau đó luật được kiểm tra với các lỗi thường gặp.
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.
YARA Rule Authoring + Hunting
Anatomy of a good rule
import "pe"
import "hash"
rule MalFamily_DropperVariant_Q4_2024 {
meta:
author = "you"
date = "2024-11-20"
description = "MalFamily dropper, observed Q4 2024 campaign"
hash = "deadbeefdeadbeefdeadbeefdeadbeef"
tlp = "amber"
confidence = "high"
false_positives = "low (test against AV vendor samples)"
mitre = "T1055"
strings:
$magic = { 4D 5A 90 00 03 } // MZ + DOS header
$config_marker = { 7A 89 ?? ?? 4F 8C } // 6-byte signature, 2 wildcards
$string1 = "loader_stage_2" wide
$string2 = "cmd.exe /c " ascii
$api1 = "VirtualAllocEx"
$api2 = "WriteProcessMemory"
$api3 = "CreateRemoteThread"
// Avoid generic strings — they cause FPs.
condition:
uint16(0) == 0x5A4D and // PE header
filesize < 5MB and // bounded — avoids huge-file scans
$config_marker and // unique marker
2 of ($api1, $api2, $api3) and // at least 2 of the 3 process-inject APIs
any of ($string*) and
pe.imports("ws2_32.dll", "WSAStartup") and // network capability
not pe.is_signed // unsigned
}
The condition tools you need
// Filesize / offset reads (no module)
filesize > 100KB and filesize < 5MB
uint32(0x3c) > 0 and uint32(uint32(0x3c)) == 0x4550 // valid PE
// "for" loops over offsets / sections
for any i in (0..pe.number_of_sections - 1):
(pe.sections[i].name == ".text" and pe.sections[i].entropy > 7.0)
// "of"
1 of them // any one string
all of ($a*) // all $a*-prefix strings
3 of ($s1, $s2, $s3, $s4, $s5) // at least 3 of 5
// Hash module
hash.sha256(0, filesize) == "..." // exact-match rule
hash.imphash() == "..." // PE import hash (fragile but high-signal)
High-leverage patterns
Family-stable byte patterns
Look for unique byte sequences that survive obfuscation:
- Crypto constants (SHA-256 IVs, AES sbox, RC4 init pattern)
- Hard-coded SID strings
- C2 packet headers (magic bytes, fixed offsets)
- Reflective loader entry stub bytes (Donut, Cobalt Strike's PE loader)
Capability rules
Don't fingerprint a sample — fingerprint a TECHNIQUE:
rule Suspicious_ProcessInjection {
meta: description = "VirtualAlloc + WriteProcessMemory + CreateRemoteThread = injection"
condition:
pe.imports("kernel32.dll", "VirtualAllocEx") and
pe.imports("kernel32.dll", "WriteProcessMemory") and
pe.imports("kernel32.dll", "CreateRemoteThread")
}
This catches every injector regardless of family. False-positive: legitimate tools (Procmon, IDA, debuggers). Reduce via additional conditions (unsigned, in temp dir, etc.).
Anti-analysis fingerprinting
rule AntiVm_VMware_Strings {
strings:
$s1 = "VMware" ascii nocase
$s2 = "VBoxService" ascii nocase
$s3 = "qemu" ascii nocase
$s4 = { 56 4D 58 68 } // "VMXh" — VMware backdoor port magic
condition: 2 of them
}
Hunting at scale
VirusTotal Retrohunt (paid)
// Upload rule to VT — runs against the past 90 days of submissions
// Outputs new hashes matching the signature
MalwareBazaar (free)
# yarafs.io / abuse.ch — runs YARA against MB corpus
curl https://mb-api.abuse.ch/api/v1/ -X POST -d 'query=get_yara&yara_rule=YourRule'
Local corpus scan
# Recursive scan
yara -r rules/ /samples/
# JSON output for downstream processing
yara -r rules/ /samples/ -m -p 4 # -m: metadata, -p: parallel threads
# Fast pre-filter with capa first
capa /samples/sample.exe # extracts capabilities; rule-driven, JSON-output
Common pitfalls
| Pitfall | Fix |
|---|---|
| Too-short strings (4 bytes) → false positives | Use 8+ byte strings; require multiple matches |
Regex /pattern/ with [, ?, * → slow |
Prefer literal strings; if regex needed, anchor with ^/\b |
| No filesize bound → scans 5GB files | Always include filesize < N |
Multiple wildcards in one hex ?? → exponential matcher cost |
Limit to 2-3 wildcards per byte string |
condition: any of them with one common string → constant FPs |
Use 2 of them minimum |
| Rule name with version | Use a separate meta.version so |
Câu hỏi thường gặp
YARA là gì?
YARA là ngôn ngữ so khớp mẫu dùng để mô tả và phát hiện file mã độc.
Làm sao để tránh báo động giả?
Skill khuyên dùng các chuỗi cụ thể và kiểm tra luật trước khi tin cậy vào nó.
Mẫu được tìm ở đâu?
Skill nhắc đến các dịch vụ mẫu mã độc công khai như VirusTotal và MalwareBazaar.
Chi tiết
Mô tả gốc của tác giả
YARA rule authoring + hunting — `condition:` syntax, hex patterns with wildcards, `for`/`any of them`, PE module, ELF module, hash module, math module. Build per-family signatures, hunt at scale via VT/MalwareBazaar/Hybrid Analysis. Avoid common pitfalls (collisions, slow rules, regex traps).
Độ phổ biến
- Sao GitHub
- 6.5k
- Vị trí xếp hạng
- #14180
- Giấy phép
- Apache-2.0
- Cập nhật
- 1/11/2026
Bình luận
- …
Thêm skill từ kho mã này
detector-overview
6.5kGiúp agent của bạn đọc code mà một công cụ quét đã đánh dấu, rồi quyết định điểm nào là lỗ hổng bảo mật thật và điểm nào là báo động giả.
exploiter-overview
6.5kGiúp agent của bạn ghép nhiều lỗ hổng bảo mật đã xác nhận thành một chuỗi kiểm thử và kiểm tra chuỗi đó có thể gây hậu quả đến đâu.
llm-redteam-overview
6.5kGiúp agent của bạn tìm đúng hướng dẫn red-team AI cho một bài kiểm thử, bao quát 15 nhóm chiến thuật từ prompt injection đến lạm dụng mô hình.
aatmf-t01-prompt-injection
6.5kGiải thích prompt injection, khi các chỉ dẫn ẩn cố ghi đè một hệ thống AI, để chuyên gia bảo mật có thể kiểm tra lỗi này.
Skill tương tự
reverse-engineer-anything
422kGiúp agent của bạn xem bên trong các app và package đã phát hành để giải thích tính năng, so sánh phiên bản hoặc hướng dẫn dựng lại bằng công cụ REA.
1password
394kGiúp agent của bạn cài đặt CLI của 1Password, đăng nhập, và đọc hoặc đưa thông tin bí mật vào mà không in giá trị ra cuộc trò chuyện.
healthcheck
394kGiúp agent của bạn rà soát bảo mật máy tính hoặc máy chủ đang chạy OpenClaw, như SSH, tường lửa, cập nhật và sao lưu, rồi đề xuất cách sửa an toàn.