Attacking Broadcast receiver:
A Broadcast Receiver is an Android Component which allows you to register for system or application events.We recommend reading Android Penetration Testing – Part 5 for more details with Broadcast Receiver
Let’s examine android manifest
Broadcast receivers are generally registered in the following format. As we can see in android manifest file exported value = True for broadcast
The code seems insecure since the receiver is exported.
The parameters that are passed to the Broadcast Receiver can be seen below
The Goal is to send spoofed broadcast intents and see if the application is accepting them. If yes, we will exploit the application to send an SMS to some random mobile numbers using the fake broadcasts.
Attacking Vulnerable Broadcast Receivers
Let’s now try to send some spoofed broadcasts to the above receiver.
Using am tool available in adb
Using adb
. /adb shell
am broadcast -a theBroadcast -n com.android.insecurebankv2/com.android.insecurebankv2.MyBroadCastReceiver –es phonenumber 5554 –es newpass Dinesh@123!
Now, a broadcast event is sent in the background, and since the application is not validating the input source, an SMS will be sent to emulator-5554 without user intervention.
Let’s see how we can secure application-
In the AndroidManifest.xml file of our application, we should add the following attribute to the receiver to be secured.
We can also impose permission-based restrictions by defining custom permissions for each receiver. This is helpful if the developer wants to limit the access to his app’s components to those apps which have permissions.
This is the reason why we need to specify “android.permission.RECEIVE_SMS” permission in the AndroidManifest.xml file if any app wants to listen for the Receive SMS event using the action “android.provider.Telephony.SMS_RECEIVED“
Android Application Penetration Testing – Part 1
Android Application Penetration Testing – Part 2
Android Application Penetration testing – Part 3
Android Application Penetration Testing – Part 4
Android Application Penetration Testing – Part 5
Android Application Penetration Testing – Part 6
Android Application Penetration Testing – Part 7
Android Application Penetration Testing – Part 8
Android Application Penetration Testing – Part 9
The Lotus Blossom hacker group, also known as Spring Dragon, Billbug, or Thrip, has been…
A newly identified malware, dubbed "Squidoor," has emerged as a sophisticated threat targeting government, defense,…
Cyber adversaries have evolved into highly organized and professional entities, mirroring the operational efficiency of…
In Q3 2024, Cofense Intelligence uncovered a targeted spear-phishing campaign aimed at employees working in…
The DragonForce ransomware group has launched a significant cyberattack on critical infrastructure in Saudi Arabia,…
In a concerning development, cybersecurity researchers at Trellix have uncovered a sophisticated malware campaign that…