+ All Categories
Home > Documents > HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes...

HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes...

Date post: 06-Oct-2020
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
61
MAN IN THE BINDER: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes Through The Binder
Transcript
Page 1: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

MAN IN THE BINDER: HE WHO CONTROLS IPC, CONTROLS THE DROID

Everything Goes Through The Binder

Page 2: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

A Hack in Three Acts

Act I – Know Your DroidAct II – Attack Your DroidAct III – Prepare Your Droid

Page 3: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

Meet The Cast

Page 4: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

The Authors

Nitay Artenstein Idan Revivo Michael Shalyt

Page 5: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

Victim AppName: Kitty BankOccupation: Bank Application

“U want KitCoins – we haz it”

Page 6: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

n00b attackerName: Kitty-ninjaOccupation: Script kiddy

“Mommy, can I rob this bank?”

Page 7: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

Ninja AttackerName: Paw of DeathOccupation: Black belt ninja hacker

“To rob a bank, you must first become the bank”

Page 8: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

System ServicesName: System ServiceOccupation: Sitting and waiting to serve your needs These things run Android!

Page 9: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

The Linux KernelName: $ echo `uname –r`Occupation: Holding the world on its shoulders since 1.1.1970

Feeling neglected now that system services get all the attention on Android

Page 10: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

The BinderName: The BinderOccupation: All Powerful Mystery Character ?

Everything Goes Through The Binder

Page 11: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

Act IKnow Your Droid

Page 12: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

An Application’s Life On Windows

Syscalls

Page 13: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

An Application’s Life On Android

Syscalls

Syscalls

Syscalls

?

Page 14: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

Android – The Real Picture

Syscalls

Syscalls

Everything Goes Through The Binder

?

Page 15: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

/dev/binder /dev/tty0

libbinder.solibbinder.so

kernel/system/libbinder.so/system/libbinder.so

/system/lib*.so/system/lib*.so

DalvikVM DalvikVM

syscallparcel parcel

Bank Application Process System Service Process

applicationapplication

System services proxy

System services proxy

libandroid_runtime.solibandroid_runtime.so

libandroid_runtime.solibandroid_runtime.so

System ServiceSystem Service

• Binder has a userland component and a kernel one

• The driver receives the Parcel via an ioctl syscall and sends it to the target processes

Page 16: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

What’s a Parcel?

Page 17: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

A Short Recap

libbinder.solibbinder.so

DalvikVM

Kitty Bank Process

Parcels

Syscalls

Parcels

Audio Manager

Page 18: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

Everything Goes Through The Binder

Page 19: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

Act IIAttack Your Droid

Page 20: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

Round IKey Logging

Page 21: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

A n00b Attacker’s View of The System

?

Page 22: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

What Would The n00b Attacker Do?

!

Page 23: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

What Would The n00b Attacker Do?

!

Page 24: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

What Would The n00b Attacker Do?

!@#$

Page 25: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

A Ninja Attacker’s View of The System

?

Everything Goes Through The Binder

Page 26: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

What Would The Ninja Attacker Do?

!

Page 27: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

Key Logger Demo

Page 28: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

What Would The Ninja Attacker Do?

w00t

Page 29: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

Round IIData Manipulation

Page 30: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

A n00b Attacker’s View of The System

?Activity Activity Activity

Page 31: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

What Would The n00b Attacker Do?

Bye Kitty Bank , Hello Shi**y Bank!

Page 32: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

What Would The n00b Attacker Do?

Bye Kitty Bank , Hello Shi**y Bank!@#$

Page 33: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

A Ninja Attacker’s View of The System

?

Everything Goes Through The Binder

Activity Manager

Page 34: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

In-app data goes through Binder???

Page 35: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

A Ninja Attacker’s View of The System

?Activity Manager

Page 36: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

What Would The Ninja Attacker Do?

!Activity Manager

Page 37: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

A trillion dollars, anyone?

Page 38: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

Data Manipulation Demo

Page 39: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

What Would The Ninja Attacker Do?

w00t

Page 40: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

Round IIIIntercepting SMS

Page 41: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

A n00b Attacker’s View of The System

? Telephony Manager

Page 42: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

What Would The n00b Attacker Do?

!Just Ask Politely

Page 43: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

What Would The n00b Attacker Do?

!@#$Just Ask Politely

Page 44: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

A Ninja Attacker’s View of The System

?

Everything Goes Through The Binder

Telephony Manager

Page 45: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

What Would The Ninja Attacker Do?

!

Page 46: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

SMS internals• The Telephony Manager notifies the SMS app

whenever an SMS is received

• The app queries the TM’s database via Binder:

Page 47: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

SMS internals• But what’s a Cursor object?

• It’s a messy abstraction of a response to a query

Page 48: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

SMS internals• Surprise: Under the hood, it’s just a Unix fd

• Now we’re in business!

Page 49: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

What Would The Ninja Attacker Do?

w00t

Page 50: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

SummaryWhat Just Happened?

Page 51: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

Attacking The Binder

• Hook libbinder.so at the point where it sends an ioctl to the kernel

• Stealth: dozens of places to hook• But don’t you need root?

Page 52: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

Attacking The Binder

Vulnerable to known rooting exploits

Page 53: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

Consider The Possibilities

Page 54: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

SummaryFeatures:• Versatility: one hook – multiple functionalities.• App agnostic: no need to RE apps.• Stealth: the Android security model limits 3rd

party security apps just like any other app.

Page 55: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

Summary• This is NOT a vulnerability. It’s like man-in-the-

browser, but for literally everything on Android.• Root is assumed. Rooting won’t go away any

time soon.

Page 56: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

Rumors(You didn’t hear it from me…)

Page 57: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

What are you trying to tell me? That I can get all permissions on

a device?

No.I’m trying to tell you that when you’re ready, you won’t have to

Page 58: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

Act IIIPreparing Your Droid

Page 59: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

Solutions – for developers • Take control of your own process memory

space.

• Minimize the amount of data going to IPC, and encrypt what has to go.

Page 60: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

Solutions – for security industry• Scan files like it’s the 90’s.• Be brave – get root yourself:• Runtime process scanning and monitoring.• Software firewall (like Avast).• Binder firewall/anomaly detection.• Etc.

Page 61: HE WHO CONTROLS IPC, CONTROLS THE DROID Everything Goes ...cecs.wright.edu/.../mit-binder-droidcon-2015.pdf · Act I – Know Your Droid Act II – Attack Your Droid Act III – Prepare

Further Reading[1] White paper: “Man in the Binder”, Artenstein and Revivo

[2] “On the Reconstruction of Android Malware Behaviors”, Fatori, Tam et al

[3] “Binderwall: Monitoring and Filtering Android Interprocess Communication”, Hausner


Recommended