官术网_书友最值得收藏!

How to do it…

In the following steps, we show you how to create YARA rules and test them against a file:

  1.  Copy your rules, as seen here, into a text file and name it rules.yara:
 rule is_a_pdf
{
strings:
$pdf_magic = {25 50 44 46}
condition:
$pdf_magic at 0
}

rule dummy_rule1
{
condition:
false
}

rule dummy_rule2
{
condition:
true
}
  1.  Next, select a file you would like to check your rules against. Call it target_file. In a terminal, execute Yara rules.yara target_file as follows:
Yara rule.yara PythonBrochure

The result should be as follows:

is_a_pdf target_file
dummy_rule2 target_rule
主站蜘蛛池模板: 阿勒泰市| 宁夏| 澎湖县| 汤阴县| 太仆寺旗| 云浮市| 昭通市| 凉山| 宁夏| 岐山县| 梅河口市| 遂平县| 永川市| 潮州市| 鲁山县| 封开县| 剑河县| 潼南县| 南溪县| 连州市| 万盛区| 绥宁县| 天长市| 佛学| 喀什市| 永善县| 建阳市| 怀来县| 含山县| 舟曲县| 大悟县| 缙云县| 临潭县| 濉溪县| 宜昌市| 英吉沙县| 桐城市| 筠连县| 涞源县| 原阳县| 长寿区|