Activities
There are four key components in an Android application, and half of the vulnerabilities are related to network traffic (e.g., HTTPS) while the other half involves the four components (Activities, Services, Broadcast Receivers, Content Providers)
📌Activities
An activity represents a single user interface screen. It’s the primary way that users interact with your app.
Each screen or “activity” in your app is typically represented by a separate activity component.
Activities can be used to display information, gather user input, and respond to user interactions. They’re the basic building blocks of the user interface.
Activities can launch each other like in this example the code activity has a button that launches the profile activity and the profile activity can launch the settings activity.

Activities are protected by the application context and cannot be launched by another app unless they are explicitly marked as
exported="true"in theAndroidManifest.xml.Now, let's say I have an application that includes a QR code scanner, and I want to access this activity but not the app itself. How can the OS access an activity?
Let's go back to
androidmanifest.xml.
📍 So what is exported and intent-filter?
An “exported” activity in Android refers to an activity component that can be accessed and launched by other apps or components outside of its own app. When an activity is marked as “exported=true” It means that other apps can potentially interact with it, start it, and communicate with it.

That means if the QR code scanner activity is exported, I can start it and scan the code without opening the application.
📍 We have two types of exporting an activity explicit and implicit.
To determine if an activity is exported in an Android application, you can look at the Android manifest XML file, specifically at the activity’s declaration. Within the
<activity>element, there is an attribute calledandroid:exported. This attribute indicates whether the activity is accessible to other applications or components outside of the app. (explicit)For example:
In the above example, the
MainActivityactivity is exported (android:exported="true"), meaning it can be launched by other applications. Ifandroid:exportedis set to"false"The activity is not exported and can only be launched within the app.
Regarding
<intent-filter>It is used within the<activity>element to specify which types of intents the activity can respond to. Intents are messages that allow components to request actions from other components or apps. (implicit)For example:
In this example, the
MainActivityis defined as the main launcher activity (android.intent.action.MAINandandroid.intent.category.LAUNCHER), which means it will be the entry point of the application when the user opens it from the app launcher.
By checking both the
android:exportedattribute and<intent-filter>of an activity in the Android manifest, you can identify if the activity is exported and understand its launch behavior in the application.
📍How to start an activity
Using ADB:
If you explain this to the customer, you should mention that an attacker needs access to the ADB shell to use the activity manager and start the app. The customer may argue that this is not considered a security finding.
To demonstrate a more practical scenario, you could create a malicious app that performs this task to start an activity without requiring access to the ADB shell.
📌Hacking Activities
Testing
Check
AndroidManifest.xmlforandroid:exported="true".Look for
intent-filtersindicating implicit export.Search for sensitive actions or data handled by the activity.
Exploit
ADB Commands
Last updated