
Fnord هي أداة استخراج أنماط للكود المُشوَّه
لدى Fnord وظيفتان رئيسيتان:
يقوم Fnord بمعالجة الملف باستخدام نافذة منزلقة بأحجام متفاوتة لاستخراج جميع التسلسلات ذات الطول الأدنى -m X (الافتراضي: 4) حتى الحد الأقصى -x X (الافتراضي: 40). لكل طول، سيعرض Fnord التسلسلات الأكثر تكرارًا -t X (الافتراضي: 3) في جدول.
يحتوي كل سطر في الجدول على:
يقوم Fnord أيضًا بإنشاء قاعدة YARA تجريبية. أثناء إنشاء قاعدة YARA، سيحسب درجة بناءً على طول التسلسل وعدد مرات الظهور (الطول * مرات الظهور). ثم سيعالج كل تسلسل عن طريق إزالة جميع الأحرف غير الحرفية ومقارنتها مع قائمة من الكلمات المفتاحية (غير حساسة لحالة الأحرف) لاكتشاف التسلسلات الأكثر إثارة للاهتمام من غيرها. قبل كتابة كل سلسلة في القاعدة، يحسب Fnord مسافة ليفنشتاين ويتخطى التسلسلات المشابهة جدًا للتسلسلات التي تم دمجها بالفعل في القاعدة.
[تجريبي] تم إنشاء Fnord قبل بضعة أيام وقمت باختباره مع مجموعة صغيرة من العينات. أعتقد أنني سأقوم بتعديل الإعدادات الافتراضية في الأسابيع القادمة وإضافة بعض الكلمات المفتاحية والمرشحات وخيارات التسجيل.
إذا وجدت كودًا مشوهًا في عينة، فاستخدم محررًا سداسيًا لاستخراج الجزء المشوه من العينة واحفظه في ملف جديد. استخدم هذا الملف الجديد للتحليل.
العب مع العلامات -s و -k و -r و --yara-strings و -m و -e.
يرجى إرسال عينات تنتج قواعد YARA ضعيفة يمكن تحسينها.
____ __
/ __/__ ___ _______/ /
/ _// _ \/ _ \/ __/ _ /
/_/ /_//_/\___/_/ \_,_/ Pattern Extractor for Obfuscated Code
v0.7, Florian Roth
usage: fnord.py [-h] [-f file] [-m min] [-x max] [-t top] [-n min-occ]
[-e min-entropy] [--strings] [--include-padding] [--debug]
[--noyara] [-s similarity] [-k keywords-multiplier]
[-r structure-multiplier] [-c count-limiter] [--yara-exact]
[--yara-strings max] [--show-score] [--show-count]
[--author author]
Fnord - Pattern Extractor for Obfuscated Code
optional arguments:
-h, --help show this help message and exit
-f file File to process
-m min Minimum sequence length
-x max Maximum sequence length
-t top Number of items in the Top x list
-n min-occ Minimum number of occurrences to show
-e min-entropy Minimum entropy
--strings Show strings only
--include-padding Include 0x00 and 0x20 in the extracted strings
--debug Debug output
YARA Rule Creation:
--noyara Do not generate an experimental YARA rule
-s similarity Allowed similarity (use values between 0.1=low and
10=high, default=1.5)
-k keywords-multiplier
Keywords multiplier (multiplies score of sequences if
keyword is found) (best use values between 1 and 5,
default=2.0)
-r structure-multiplier
Structure multiplier (multiplies score of sequences if
it is identified as code structure and not payload)
(best use values between 1 and 5, default=2.0)
-c count-limiter Count limiter (limts the impact of the count by
capping it at a certain amount) (best use values
between 5 and 100, default=20)
--yara-exact Add magic header and magic footer limitations to the
rule
--yara-strings max Maximum sequence length
--show-score Show score in comments of YARA rules
--show-count Show count in sample in comments of YARA rules
--author author YARA rule author
git clone https://github.com/Neo23x0/Fnord.git و cd Fnordpip3 install -r ./requirements.txtpython3 ./fnord.py --helppython3 fnord.py -f ./test/wraeop.sct --yara-strings 10
python3 fnord.py -f ./test/vbs.txt --show-score --show-count -t 1 -x 20
python3 fnord.py -f ./test/inv-obf.txt --show-score --show-count -t 1 --yara-strings 4 --yara-exact



يحتوي المجلد ./test على نصوص برمجية ضارة وقد يتم اكتشافها بواسطة برنامج مكافحة الفيروسات المحلي. لن تضر بنظامك طالما لم تقم بتشغيلها.
يستخدم yarGen نهج القائمة البيضاء لتصفية السلاسل الأفضل لإنشاء قاعدة YARA. يطبق yarGen بعض التعبيرات العادية لضبط درجات السلاسل قبل إنشاء قواعد YARA. لكن نهجه مختلف تمامًا عن الطريقة التي تستخدمها Fnord، التي تحسب درجة التسلسلات البايتية بناءً على الإحصائيات.
بينما yarGen هو الأفضل للكود غير المشوّه، فإن Fnord مخصص للكود المشوّه فقط ويجب أن ينتج نتائج أفضل بكثير من yarGen.
تابعني على تويتر للحصول على التحديثات @cyb3rops