rule R1
{
strings:
$a = "Kim Jun
Hyeon"
$b = "Hello
World"
$c =
"Nobreak"
condition:
2 of ($a, $b, $c)
}
# $a, $b, $c 가운데 2개가 만족할 때
=====================================
# python 코드
import yara as y
import pprint as ppr
t = y.compile("YARA_RUL_01")
s = t.match("t")
ppr.pprint (s)
=====================================
# 결과
{'main': [{'matches': True,
'meta': {},
'rule': 'R1',
'strings': [{'data': 'Hello World',
'flags': 19,
'identifier': '$b',
'offset': 15},
{'data': 'Kim Jun Hyeon',
'flags': 19,
'identifier': '$a',
'offset': 0}],
'tags': []}]}
'언어 > python' 카테고리의 다른 글
블록체인 코드 (0) | 2018.03.13 |
---|---|
파일 타입 확인 _ 테스트 _CentOS7 (0) | 2018.03.04 |
turtle - 사사분면 (0) | 2018.03.03 |
turtle _ my name (0) | 2018.03.02 |
utrtle heart (0) | 2018.02.22 |