Hacking Android Activity Intents

The mobile application shown below is a password manager which helps to manage and store passwords in a secure manner.

Details about the app used for this blog post can not be disclosed at this time, but it serves as real-life proof of concept for the vulnerability class of insecure Android intents.

Before explaining this vulnerability, let’s understand what are Android Activity Intents?

An Activity represents a single screen in an app. You can start a new instance of an Activity by passing an Intent to startActivity(). The Intent describes the activity to start and carries any necessary data.

For more information:
http://developer.android.com/guide/components/intents-filters.html

If intents are not secured via the AndroidManifest.xml file, these intents can be easily called to view other instances of intents hidden within the mobile application. These hidden intents could contain cached data which may potentially include the user’s sensitive cached data.

How can this vulnerability be exploited?

In the event that that a user’s mobile phone has been misplaced, a malicious attacker could bypass the passcode lock mechanism in the application in order to view sensitive information stored within the mobile application.

Due to insecure permissions on the AndroidManifest.xml file, these intents could be called manually to display on the mobile device.

Steps to exploit this vulnerability:

  1. Extract the mobile’s application APK file from the mobile device

  2. Review the mobile application’s AndroidManifest.xml file. Look out for activity with intents

在这里插入图片描述

  1. Take note of package name and activity name

  2. Connect mobile device to your PC, and connect to adb. Type in the following in terminal:

adb shell

su

  1. Launch the vulnerable mobile application.

  2. In another terminal type:

am start -n / to-intent-uri:MAIN

在这里插入图片描述

Within an ADB shell, the Activity Manager (am) tool can be used to interact with the Android Operating System by performing various system actions.

For more information: http://developer.android.com/tools/help/adb.html

  1. After entering the above command, access to the whole mobile application on the victim’s mobile device will be granted. All passwords encrypted and stored on the device can now be accessed without knowing the decryption key or passcode.

How to fix this vulnerability?

Set android:exported = false on each Activity declared on the AndroidManifest.xml file.

This tells Android whether the content provider is available for other applications to use:

true: The provider is available to other applications. Any application can use the provider’s content URI to access it, subject to the permissions specified for the provider.

false: The provider is not available to other applications. Set android:exported=”false” to limit access to the provider to your applications. Only applications that have the same user ID (UID) as the provider will have access to it.

The default value is “true” for applications that set either android:minSdkVersion or android:targetSdkVersion to “16” or lower. For applications that set either of these attributes to “17” or higher, the default is “false”.

In the event that access need to be granted to other applications, you can still set android:exported=”true” and limit access to your provider by setting permissions with the permission attribute.

For more information: http://developer.android.com/guide/topics/manifest/provider-element.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值