YARA 规則

按使用者提供的 YARA 规則扫描輸入位元組,返回匹配結果而非最終恶意性結论。

輸入: 文本 (UTF-8) / 檔案結果: 文本

文本輸入

工具選項

範例

Match a known marker in record 1

輸入

release=2.1.0

Expected checks

Case-insensitive
Contains "public_record_1"
规則
rule public_record_1 { strings: $marker = "release=2.1.0" condition: $marker }
顯示字串
Off
顯示字串長度
Off
顯示中繼資料
Off
顯示計數
On
顯示规則警告
On
顯示控制台模塊消息
On
Match a known marker in record 2

輸入

owner=Ada
count=3

Expected checks

Case-insensitive
Contains "public_record_2"
规則
rule public_record_2 { strings: $marker = "owner=Ada" condition: $marker }
顯示字串
Off
顯示字串長度
Off
顯示中繼資料
Off
顯示計數
On
顯示规則警告
On
顯示控制台模塊消息
On
Match a known marker in record 3

輸入

sensor=west
celsius=-12

Expected checks

Case-insensitive
Contains "public_record_3"
规則
rule public_record_3 { strings: $marker = "sensor=west" condition: $marker }
顯示字串
Off
顯示字串長度
Off
顯示中繼資料
Off
顯示計數
On
顯示规則警告
On
顯示控制台模塊消息
On
Match a known marker in record 4

輸入

Hello, archive!

Expected checks

Case-insensitive
Contains "public_record_4"
规則
rule public_record_4 { strings: $marker = "Hello, archive!" condition: $marker }
顯示字串
Off
顯示字串長度
Off
顯示中繼資料
Off
顯示計數
On
顯示规則警告
On
顯示控制台模塊消息
On
Match a known marker in record 5

輸入

The Times 03/Jan/2009

Expected checks

Case-insensitive
Contains "public_record_5"
规則
rule public_record_5 { strings: $marker = "The Times 03/Jan/2009" condition: $marker }
顯示字串
Off
顯示字串長度
Off
顯示中繼資料
Off
顯示計數
On
顯示规則警告
On
顯示控制台模塊消息
On
YARA Match: compile warnings

輸入

CyberChef Yara

Expected answer

Warning on line 5: string "$s" may slow down scanning
Warning on line 12: string "$s" may slow down scanning
Input matches rule "a".
Input matches rule "b".
规則
import "console" rule a { strings: $s=" " condition: $s and console.log("log rule a") } rule b { strings: $s=" " condition: $s and console.hex("log rule b: int8(0)=", int8(0)) }
顯示字串
Off
顯示字串長度
Off
顯示中繼資料
Off
顯示計數
Off
顯示规則警告
On
顯示控制台模塊消息
Off
YARA Match: console messages

輸入

CyberChef Yara

Expected answer

log rule a
log rule b: int8(0)=0x43
Input matches rule "a".
Input matches rule "b".
规則
import "console" rule a { strings: $s=" " condition: $s and console.log("log rule a") } rule b { strings: $s=" " condition: $s and console.hex("log rule b: int8(0)=", int8(0)) }
顯示字串
Off
顯示字串長度
Off
顯示中繼資料
Off
顯示計數
Off
顯示规則警告
Off
顯示控制台模塊消息
On
YARA Match: hashing rules

輸入

Hello World!

Expected answer

Input matches rule "HelloWorldMD5".
Input matches rule "HelloWorldSHA256".
规則
import "hash" rule HelloWorldMD5 { condition: hash.md5(0,filesize) == "ed076287532e86365e841e92bfc50d8c" } rule HelloWorldSHA256 { condition: hash.sha256(0,filesize) == "7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069" }
顯示字串
On
顯示字串長度
On
顯示中繼資料
On
顯示計數
On
顯示规則警告
Off
顯示控制台模塊消息
Off
YARA Match: simple foobar

輸入

foobar foobar bar foo foobar

Expected answer

Rule "foo" matches (4 times):
Pos 0, length 3, identifier $re1, data: "foo"
Pos 7, length 3, identifier $re1, data: "foo"
Pos 18, length 3, identifier $re1, data: "foo"
Pos 22, length 3, identifier $re1, data: "foo"
Rule "bar" matches (4 times):
Pos 3, length 3, identifier $re1, data: "bar"
Pos 10, length 3, identifier $re1, data: "bar"
Pos 14, length 3, identifier $re1, data: "bar"
Pos 25, length 3, identifier $re1, data: "bar"
规則
rule foo {strings: $re1 = /foo/ condition: $re1} rule bar {strings: $re1 = /bar/ condition: $re1}
顯示字串
On
顯示字串長度
On
顯示中繼資料
On
顯示計數
On
顯示规則警告
On
顯示控制台模塊消息
On

参數

参數默認值輸入與選項
规則""文本
顯示字串false開啟或关閉
顯示字串長度false開啟或关閉
顯示中繼資料false開啟或关閉
顯示計數true開啟或关閉
顯示规則警告true開啟或关閉
顯示控制台模塊消息true開啟或关閉

相关工具

鑑識分析

操作参考

查看原始技术文檔 (English)