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

Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

Bypassing the Android Permission Model

Georgia WeidmanFounder and CEO, Bulb Security LLC

Page 2: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

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

Page 3: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

Most Popular Android App

Page 4: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

Demo

App abusing permissions

Page 5: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

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 …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

Rooting Android

Page 7: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

Rooting Android for Evil(DroidDream)

Page 8: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

DroidDream Permissions

INTERNET

READ_PHONE_STATE

CHANGE_WIFI_STATE

ACCESS_WIFI_STATE

Page 9: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

DroidDream

Page 10: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

DroidDream

Page 11: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

DroidDream Rooting

Exploid

CVE-2010-Easy (RageAgainsttheCage)

Page 12: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

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 …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

Rooting Android

Page 14: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

Demo

Demo: Malicious post root payload

Page 15: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia
Page 16: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia
Page 17: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia
Page 18: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

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 …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

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 …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia
Page 21: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia
Page 22: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

Android Storage

Sdcard VFAT

With apps Only visible to app (default) World readable

Page 23: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

Demo

Exploiting bad storage practices

Page 24: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

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 …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

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 …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

Code Examples

Vulnerable Code

Malicious Code

Page 27: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

BadSaveFile

Page 28: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

BadSendFile

Page 29: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

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 …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia
Page 31: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia
Page 32: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia
Page 33: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

Nonsensical Code

while (true)

{

if (i < 0);

String str;

while (true)

{

return;

try

{

Page 34: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

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 …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

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 …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

Demo

Exploiting open interface with SMS functionality

Page 37: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

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 …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

Demo Explained

Calls the SMSBroadcastr Sends number and message Sends an SMS

Page 39: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

Code Examples

Vulnerable Code

Malicious Code

Page 40: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

SMSBroadcastr

Page 41: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

SMSIntent

Page 42: Bypassing the Android Permission Model - Hack In The Box …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

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 …conference.hitb.org/hitbsecconf2012ams/materials/D2T1... · 2017-10-15 · Bypassing the Android Permission Model Georgia

Contact

Georgia Weidman

georgiaweidman.com bulbsecurity.com

[email protected]

@georgiaweidman