We have two folders called:
- yararules: here we put our custom yara rules
- yararules.test: here we put the test cases for the
yararulescustom 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.ps1to install YARA binaries (yara64andyarac64) in case you haven't them installed. - Run
run-tests.ps1to run all the tests.
yararules/my-rule.yaryararules.test/testcases/my-rule.yar/ok-test.jpgyararules.test/testcases/my-rule.yar/vuln-test-pdf.pdf