mirror of
https://github.com/mvt-project/mvt.git
synced 2026-02-12 16:42:45 +00:00
First structure for mvt-ios check-usb
This commit is contained in:
0
tests/ios_usb/__init__.py
Normal file
0
tests/ios_usb/__init__.py
Normal file
31
tests/ios_usb/test_processes.py
Normal file
31
tests/ios_usb/test_processes.py
Normal file
@@ -0,0 +1,31 @@
|
||||
# Mobile Verification Toolkit (MVT)
|
||||
# Copyright (c) 2021-2022 Claudio Guarnieri.
|
||||
# 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.module import run_module
|
||||
from mvt.ios.modules.usb.processes import Processes
|
||||
from mvt.common.indicators import Indicators
|
||||
|
||||
|
||||
class TestUSBProcesses:
|
||||
def test_run(self, mocker, indicator_file):
|
||||
# Mock
|
||||
mocker.patch("pymobiledevice3.services.base_service.BaseService.__init__")
|
||||
mocker.patch(
|
||||
"pymobiledevice3.services.os_trace.OsTraceService.get_pid_list",
|
||||
return_value={"Payload": {"1": {"ProcessName": "storebookkeeperd"}, "1854": {"ProcessName": "cfprefssd"}}}
|
||||
)
|
||||
|
||||
# indicators
|
||||
ind = Indicators(log=logging)
|
||||
ind.parse_stix2(indicator_file)
|
||||
ind.ioc_collections[0]["processes"].append("cfprefssd")
|
||||
|
||||
m = Processes(log=logging)
|
||||
m.indicators = ind
|
||||
run_module(m)
|
||||
assert len(m.results) == 2
|
||||
assert len(m.detected) == 1
|
||||
Reference in New Issue
Block a user