Search K
Appearance
Appearance
Other ways to support HackTricks:
Try Hard Security Group
In Android, a task is essentially a set of activities that users interact with to complete a specific job, organized within a back stack. This stack orders activities based on when they were opened, with the most recent activity displayed at the top as the foreground activity. At any moment, only this activity is visible on the screen, making it part of the foreground task.
Here's a quick breakdown of activity transitions:
In Android applications, task affinity specifies an activity's preferred task, aligning typically with the app's package name. This setup is instrumental in crafting a proof-of-concept (PoC) app for demonstrating the attack.
The launchMode
attribute directs the handling of activity instances within tasks. The singleTask mode is pivotal for this attack, dictating three scenarios based on the existing activity instances and task affinity matches. The exploit hinges on the ability of an attacker's app to mimic the target app's task affinity, misleading the Android system into launching the attacker's app instead of the intended target.
For a practical implementation of this attack, refer to the Task Hijacking Strandhogg repository on GitHub: Task Hijacking Strandhogg.
To prevent such attacks, developers can set taskAffinity
to an empty string and opt for the singleInstance
launch mode, ensuring their app's isolation from others. Customizing the onBackPressed()
function offers additional protection against task hijacking.
Try Hard Security Group
Other ways to support HackTricks: