We have two folders called:
- yararules: here we put our custom yara rules
- yararules.test: here we put the test cases for the
yararules
custom yaras
For each .yar
file inside the yararules
folder, we should create a folder with the same name as the yara file inside the yararules.test/testcases
folder.
- If the test case file starts with
ok-*
it means that the file should not match the yara file. - If the test case file starts with
vuln-*
it means that the file should be known vulnerable by the yara rule.
- Run
prerequesties.ps1
to install YARA binaries (yara64
andyarac64
) in case you haven't them installed. - Run
run-tests.ps1
to run all the tests.
yararules/my-rule.yar
yararules.test/testcases/my-rule.yar/ok-test.jpg
yararules.test/testcases/my-rule.yar/vuln-test-pdf.pdf