Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android...

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

Transcript of Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android...

Page 1: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

Bypassing the Android Permission Model

Georgia WeidmanFounder and CEO, Bulb Security LLC

Page 2: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

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

Page 3: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

Most Popular Android App

Page 4: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

Demo

App abusing permissions

Page 5: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

Demo explained

Permissions:− Read IMEI− Read Contacts− Send SMS

We exploited every one of these

Page 6: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

Rooting Android

Page 7: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

Rooting Android for Evil(DroidDream)

Page 8: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

DroidDream Permissions

INTERNET

READ_PHONE_STATE

CHANGE_WIFI_STATE

ACCESS_WIFI_STATE

Page 9: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

DroidDream

Page 10: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

DroidDream

Page 11: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

DroidDream Rooting

Exploid

CVE-2010-Easy (RageAgainsttheCage)

Page 12: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

DroidDream Root Payload

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

Page 13: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

Rooting Android

Page 14: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

Demo

Demo: Malicious post root payload

Page 15: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission
Page 16: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission
Page 17: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission
Page 18: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

How the Botnet Works

Bot Receives a Message

Bot Decodes User Data

Checks for Bot Key

Performs Functionality

Page 19: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

Mitigation

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

That means you third party platforms!!

Page 20: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission
Page 21: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission
Page 22: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

Android Storage

Sdcard VFAT

With apps Only visible to app (default) World readable

Page 23: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

Demo

Exploiting bad storage practices

Page 24: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

Demo Explained

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

Page 25: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

Demo Explained

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

Page 26: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

Code Examples

Vulnerable Code

Malicious Code

Page 27: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

BadSaveFile

Page 28: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

BadSendFile

Page 29: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

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 30: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission
Page 31: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission
Page 32: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission
Page 33: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

Nonsensical Code

while (true)

{

if (i < 0);

String str;

while (true)

{

return;

try

{

Page 34: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

Mitigation

Store information securely Not on sdcard

Not in source code

Not world readable

Page 35: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

Android Interfaces

Call other programs

Don't reinvent the wheel

Take a picture

Twitter from photo app

Page 36: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

Demo

Exploiting open interface with SMS functionality

Page 37: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

Demo Explained

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

Page 38: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

Demo Explained

Calls the SMSBroadcastr Sends number and message Sends an SMS

Page 39: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

Code Examples

Vulnerable Code

Malicious Code

Page 40: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

SMSBroadcastr

Page 41: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

SMSIntent

Page 42: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

Mitigations

Don't have dangerous functionality available in interfaces

Require user interaction (click ok)

Require-permission tag in manifest for interface

Page 43: Bypassing the Android Permission Model - Hack In The Box ... - Ge… · Bypassing the Android Permission Model Georgia Weidman Founder and CEO, Bulb Security LLC. Is the permission

Contact

Georgia Weidman

georgiaweidman.com bulbsecurity.com

[email protected]

@georgiaweidman