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

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
主站蜘蛛池模板: 夹江县| 泰宁县| 合山市| 达日县| 清镇市| 濮阳市| 东城区| 蕲春县| 岐山县| 淮阳县| 永和县| 万年县| 德钦县| 屯留县| 新郑市| 盐亭县| 镇安县| 漾濞| 庆安县| 即墨市| 广水市| 海晏县| 武功县| 镇安县| 库尔勒市| 阿尔山市| 巴彦县| 白山市| 辽阳市| 乡宁县| 合阳县| 商城县| 邹平县| 青州市| 武清区| 林芝县| 舒兰市| 景洪市| 宁阳县| 达拉特旗| 德格县|