Tuesday, December 17, 2024
HomeAndroidAndroid Application Penetration Testing – Part 10

Android Application Penetration Testing – Part 10

Published on

SIEM as a Service

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

- Advertisement - SIEM as a Service

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
  • Securing the applications

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

  1. Get an adb shell on the device and type the following command to send a spoofed broadcast.
  2. Navigate back to the “platform-tools” folder and enter the below mentioned command:

. /adb shell

  1. Enter the following command in the shell:

am broadcast -a theBroadcast -n com.android.insecurebankv2/com.android.insecurebankv2.MyBroadCastReceiver –es phonenumber 5554 –es newpass Dinesh@123!

  1. Back on the emulator, navigate to the “Messages”. The above-entered command automatically makes a call to the mentioned Broadcast Receiver and an SMS text with the passwords is sent.

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-

Securing the Applications:

  • Setting android: exported attribute’s value to false

In the AndroidManifest.xml file of our application, we should add the following attribute to the receiver to be secured.

  • Limiting access to custom permissions

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“

Check out our previous parts of Android Penetration Testing

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

Gurubaran
Gurubaran
Gurubaran is a co-founder of Cyber Security News and GBHackers On Security. He has 10+ years of experience as a Security Consultant, Editor, and Analyst in cybersecurity, technology, and communications.

Latest articles

Hitachi Authentication Bypass Vulnerability Allows Attackers to Hack the System Remotely

Critical Authentication Bypass Vulnerability Identified in Hitachi Infrastructure Analytics Advisor and Ops Center Analyzer.A...

ConnectOnCall Data Breach, 900,000 Customers Data Exposed

 The healthcare communication platform ConnectOnCall, operated by ConnectOnCall.com, LLC, has confirmed a significant data...

Kali Linux 2024.4 Released – What’s New!

Kali Linux has unveiled its final release for 2024, version Kali Linux 2024.4, packed...

CISA Warns of Adobe & Windows Kernel Driver Vulnerabilities Exploited in Attacks

The Cybersecurity and Infrastructure Security Agency (CISA) has issued a critical alert, adding two...

API Security Webinar

72 Hours to Audit-Ready API Security

APIs present a unique challenge in this landscape, as risk assessment and mitigation are often hindered by incomplete API inventories and insufficient documentation.

Join Vivek Gopalan, VP of Products at Indusface, in this insightful webinar as he unveils a practical framework for discovering, assessing, and addressing open API vulnerabilities within just 72 hours.

Discussion points

API Discovery: Techniques to identify and map your public APIs comprehensively.
Vulnerability Scanning: Best practices for API vulnerability analysis and penetration testing.
Clean Reporting: Steps to generate a clean, audit-ready vulnerability report within 72 hours.

More like this

Hackers Abuse Google Ads To Attacking Graphic Design Professionals

Researchers identified a threat actor leveraging Google Search ads to target graphic design professionals,...

Antidot Malware Attacking Employees Android Devices To Inject Malicious Payloads

Researchers discovered a new variant of the AntiDot banking trojan targeting Android mobile devices...

New Chinese Surveillance Tool Attack Android Users Since 2017

Wuhan Chinasoft Token Information Technology Co., Ltd. developed EagleMsgSpy, a surveillance tool operational since...