mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-10 08:38:28 +00:00
fix: [Yara Tracker] catch yara timeout
This commit is contained in:
parent
5cc4da2a28
commit
d1b4d61ce5
1 changed files with 6 additions and 4 deletions
|
@ -71,10 +71,12 @@ if __name__ == "__main__":
|
||||||
item_id = p.get_from_set()
|
item_id = p.get_from_set()
|
||||||
if item_id is not None:
|
if item_id is not None:
|
||||||
item_content = item_basic.get_item_content(item_id)
|
item_content = item_basic.get_item_content(item_id)
|
||||||
yara_match = rules.match(data=item_content, callback=yara_rules_match, which_callbacks=yara.CALLBACK_MATCHES, timeout=60)
|
try:
|
||||||
if yara_match:
|
yara_match = rules.match(data=item_content, callback=yara_rules_match, which_callbacks=yara.CALLBACK_MATCHES, timeout=60)
|
||||||
print(f'{item_id}: {yara_match}')
|
if yara_match:
|
||||||
|
print(f'{item_id}: {yara_match}')
|
||||||
|
except yara.TimeoutError as e:
|
||||||
|
print(f'{item_id}: yara scanning timed out')
|
||||||
else:
|
else:
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue