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

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
主站蜘蛛池模板: 江油市| 长寿区| 桑日县| 金乡县| 罗平县| 民勤县| 和林格尔县| 米脂县| 子洲县| 都匀市| 交城县| 曲松县| 衡山县| 祁门县| 平阴县| 方正县| 正蓝旗| 资中县| 郧西县| 休宁县| 会理县| 钟祥市| 舞钢市| 库伦旗| 宿松县| 奉节县| 怀来县| 宁波市| 海林市| 元阳县| 丰县| 德安县| 黎平县| 海宁市| 荃湾区| 绥中县| 永顺县| 南宫市| 来凤县| 惠州市| 巧家县|