-
Notifications
You must be signed in to change notification settings - Fork 502
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bugfix: yara_lint() should remove invalid imports from yara rules. (#…
- Loading branch information
Showing
9 changed files
with
72 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Parameters: | ||
YaraRules: | | ||
import "pe" | ||
/* We dont support import "hash" so this import should be removed. */ | ||
import "hash" | ||
rule Hive { | ||
condition: pe.imphash() == "f34d5f2d4577ed6d9ceec516c1f5a744" | ||
} | ||
rule BadRule { | ||
condition: hash.sha256(0, filesize) == "ab05" | ||
} | ||
Queries: | ||
- LET Cleaned <= yara_lint(clean=TRUE, rules=YaraRules) | ||
- SELECT Cleaned FROM scope() | ||
- SELECT * FROM yara(rules=Cleaned, accessor="data", files="Hello") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
LET Cleaned <= yara_lint(clean=TRUE, rules=YaraRules)[]SELECT Cleaned FROM scope()[ | ||
{ | ||
"Cleaned": "import \"pe\"\n\nrule Hive {\n condition:\n pe.imphash() == \"f34d5f2d4577ed6d9ceec516c1f5a744\"\n}\n" | ||
} | ||
]SELECT * FROM yara(rules=Cleaned, accessor="data", files="Hello")[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters