مؤشرات الاختراق وقواعد YARA
حوّل نتائج تحليل البرمجيات الخبيثة إلى آليات كشف قابلة لإعادة الاستخدام: استخرج مؤشرات الاختراق واكتب قواعد YARA للتعرف على العينات المرتبطة.
مؤشرات الاختراق وقواعد YARA درس مجاني في Reverse Engineering & Binary Analysis Basics على CoddyKit. هذا هو الدرس 4 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Reverse Engineering & Binary Analysis Basics، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Reverse Engineering & Binary Analysis Basics 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
From Analysis to Detection
You can classify malware types, perform basic behavioral analysis, and unpack samples. The payoff is detection: converting what you learned into signals that catch the same threat elsewhere.
What Is an IOC?
An Indicator of Compromise (IOC) is an observable artifact that suggests an intrusion.
- File hashes (MD5, SHA-256)
- Domains and IP addresses
- Registry keys, mutexes, file paths
Hashes: Precise but Brittle
A SHA-256 hash uniquely fingerprints one file. But changing a single byte changes the hash, so attackers evade hash-only detection easily.
That is why we need more resilient indicators.
sha256sum sample.exe
# 9f86d0818... sample.exeFuzzy and Behavioral IOCs
More robust indicators survive minor changes:
- A unique mutex name the malware creates
- A hardcoded user-agent string
- A characteristic command-and-control URL pattern
These catch whole families, not just one sample.
Introducing YARA
YARA is a pattern-matching tool that describes malware via rules. Each rule has metadata, strings, and a condition.
YARA scans files or memory and reports matches, making your findings reusable.
Anatomy of a YARA Rule
A rule has three sections: meta for documentation, strings for patterns, and condition for the matching logic.
rule Example_Trojan {
meta:
author = 'analyst'
desc = 'Detects sample family X'
strings:
$a = 'evil-c2.example.com'
$b = { 6A 40 68 00 30 00 00 }
condition:
$a or $b
}Text vs Hex Strings
YARA matches both text strings (with modifiers like nocase, wide) and hex byte sequences.
Hex patterns with wildcards (??) catch code that varies slightly.
strings:
$ua = 'Mozilla/4.0 (compatible; Evil)' wide nocase
$stub = { E8 ?? ?? ?? ?? 83 C4 04 }Writing Good Conditions
Conditions combine strings with logic and counts.
all of themrequires every string2 of ($a, $b, $c)needs at least two- Add
filesizeor PE checks to reduce false positives
condition:
uint16(0) == 0x5A4D and 2 of ($s*)Avoiding False Positives
A rule that matches common library strings will fire on innocent files. Choose strings that are unique to the malware, and test against a clean goodware set.
Tight conditions keep analysts trusting your rules.
Sharing Detection
IOCs and YARA rules are shareable threat intelligence. Distribute them via formats like STIX or simple rule files so other defenders benefit.
This is how one analysis protects an entire community.
yara -r my_rules.yar /samples/Hunting with Rules
Beyond scanning one file, you can sweep a whole estate. Recursively scan endpoints or even live memory to find every machine matching the family.
This turns a single analysis into proactive threat hunting.
yara -r -p 8 trojan.yar /mnt/hosts/ > hits.txtQuick Check
Why is a SHA-256 hash a brittle indicator of compromise on its own?
Recap
You now operationalize malware analysis:
- Extract IOCs: hashes, domains, mutexes, behaviors
- Prefer resilient indicators over brittle hashes
- Write YARA rules with meta, strings, and tight conditions
- Test against goodware and share as threat intel
الأسئلة الشائعة
هل درس «مؤشرات الاختراق وقواعد YARA» مجاني؟
نعم — نص درس «مؤشرات الاختراق وقواعد YARA» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Reverse Engineering & Binary Analysis Basics، انتقل إلى CoddyKit PRO. تتضمن دورة Reverse Engineering & Binary Analysis Basics 4 دروس في المجموع.
ماذا ستتعلم في «مؤشرات الاختراق وقواعد YARA»؟
حوّل نتائج تحليل البرمجيات الخبيثة إلى آليات كشف قابلة لإعادة الاستخدام: استخرج مؤشرات الاختراق واكتب قواعد YARA للتعرف على العينات المرتبطة. تتمرن على Reverse Engineering & Binary Analysis Basics مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ Reverse Engineering & Binary Analysis Basics؟
لا تُشترط خبرة سابقة. Reverse Engineering & Binary Analysis Basics على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 4 من أصل 4.
كم من الوقت يستغرق درس «مؤشرات الاختراق وقواعد YARA»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس Reverse Engineering & Binary Analysis Basics هذا؟
نعم. كل درس في Reverse Engineering & Binary Analysis Basics يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- أنواع البرمجيات الخبيثة وسلوكها
- التحليل السلوكي الأساسي
- مقدمة إلى فك تغليف البرمجيات الخبيثة
- مؤشرات الاختراق وقواعد YARA