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

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
主站蜘蛛池模板: 巢湖市| 建平县| 迁西县| 贵阳市| 新宾| 磐石市| 突泉县| 昂仁县| 安陆市| 松溪县| 镇宁| 黄大仙区| 长宁区| 黄陵县| 扎赉特旗| 花莲市| 当阳市| 黎城县| 新津县| 苏尼特右旗| 化隆| 宜阳县| 孝昌县| 蒲城县| 鄂托克前旗| 色达县| 民勤县| 太和县| 黄梅县| 宜黄县| 大冶市| 黔江区| 富蕴县| 密山市| 繁昌县| 南靖县| 枣庄市| 行唐县| 凉山| 永平县| 青海省|