mvt/tests/ios/test_manifest.py

27 lines
864 B
Python
Raw Normal View History

2021-12-16 11:50:12 +00:00
import logging
from mvt.common.indicators import Indicators
2021-12-16 11:50:12 +00:00
from mvt.ios.modules.backup.manifest import Manifest
from mvt.common.module import run_module
2022-01-07 16:51:21 +00:00
from ..utils import get_backup_folder
2021-12-16 11:50:12 +00:00
2022-01-07 16:51:21 +00:00
class TestManifestModule:
2021-12-16 11:50:12 +00:00
def test_manifest(self):
m = Manifest(base_folder=get_backup_folder(), log=logging, results=[])
2021-12-16 11:50:12 +00:00
run_module(m)
assert len(m.results) == 3721
assert len(m.timeline) == 5881
assert len(m.detected) == 0
2022-01-07 16:51:21 +00:00
def test_detection(self, indicator_file):
m = Manifest(base_folder=get_backup_folder(), log=logging, results=[])
2021-12-16 11:50:12 +00:00
ind = Indicators(log=logging)
2022-01-07 16:51:21 +00:00
ind.parse_stix2(indicator_file)
2021-12-16 11:50:12 +00:00
# Adds a file that exists in the manifest
ind.ioc_files[0] = "com.apple.CoreBrightness.plist"
m.indicators = ind
run_module(m)
assert len(m.detected) == 1