2022-10-11 10:41:42 +00:00
|
|
|
# Mobile Verification Toolkit (MVT)
|
2023-02-08 19:18:16 +00:00
|
|
|
# Copyright (c) 2021-2023 Claudio Guarnieri.
|
2022-10-11 10:41:42 +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
|
2023-02-14 16:51:55 +00:00
|
|
|
import os
|
2022-10-11 10:41:42 +00:00
|
|
|
|
|
|
|
from mvt.android.modules.androidqf.getprop import Getprop
|
2023-03-29 10:57:41 +00:00
|
|
|
from mvt.common.indicators import Indicators
|
2022-10-11 10:41:42 +00:00
|
|
|
from mvt.common.module import run_module
|
|
|
|
|
|
|
|
from ..utils import get_artifact_folder
|
|
|
|
|
|
|
|
|
|
|
|
class TestAndroidqfGetpropAnalysis:
|
|
|
|
def test_androidqf_getprop(self):
|
2023-06-01 21:40:26 +00:00
|
|
|
m = Getprop(
|
|
|
|
target_path=os.path.join(get_artifact_folder(), "androidqf"), log=logging
|
|
|
|
)
|
2022-10-11 10:41:42 +00:00
|
|
|
run_module(m)
|
|
|
|
assert len(m.results) == 10
|
2023-03-29 10:57:41 +00:00
|
|
|
assert m.results[0]["name"] == "dalvik.vm.appimageformat"
|
|
|
|
assert m.results[0]["value"] == "lz4"
|
2022-10-11 10:41:42 +00:00
|
|
|
assert len(m.timeline) == 0
|
|
|
|
assert len(m.detected) == 0
|
2023-03-29 10:57:41 +00:00
|
|
|
|
|
|
|
def test_androidqf_getprop_detection(self, indicator_file):
|
2023-06-01 21:40:26 +00:00
|
|
|
m = Getprop(
|
|
|
|
target_path=os.path.join(get_artifact_folder(), "androidqf"), log=logging
|
|
|
|
)
|
2023-03-29 10:57:41 +00:00
|
|
|
ind = Indicators(log=logging.getLogger())
|
|
|
|
ind.parse_stix2(indicator_file)
|
|
|
|
ind.ioc_collections[0]["android_property_names"].append("dalvik.vm.heapmaxfree")
|
|
|
|
m.indicators = ind
|
|
|
|
run_module(m)
|
|
|
|
assert len(m.results) == 10
|
|
|
|
assert len(m.detected) == 1
|
|
|
|
assert m.detected[0]["name"] == "dalvik.vm.heapmaxfree"
|