Hijack Execution Flow: System Runtime API Hijacking

Adversaries may execute their own malicious payloads by hijacking the way an operating system runs applications. Hijacking execution flow can be for the purposes of persistence since this hijacked execution may reoccur at later points in time.

On Android, adversaries may overwrite the standard OS API library with a malicious alternative to hook into core functions to achieve persistence. By doing this, the adversary’s code will be executed every time the overwritten API function is called by an app on the infected device.

ID: T1625.001
Sub-technique of:  T1625
Tactic Type: Post-Adversary Device Access
Tactic: Persistence
Platforms: Android
MTC ID: APP-27
Version: 1.1
Created: 30 March 2022
Last Modified: 08 September 2023

Procedure Examples

ID Name Description
S0420 Dvmap

Dvmap replaces /system/bin/ip with a malicious version. Dvmap can inject code by patching libdmv.so or libandroid_runtime.so, depending on the Android OS version. Both libraries are related to the Dalvik and ART runtime environments. The patched functions can only call /system/bin/ip, which was replaced with the malicious version.[1]

S0408 FlexiSpy

FlexiSpy installs boot hooks into /system/su.d.[2]

S0494 Zen

Zen can install itself on the system partition to achieve persistence. Zen can also replace framework.jar, which allows it to intercept and modify the behavior of the standard Android API.[3]

Mitigations

ID Mitigation Description
M1002 Attestation

Device attestation could detect unauthorized operating system modifications.

M1004 System Partition Integrity

Android Verified Boot can detect unauthorized modifications made to the system partition, which could lead to execution flow hijacking.[4]

Detection

ID Data Source Data Component Detects
DS0013 Sensor Health Host Status

Mobile threat defense agents could detect unauthorized operating system modifications by using attestation.

References