-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new: [YARA] Integration of YARA. Closes #1.
- Loading branch information
1 parent
d8f6107
commit e12f54e
Showing
7 changed files
with
70 additions
and
7 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,33 @@ | ||
#! /usr/bin/env python | ||
|
||
import pprint | ||
|
||
import yara | ||
|
||
import conf | ||
from pyhids import utils | ||
|
||
|
||
def main(): | ||
pp = pprint.PrettyPrinter(indent=4) | ||
try: | ||
rules = yara.compile(conf.YARA_RULES) | ||
except Exception as e: | ||
print("Problem when compiling the YARA rules.") | ||
print(e) | ||
exit(1) | ||
result = {} | ||
base = utils.load_base() | ||
for (path, _sha1) in list(base["files"].items()): | ||
try: | ||
matches = rules.match(path, timeout=60) | ||
except Exception: | ||
continue | ||
if matches: | ||
result[path] = matches | ||
if result: | ||
pp.pprint(result) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "pyHIDS" | ||
version = "0.7.1" | ||
version = "0.8.0" | ||
description = "A host-based intrusion detection system." | ||
authors = ["Cédric Bonhomme <[email protected]>"] | ||
license = "GPL-3.0-or-later" | ||
|
@@ -39,6 +39,7 @@ rsa = "^4.9" | |
pyhashlookup = "^1.2.1" | ||
pypandora = "^1.5.0" | ||
pymisp = "^2.4.176" | ||
yara-python = "^4.3.1" | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
flake8 = "^6.0.0" | ||
|