SlideShare una empresa de Scribd logo
1 de 46
On the Feasibility of Automatically
Generating Android Component
Hijacking Exploits
Daoyuan Wu
August 21, 2014
1
HitCon’14
Related News - 1
2
Related News - 2
3
Related News - 3
4
Make free phone call
Kill current phone call
Background of Android Component
Hijacking Vulnerability
5
Component:
The Building Block of Android Apps
• An app can have four types of components:
• They have their own entry points and can be
activated individually.
6
Activity
Broadcast
Receiver
Content
Provider
Service
App
Components can be Exposed
to Other Apps
• For flexible code and data sharing.
• Android (mainly) uses Manifest XML file to
define component exposure.
7
Twitter app
Tweet UI
Upload
Service
Camera app
IMAGE_CAPTURE request
Photo
Exported!
Camera
Components can be Exposed
to Other Apps
• The Manifest XML file of Chrome:
8
However, the confused deputy problem
will occur, causing component hijacking.
Because any other apps can send
requests to exported components.
9
The High-level Overview of
Component Hijacking
10
Example: The Vulnerable GoSMS Pro
First reported by us on Sep 9, 2013
Let’s see how to exploit it!
11
Go SMS Pro and
Its Exported Component
• Very popular
– Top 1 SMS app in Google Play
– Over 75 million installs
• But its CellValidateService is exported
– In our tested versions: 4.35 and 5.23
12
The Code of CellValidateService
13
Exploit CellValidateService
to Send SMS
• Victim code • Exploit code
14
Intent intent = new Intent();
intent.setAction(“com.xxx.
ACTION_CELL_VALIDATE”);
intent.putExtra(“phone”,
“10086”);
startService(intent);
1
2
3
4
if (“com.xxx.ACTION_CELL_VALIDATE”
.equals(paramIntent.getAction()))
String str1 =
paramIntent.getStringExtra("phone");
Code(str1, str3);
Demo
• An attack app (with zero permission) can
exploit GO SMS Pro to send SMS messages (to
arbitrary phone no. specified by attackers).
15
Video link: http://youtu.be/CwtNCwAHSRs?t=25s
Exported Components
are Common in Android Apps
• Statistics of top 1K apps
16
Exported Components
are Common in Android Apps
• Statistics of top 1K apps
17
Launcher or Sharing Activities
System broadcasts
require exported components
Developers’ mistakes
(intent-filter or provider)
Requirement: Automatically Generating
Component Hijacking Exploits
18
Prior Related Work
Targeted generation
• “Android Permission Re-
Delegation Detection and
Test Case Generation”
• “Detecting Passive
Content Leaks and
Pollution in Android
Applications”
• “Automatically Exploiting
Potential Component
Leaks in Android
Applications”
Random generation
• “An Empirical Study of the
Robustness of Inter-
component
Communication in
Android”
• Intent Fuzzer (by iSec)
• Drozer (formerly Mercury)
• “IntentFuzzer: Detecting
Capability Leaks of
Android Applications”
19
Even an Unpublished BlackHat’14 One
20
• “Static Detection and Automatic Exploitation of Intent
Message Vulnerabilities in Android Applications”
– https://www.blackhat.com/us-14/briefings.html#static-detection-and-automatic-exploitation-of-intent-message-vulnerabilities-in-android-applications
However, they are far from perfect.
We argue several challenges that
need to be addressed for a robust
exploit generation technique.
21
Overview of Challenges in Focus
• Cross-component invocation problem
– Or the Next Intent issue
• Custom structure containment problem
– Exploits may need to contain custom structures
• Semantic constraint resolving problem
– Beyond the typical numeric or string constraints
• Pending Intent issue
– Making exploiting Intents is a bit different
22
First
pinpoi
nted
Illustrate with Real Vulnerable Apps
• Cross-component invocation problem
– Or the Next Intent issue
– Facebook
• Custom structure containment problem
– Exploits may need to contain custom structures
– Clean Master
• Semantic constraint resolving problem
– Beyond the typical numeric or string constraints
– Lango Messaging
• Pending Intent issue
– Making exploiting Intents is a bit different
– Lango Messaging
23
First
pinpoi
nted
1. The Cross-component Invocation
Problem
24
Basic Idea of
Cross-component Invocation
• Exported components are only the middle
25
Exploit Facebook by Takeshi Terada
•  LoginActivity  FacebookWebViewActivity
26
// create continuation_intent to call FacebookWebViewActivity.
Intent contIntent = new Intent();
contIntent.setClassName(FB_PKG, FB_WEBVIEW_ACTIVITY);
contIntent.putExtra("url", "file:///sdcard/attack.html");
// create intent to be sent to LoginActivity.
Intent intent = new Intent();
intent.setClassName(FB_PKG, FB_LOGIN_ACTIVITY);
intent.putExtra("login_redirect", false);
// put continuation_intent into extra data of the intent.
intent.putExtra(FB_PKG + ".continuation_intent", contIntent);
this.startActivity(intent);
How to Automatically Handle the
Cross-component Invocation?
• What final inputs do exported components
give to you?
– Maybe only an action, or better an extra field.
– Best: control the whole Intent.
• Which private components to select or attack?
– Find the set of valuable target components.
– Match the capabilities we have.
27
2. The Custom Structure Containment
Problem
28
Illustrate with Clean Master
• Extremely popular, over 200M installs. “3.6.0”
29
Exploit Should Contain The Custom
UninstallAppData Structure
30
But UninstallAppData is defined by
Victim App
Option 1:
• Decompile the victim
app, and obtain the
source code of the
UninstallAppData
structure.
• But this is not reliable
– Imperfect to decompile
Option 2:
• Mimic the skeleton of
target structure
• “Part of source code”
– Field definition
– Interface functions
• But complicated, and
still may fail.
31
The First Version of Target Structure
32
The Second Version of Exploit
33
The Second Version of Target Structure
34
If not implemented:
Mash Up must Use
the Same Class Path
35
The correct class path should be:
com.ijinshan.cleaner.bean.UninstallAppData
3. Semantic Constraint Resolving
Problem
36
Illustrate with Lango Messaging
• Once over 1M installs, the latest version
37
Attack
Consequence:
inbox SMS

sent SMS
ZmsSentReceiver in Lango Messaging
• How to resolve such semantic constraints?
if (localMessageItem.getBoxId() != 2)
38
Exploit Requires Domain Knowledge
• Very different from typical hijacking exploits:
39
Even Under Brute-force Attempts
• Suppose the target uri is:
40
content://sms/121
This field can be brute forced.
But still require pre knowledge
to set up a valid data
Pre knowledge is required!
(1) Use model to pinpoint “sms”
(2) Cover the common uris, “contact”
But no guarantee
4. Pending Intent Issue
41
What is getResultCode() for?
42
Retrieve the current result code, as set by the previous receiver.
See how SMS is sent
43
sms.sendTextMessage(phoneNumber, null, message, sentPI,
deliveredPI);
PendingIntent sentPI = PendingIntent.getBroadcast(context, 0, new
Intent(SENT), 0);
PendingIntent deliveredPI = PendingIntent.getBroadcast(context, 0,
new Intent(DELIVERED), 0);
The intents in sentPI or deliveredPI will be broadcasted
after the invocation of sendTextMessage(),
and they contain the corresponding result codes.
The Rest of Exploit for Lango
• Invoke PendingIntent.send() to trigger its
broadcast, as well as setting result codes.
44
Conclusion
• My opinion:
45
Challenge Automatic? Note
Cross-component But not easy
Custom structure May fail
Semantic constraint Pre knowledge
Pending intent Need to handle
Thanks & Comments?
http://www.linkedin.com/in/daoyuan
PPT: http://www.slideshare.net/daoyuan0x
Demo code: https://github.com/daoyuan14
46

Más contenido relacionado

Destacado

Workplace Flexibility: The New Rules to Keep Your Employees Happy
Workplace Flexibility: The New Rules to Keep Your Employees HappyWorkplace Flexibility: The New Rules to Keep Your Employees Happy
Workplace Flexibility: The New Rules to Keep Your Employees HappyWilliam Wallace
 
Building a flexible workplace
Building a flexible workplaceBuilding a flexible workplace
Building a flexible workplaceAnu Murthy
 
Planning And Monitoring The Process
Planning And Monitoring The ProcessPlanning And Monitoring The Process
Planning And Monitoring The Processahmad bassiouny
 
A Digital Workplace for the Flexible Workforce
A Digital Workplace for the Flexible WorkforceA Digital Workplace for the Flexible Workforce
A Digital Workplace for the Flexible WorkforceBMC_DSM
 
Flextime Power Point Presentation
Flextime Power Point PresentationFlextime Power Point Presentation
Flextime Power Point PresentationJamie Robinson
 
Workplace flexibility
Workplace flexibilityWorkplace flexibility
Workplace flexibilityAntonov Anive
 
Flexi Time
Flexi TimeFlexi Time
Flexi Timeajithsrc
 

Destacado (10)

Workplace Flexibility: The New Rules to Keep Your Employees Happy
Workplace Flexibility: The New Rules to Keep Your Employees HappyWorkplace Flexibility: The New Rules to Keep Your Employees Happy
Workplace Flexibility: The New Rules to Keep Your Employees Happy
 
Flexible working
Flexible workingFlexible working
Flexible working
 
Building a flexible workplace
Building a flexible workplaceBuilding a flexible workplace
Building a flexible workplace
 
Planning And Monitoring The Process
Planning And Monitoring The ProcessPlanning And Monitoring The Process
Planning And Monitoring The Process
 
A Digital Workplace for the Flexible Workforce
A Digital Workplace for the Flexible WorkforceA Digital Workplace for the Flexible Workforce
A Digital Workplace for the Flexible Workforce
 
Flexible work options
Flexible work optionsFlexible work options
Flexible work options
 
Flextime Power Point Presentation
Flextime Power Point PresentationFlextime Power Point Presentation
Flextime Power Point Presentation
 
Workplace flexibility
Workplace flexibilityWorkplace flexibility
Workplace flexibility
 
Flexitime
FlexitimeFlexitime
Flexitime
 
Flexi Time
Flexi TimeFlexi Time
Flexi Time
 

Similar a HitCon'14: On the Feasibility of Automatically Generating Android Component Hijacking Exploits

Android Mobile App Development basics PPT
Android Mobile App Development basics PPTAndroid Mobile App Development basics PPT
Android Mobile App Development basics PPTnithya697634
 
Reading Group Presentation: Why Eve and Mallory Love Android
Reading Group Presentation: Why Eve and Mallory Love AndroidReading Group Presentation: Why Eve and Mallory Love Android
Reading Group Presentation: Why Eve and Mallory Love AndroidMichael Rushanan
 
Mobile application security
Mobile application securityMobile application security
Mobile application securityShubhneet Goel
 
Mobile Application Security
Mobile Application SecurityMobile Application Security
Mobile Application SecurityIshan Girdhar
 
Mediating Applications on the Android System
Mediating Applications on the Android SystemMediating Applications on the Android System
Mediating Applications on the Android SystemNizar Maan
 
Building Custom Android Malware BruCON 2013
Building Custom Android Malware BruCON 2013Building Custom Android Malware BruCON 2013
Building Custom Android Malware BruCON 2013Stephan Chenette
 
Exploring the Labyrinth: Deep dive into the Lazarus Group's foray into macOS
Exploring the Labyrinth: Deep dive into the Lazarus Group's foray into macOSExploring the Labyrinth: Deep dive into the Lazarus Group's foray into macOS
Exploring the Labyrinth: Deep dive into the Lazarus Group's foray into macOSMITRE ATT&CK
 
Mocking vtcc3 - en
Mocking   vtcc3 - enMocking   vtcc3 - en
Mocking vtcc3 - envgrondin
 
Mergebase dont-let-vulns-run-wild
Mergebase dont-let-vulns-run-wildMergebase dont-let-vulns-run-wild
Mergebase dont-let-vulns-run-wildJaredHarris18
 
From Containerization to Modularity
From Containerization to ModularityFrom Containerization to Modularity
From Containerization to Modularityoasisfeng
 
Protecting your organization against attacks via the build system
Protecting your organization against attacks via the build systemProtecting your organization against attacks via the build system
Protecting your organization against attacks via the build systemLouis Jacomet
 
CNIT 128: 7. Attacking Android Applications (Part 1 of 3)
CNIT 128: 7. Attacking Android Applications (Part 1 of 3)CNIT 128: 7. Attacking Android Applications (Part 1 of 3)
CNIT 128: 7. Attacking Android Applications (Part 1 of 3)Sam Bowne
 
Matteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break editionMatteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break editionDuckMa
 
ToorCon 14 : Malandroid : The Crux of Android Infections
ToorCon 14 : Malandroid : The Crux of Android InfectionsToorCon 14 : Malandroid : The Crux of Android Infections
ToorCon 14 : Malandroid : The Crux of Android InfectionsAditya K Sood
 
First Principles Vulnerability Assessment
First Principles Vulnerability AssessmentFirst Principles Vulnerability Assessment
First Principles Vulnerability AssessmentManuel Brugnoli
 
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013DuckMa
 

Similar a HitCon'14: On the Feasibility of Automatically Generating Android Component Hijacking Exploits (20)

Android Mobile App Development basics PPT
Android Mobile App Development basics PPTAndroid Mobile App Development basics PPT
Android Mobile App Development basics PPT
 
Reading Group Presentation: Why Eve and Mallory Love Android
Reading Group Presentation: Why Eve and Mallory Love AndroidReading Group Presentation: Why Eve and Mallory Love Android
Reading Group Presentation: Why Eve and Mallory Love Android
 
Mobile application security
Mobile application securityMobile application security
Mobile application security
 
Mobile Application Security
Mobile Application SecurityMobile Application Security
Mobile Application Security
 
Mediating Applications on the Android System
Mediating Applications on the Android SystemMediating Applications on the Android System
Mediating Applications on the Android System
 
Building Custom Android Malware BruCON 2013
Building Custom Android Malware BruCON 2013Building Custom Android Malware BruCON 2013
Building Custom Android Malware BruCON 2013
 
Exploring the Labyrinth: Deep dive into the Lazarus Group's foray into macOS
Exploring the Labyrinth: Deep dive into the Lazarus Group's foray into macOSExploring the Labyrinth: Deep dive into the Lazarus Group's foray into macOS
Exploring the Labyrinth: Deep dive into the Lazarus Group's foray into macOS
 
Mocking vtcc3 - en
Mocking   vtcc3 - enMocking   vtcc3 - en
Mocking vtcc3 - en
 
Mergebase dont-let-vulns-run-wild
Mergebase dont-let-vulns-run-wildMergebase dont-let-vulns-run-wild
Mergebase dont-let-vulns-run-wild
 
Appium
AppiumAppium
Appium
 
1780 1783
1780 17831780 1783
1780 1783
 
1780 1783
1780 17831780 1783
1780 1783
 
From Containerization to Modularity
From Containerization to ModularityFrom Containerization to Modularity
From Containerization to Modularity
 
Protecting your organization against attacks via the build system
Protecting your organization against attacks via the build systemProtecting your organization against attacks via the build system
Protecting your organization against attacks via the build system
 
CNIT 128: 7. Attacking Android Applications (Part 1 of 3)
CNIT 128: 7. Attacking Android Applications (Part 1 of 3)CNIT 128: 7. Attacking Android Applications (Part 1 of 3)
CNIT 128: 7. Attacking Android Applications (Part 1 of 3)
 
Matteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break editionMatteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break edition
 
Lick my Lollipop
Lick my LollipopLick my Lollipop
Lick my Lollipop
 
ToorCon 14 : Malandroid : The Crux of Android Infections
ToorCon 14 : Malandroid : The Crux of Android InfectionsToorCon 14 : Malandroid : The Crux of Android Infections
ToorCon 14 : Malandroid : The Crux of Android Infections
 
First Principles Vulnerability Assessment
First Principles Vulnerability AssessmentFirst Principles Vulnerability Assessment
First Principles Vulnerability Assessment
 
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
 

Último

VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...SUHANI PANDEY
 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...SUHANI PANDEY
 
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men 🔝mehsana🔝 Escorts...
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men  🔝mehsana🔝   Escorts...➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men  🔝mehsana🔝   Escorts...
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men 🔝mehsana🔝 Escorts...nirzagarg
 
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtrahman018755
 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdfMatthew Sinclair
 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...SUHANI PANDEY
 
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋nirzagarg
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirtrahman018755
 
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort ServiceBusty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort ServiceDelhi Call girls
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfJOHNBEBONYAP1
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...tanu pandey
 
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...roncy bisnoi
 
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls DubaiDubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubaikojalkojal131
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC
 
Microsoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftMicrosoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftAanSulistiyo
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"growthgrids
 
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...Neha Pandey
 

Último (20)

VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
 
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men 🔝mehsana🔝 Escorts...
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men  🔝mehsana🔝   Escorts...➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men  🔝mehsana🔝   Escorts...
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men 🔝mehsana🔝 Escorts...
 
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf
 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
 
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
 
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort ServiceBusty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
 
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
 
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls DubaiDubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 
Microsoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftMicrosoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck Microsoft
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
 

HitCon'14: On the Feasibility of Automatically Generating Android Component Hijacking Exploits

  • 1. On the Feasibility of Automatically Generating Android Component Hijacking Exploits Daoyuan Wu August 21, 2014 1 HitCon’14
  • 4. Related News - 3 4 Make free phone call Kill current phone call
  • 5. Background of Android Component Hijacking Vulnerability 5
  • 6. Component: The Building Block of Android Apps • An app can have four types of components: • They have their own entry points and can be activated individually. 6 Activity Broadcast Receiver Content Provider Service App
  • 7. Components can be Exposed to Other Apps • For flexible code and data sharing. • Android (mainly) uses Manifest XML file to define component exposure. 7 Twitter app Tweet UI Upload Service Camera app IMAGE_CAPTURE request Photo Exported! Camera
  • 8. Components can be Exposed to Other Apps • The Manifest XML file of Chrome: 8
  • 9. However, the confused deputy problem will occur, causing component hijacking. Because any other apps can send requests to exported components. 9
  • 10. The High-level Overview of Component Hijacking 10
  • 11. Example: The Vulnerable GoSMS Pro First reported by us on Sep 9, 2013 Let’s see how to exploit it! 11
  • 12. Go SMS Pro and Its Exported Component • Very popular – Top 1 SMS app in Google Play – Over 75 million installs • But its CellValidateService is exported – In our tested versions: 4.35 and 5.23 12
  • 13. The Code of CellValidateService 13
  • 14. Exploit CellValidateService to Send SMS • Victim code • Exploit code 14 Intent intent = new Intent(); intent.setAction(“com.xxx. ACTION_CELL_VALIDATE”); intent.putExtra(“phone”, “10086”); startService(intent); 1 2 3 4 if (“com.xxx.ACTION_CELL_VALIDATE” .equals(paramIntent.getAction())) String str1 = paramIntent.getStringExtra("phone"); Code(str1, str3);
  • 15. Demo • An attack app (with zero permission) can exploit GO SMS Pro to send SMS messages (to arbitrary phone no. specified by attackers). 15 Video link: http://youtu.be/CwtNCwAHSRs?t=25s
  • 16. Exported Components are Common in Android Apps • Statistics of top 1K apps 16
  • 17. Exported Components are Common in Android Apps • Statistics of top 1K apps 17 Launcher or Sharing Activities System broadcasts require exported components Developers’ mistakes (intent-filter or provider)
  • 19. Prior Related Work Targeted generation • “Android Permission Re- Delegation Detection and Test Case Generation” • “Detecting Passive Content Leaks and Pollution in Android Applications” • “Automatically Exploiting Potential Component Leaks in Android Applications” Random generation • “An Empirical Study of the Robustness of Inter- component Communication in Android” • Intent Fuzzer (by iSec) • Drozer (formerly Mercury) • “IntentFuzzer: Detecting Capability Leaks of Android Applications” 19
  • 20. Even an Unpublished BlackHat’14 One 20 • “Static Detection and Automatic Exploitation of Intent Message Vulnerabilities in Android Applications” – https://www.blackhat.com/us-14/briefings.html#static-detection-and-automatic-exploitation-of-intent-message-vulnerabilities-in-android-applications
  • 21. However, they are far from perfect. We argue several challenges that need to be addressed for a robust exploit generation technique. 21
  • 22. Overview of Challenges in Focus • Cross-component invocation problem – Or the Next Intent issue • Custom structure containment problem – Exploits may need to contain custom structures • Semantic constraint resolving problem – Beyond the typical numeric or string constraints • Pending Intent issue – Making exploiting Intents is a bit different 22 First pinpoi nted
  • 23. Illustrate with Real Vulnerable Apps • Cross-component invocation problem – Or the Next Intent issue – Facebook • Custom structure containment problem – Exploits may need to contain custom structures – Clean Master • Semantic constraint resolving problem – Beyond the typical numeric or string constraints – Lango Messaging • Pending Intent issue – Making exploiting Intents is a bit different – Lango Messaging 23 First pinpoi nted
  • 24. 1. The Cross-component Invocation Problem 24
  • 25. Basic Idea of Cross-component Invocation • Exported components are only the middle 25
  • 26. Exploit Facebook by Takeshi Terada •  LoginActivity  FacebookWebViewActivity 26 // create continuation_intent to call FacebookWebViewActivity. Intent contIntent = new Intent(); contIntent.setClassName(FB_PKG, FB_WEBVIEW_ACTIVITY); contIntent.putExtra("url", "file:///sdcard/attack.html"); // create intent to be sent to LoginActivity. Intent intent = new Intent(); intent.setClassName(FB_PKG, FB_LOGIN_ACTIVITY); intent.putExtra("login_redirect", false); // put continuation_intent into extra data of the intent. intent.putExtra(FB_PKG + ".continuation_intent", contIntent); this.startActivity(intent);
  • 27. How to Automatically Handle the Cross-component Invocation? • What final inputs do exported components give to you? – Maybe only an action, or better an extra field. – Best: control the whole Intent. • Which private components to select or attack? – Find the set of valuable target components. – Match the capabilities we have. 27
  • 28. 2. The Custom Structure Containment Problem 28
  • 29. Illustrate with Clean Master • Extremely popular, over 200M installs. “3.6.0” 29
  • 30. Exploit Should Contain The Custom UninstallAppData Structure 30
  • 31. But UninstallAppData is defined by Victim App Option 1: • Decompile the victim app, and obtain the source code of the UninstallAppData structure. • But this is not reliable – Imperfect to decompile Option 2: • Mimic the skeleton of target structure • “Part of source code” – Field definition – Interface functions • But complicated, and still may fail. 31
  • 32. The First Version of Target Structure 32
  • 33. The Second Version of Exploit 33
  • 34. The Second Version of Target Structure 34 If not implemented:
  • 35. Mash Up must Use the Same Class Path 35 The correct class path should be: com.ijinshan.cleaner.bean.UninstallAppData
  • 36. 3. Semantic Constraint Resolving Problem 36
  • 37. Illustrate with Lango Messaging • Once over 1M installs, the latest version 37 Attack Consequence: inbox SMS  sent SMS
  • 38. ZmsSentReceiver in Lango Messaging • How to resolve such semantic constraints? if (localMessageItem.getBoxId() != 2) 38
  • 39. Exploit Requires Domain Knowledge • Very different from typical hijacking exploits: 39
  • 40. Even Under Brute-force Attempts • Suppose the target uri is: 40 content://sms/121 This field can be brute forced. But still require pre knowledge to set up a valid data Pre knowledge is required! (1) Use model to pinpoint “sms” (2) Cover the common uris, “contact” But no guarantee
  • 41. 4. Pending Intent Issue 41
  • 42. What is getResultCode() for? 42 Retrieve the current result code, as set by the previous receiver.
  • 43. See how SMS is sent 43 sms.sendTextMessage(phoneNumber, null, message, sentPI, deliveredPI); PendingIntent sentPI = PendingIntent.getBroadcast(context, 0, new Intent(SENT), 0); PendingIntent deliveredPI = PendingIntent.getBroadcast(context, 0, new Intent(DELIVERED), 0); The intents in sentPI or deliveredPI will be broadcasted after the invocation of sendTextMessage(), and they contain the corresponding result codes.
  • 44. The Rest of Exploit for Lango • Invoke PendingIntent.send() to trigger its broadcast, as well as setting result codes. 44
  • 45. Conclusion • My opinion: 45 Challenge Automatic? Note Cross-component But not easy Custom structure May fail Semantic constraint Pre knowledge Pending intent Need to handle
  • 46. Thanks & Comments? http://www.linkedin.com/in/daoyuan PPT: http://www.slideshare.net/daoyuan0x Demo code: https://github.com/daoyuan14 46