- Machine Learning for Cybersecurity Cookbook
- Emmanuel Tsukerman
- 178字
- 2021-06-24 12:29:02
YARA
YARA is a computer language that allows a security expert to conveniently specify a rule that will then be used to classify all samples matching the rule. A minimal rule consists of a name and a condition, for example, the following:
rule my_rule_name { condition: false }
This rule will not match any file. Conversely, the following rule will match every sample:
Rule my_rule_name { condition: true }
A more useful example will match any file over 100 KB:
Rule over_100kb { condition: filesize > 100KB }
Another example is checking whether a particular file is a PDF. To do so, we check if the magic numbers of the file correspond to the PDF. Magic numbers are a sequence of several bytes that occurs at the beginning of a file and indicates the type of file it is. In the case of a PDF, the sequence is 25 50 44 46:
rule is_a_pdf {
strings:
$pdf_magic = {25 50 44 46}
condition:
$pdf_magic at 0
}
Now, let's see how to run our rules against files.
推薦閱讀
- Hands-On Intelligent Agents with OpenAI Gym
- Big Data Analytics with Hadoop 3
- Dreamweaver CS3+Flash CS3+Fireworks CS3創(chuàng)意網(wǎng)站構(gòu)建實(shí)例詳解
- 軟件架構(gòu)設(shè)計(jì)
- Hands-On Neural Networks with Keras
- MCSA Windows Server 2016 Certification Guide:Exam 70-741
- Cloudera Administration Handbook
- Blender 3D Printing by Example
- Windows Server 2008 R2活動(dòng)目錄內(nèi)幕
- 網(wǎng)絡(luò)存儲(chǔ)·數(shù)據(jù)備份與還原
- 大數(shù)據(jù)案例精析
- ZigBee無線通信技術(shù)應(yīng)用開發(fā)
- 人工智能云平臺(tái):原理、設(shè)計(jì)與應(yīng)用
- 人工智能基礎(chǔ)
- 中老年人學(xué)數(shù)碼照片后期處理