2022-08-23 11:18:05 +00:00
|
|
|
# Mobile Verification Toolkit (MVT)
|
2023-02-08 19:18:16 +00:00
|
|
|
# Copyright (c) 2021-2023 Claudio Guarnieri.
|
2022-08-23 11:18:05 +00:00
|
|
|
# Use of this software is governed by the MVT License 1.1 that can be found at
|
|
|
|
# https://license.mvt.re/1.1/
|
|
|
|
|
|
|
|
import logging
|
|
|
|
|
|
|
|
from mvt.common.indicators import Indicators
|
|
|
|
from mvt.common.module import run_module
|
|
|
|
from mvt.ios.modules.fs.filesystem import Filesystem
|
|
|
|
|
|
|
|
from ..utils import get_ios_backup_folder
|
|
|
|
|
|
|
|
|
|
|
|
class TestFilesystem:
|
|
|
|
def test_filesystem(self):
|
|
|
|
m = Filesystem(target_path=get_ios_backup_folder())
|
|
|
|
run_module(m)
|
2023-04-12 08:21:17 +00:00
|
|
|
assert len(m.results) == 14
|
|
|
|
assert len(m.timeline) == 14
|
2022-08-23 11:18:05 +00:00
|
|
|
assert len(m.detected) == 0
|
|
|
|
|
|
|
|
def test_detection(self, indicator_file):
|
|
|
|
m = Filesystem(target_path=get_ios_backup_folder())
|
|
|
|
ind = Indicators(log=logging.getLogger())
|
|
|
|
ind.parse_stix2(indicator_file)
|
|
|
|
# Adds a filename that exist in the folder
|
2023-06-01 21:40:26 +00:00
|
|
|
ind.ioc_collections[0]["processes"].append(
|
|
|
|
"64d0019cb3d46bfc8cce545a8ba54b93e7ea9347"
|
|
|
|
)
|
2022-08-23 11:18:05 +00:00
|
|
|
m.indicators = ind
|
|
|
|
run_module(m)
|
2023-04-12 08:21:17 +00:00
|
|
|
assert len(m.results) == 14
|
|
|
|
assert len(m.timeline) == 14
|
2022-08-23 11:18:05 +00:00
|
|
|
assert len(m.detected) == 1
|