
अस्पष्ट कोड के लिए पैटर्न निकालने वाला
Fnord अस्पष्ट कोड के लिए एक पैटर्न निष्कर्षक है
Fnord के दो मुख्य कार्य हैं:
Fnord फ़ाइल को विभिन्न आकारों की एक स्लाइडिंग विंडो के साथ संसाधित करता है ताकि न्यूनतम लंबाई -m X (डिफ़ॉल्ट: 4) से अधिकतम लंबाई -x X (डिफ़ॉल्ट: 40) तक सभी अनुक्रम निकाले जा सकें। प्रत्येक लंबाई के लिए, Fnord सबसे अधिक बार आने वाले अनुक्रमों -t X (डिफ़ॉल्ट: 3) को एक तालिका में प्रस्तुत करेगा।
तालिका की प्रत्येक पंक्ति में शामिल है:
Fnord एक प्रायोगिक YARA नियम भी उत्पन्न करता है। YARA नियम निर्माण के दौरान यह अनुक्रम की लंबाई और घटनाओं की संख्या (लंबाई * घटनाएँ) के आधार पर एक स्कोर की गणना करेगा। फिर यह प्रत्येक अनुक्रम को सभी गैर-अक्षर वर्णों को हटाकर और एक कीवर्ड सूची (केस-असंवेदनशील) से तुलना करके संसाधित करेगा, ताकि उन अनुक्रमों का पता लगाया जा सके जो दूसरों की तुलना में अधिक दिलचस्प हैं। नियम में प्रत्येक स्ट्रिंग लिखने से पहले Fnord एक Levenshtein दूरी की गणना करता है और उन अनुक्रमों को छोड़ देता है जो पहले से नियम में एकीकृत अनुक्रमों के समान हैं।
[प्रायोगिक] 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 की तुलना में बहुत बेहतर परिणाम देना चाहिए।
अपडेट के लिए मुझे Twitter पर फ़ॉलो करें @cyb3rops