summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjvoisin2020-05-26 19:37:26 +0200
committerjvoisin2020-05-26 19:37:26 +0200
commitd3c62c55584e04fcc4b5f54497d378a6db911686 (patch)
treeff12703c57cd603524e6e4d36c69e4651c530213
parent08214fc5242df1616355c8bdb16ab367be970f42 (diff)
Add a safeguard against corrupted rules
-rwxr-xr-xphp-malware-finder/utils/generate_whitelist.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/php-malware-finder/utils/generate_whitelist.py b/php-malware-finder/utils/generate_whitelist.py
index 9dd8818..94024df 100755
--- a/php-malware-finder/utils/generate_whitelist.py
+++ b/php-malware-finder/utils/generate_whitelist.py
@@ -19,7 +19,11 @@ if not os.path.isdir(sys.argv[2]):
19 print('%s is not a folder !' % sys.argv[2]) 19 print('%s is not a folder !' % sys.argv[2])
20 sys.exit(1) 20 sys.exit(1)
21 21
22rules = yara.compile(sys.path[0]+'/../php.yar', includes=True, error_on_warning=False) 22try:
23 rules = yara.compile(sys.path[0]+'/../php.yar', includes=True, error_on_warning=False)
24except yara.SyntaxError as e:
25 print("Can't compile rules: %s" % e)
26 sys.exit(1)
23 27
24output_list = list() 28output_list = list()
25 29