Bypassing the Android Permission Model

40
Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC

Transcript of Bypassing the Android Permission Model

Page 1: Bypassing the Android Permission Model

Bypassing the Android Permission Model

Georgia WeidmanFounder and CEO, Bulb Security LLC

Page 2: Bypassing the Android Permission Model

Is the permission model working? Are users making good decisions?

Page 3: Bypassing the Android Permission Model

Most Popular Android App

Page 4: Bypassing the Android Permission Model

Demo

App abusing permissions

Page 5: Bypassing the Android Permission Model

Demo explained

Permissions: Read IMEI Read Contacts Send SMS

We exploited every one of these

Page 6: Bypassing the Android Permission Model

Rooting Android

Page 7: Bypassing the Android Permission Model

Rooting Android for Evil(DroidDream)

Page 8: Bypassing the Android Permission Model

DroidDream Permissions

INTERNET

READ_PHONE_STATE

CHANGE_WIFI_STATE

ACCESS_WIFI_STATE

Page 9: Bypassing the Android Permission Model

DroidDream

Page 10: Bypassing the Android Permission Model

DroidDream

Page 11: Bypassing the Android Permission Model

DroidDream Rooting

Exploid

CVE-2010-Easy (RageAgainsttheCage)

Page 12: Bypassing the Android Permission Model

Rooting Android

Page 13: Bypassing the Android Permission Model

DroidDream Root Payload

Permission model no longer applies installed packages All personal data Send to C&C

Page 14: Bypassing the Android Permission Model

Rooting Android for Evil(DroidDream)

Page 15: Bypassing the Android Permission Model

Rooting Android

Page 16: Bypassing the Android Permission Model

Mitigation

Users update their phones That means they need the updates pushed out

That means you third party platforms!!

Page 17: Bypassing the Android Permission Model
Page 18: Bypassing the Android Permission Model
Page 19: Bypassing the Android Permission Model

Android Storage

Sdcard VFAT

With apps Only visible to app (default) World readable

Page 20: Bypassing the Android Permission Model

Demo

Exploiting bad storage practices

Page 21: Bypassing the Android Permission Model

Demo Explained

Stores sensitive data on the sdcard Sdcard is VFAT Everything is world readable

Page 22: Bypassing the Android Permission Model

Demo Explained

Discovers how the data is stored Accesses it Sends it to an attacker

Page 23: Bypassing the Android Permission Model

Code Examples

Vulnerable Code

Malicious Code

Page 24: Bypassing the Android Permission Model

BadSaveFile

Page 25: Bypassing the Android Permission Model

BadSendFile

Page 26: Bypassing the Android Permission Model

Wait? How do we get source code?

Winzip/7zip etc.

dex2jar

jd-gui

Whitepaper with more info: http://cdn01.exploit-db.com/wp-content/themes/exploit/docs/17717.pdf

Page 27: Bypassing the Android Permission Model
Page 28: Bypassing the Android Permission Model
Page 29: Bypassing the Android Permission Model
Page 30: Bypassing the Android Permission Model

Nonsensical Code

while (true)

{

if (i < 0);

String str;

while (true)

{

return;

try

{

Page 31: Bypassing the Android Permission Model

Mitigation

Store information securely Not on sdcard

Not in source code

Not world readable

Page 32: Bypassing the Android Permission Model

Android Interfaces

Call other programs

Don't reinvent the wheel

Take a picture

Twitter from photo app

Page 33: Bypassing the Android Permission Model

Demo

Exploiting open interface with SMS functionality

Page 34: Bypassing the Android Permission Model

Demo Explained

When it is called it sends an SMS Caller can set the number and message Sadly this is considered useful!

Page 35: Bypassing the Android Permission Model

Demo Explained

Calls the SMSBroadcastr Sends number and message Sends an SMS

Page 36: Bypassing the Android Permission Model

Code Examples

Vulnerable Code

Malicious Code

Page 37: Bypassing the Android Permission Model

SMSBroadcastr

Page 38: Bypassing the Android Permission Model

SMSIntent

Page 39: Bypassing the Android Permission Model

Mitigations

Don't have dangerous functionality available in interfaces

Require user interaction (click ok)

Require-permission tag in manifest for interface

Page 40: Bypassing the Android Permission Model

Contact

Georgia Weidman

georgiaweidman.com bulbsecurity.com

[email protected]

@georgiaweidman