SlideShare a Scribd company logo
1 of 32
Download to read offline
Android Hax



    Jon Oberheide
  jon@oberheide.org

 Jon Oberheide - Android Hax - SummerCon 2010   Slide # 1
Agenda


 • Android Security Overview

 • Market and the Mystical GTalkService

 • The RootStrap PDP

 • Wrap-Up / Q&A



           Jon Oberheide - Android Hax - SummerCon 2010   Slide # 2
Android Overview

•
    Base platform
     •
       ARM core
     •
       Linux 2.6.3x kernel
•
    Native Libraries
     •
       libc, WebKit, etc
•
    Dalvik VM
     •
       Register-based VM
     •
       Runs dex bytecode
•
    Applications
     •
       Developed in Java
     •
       Runs on Dalvik VM
     •
       Linux process 1-1

                       Jon Oberheide - Android Hax - SummerCon 2010
Hardware Features

 ●
     ARM11 TrustZone?
      ●
        Unused!

 ●
     ARM11 Jazelle JVM?
      ●
        Unused!

 ●
     ARMv6 eXecute-Never (XN)?
      ●
        Unused!


                Jon Oberheide - Android Hax - SummerCon 2010
Linux Environment




Executable                                                   Non-
stack/heap!                                                  randomized
                 Mobile ASLR sucks.                          mmap/brk!

              Jon Oberheide - Android Hax - SummerCon 2010
Permission-Based Model

 ●
     Apps explicitly request
     pre-defined permissions
 ●
     Examples:
     ●
         Cellular: calls, SMS, MMS
     ●
         Network, bluetooth, wifi
     ●
         Hardware settings: vibrate,
         backlight, etc
     ●
         Location: coarse/fine
     ●
         App data: contacts, calendar


                   Jon Oberheide - Android Hax - SummerCon 2010
App Sandboxing

  ●
      “Sandboxed” by standard UNIX uid/gid
       ●
           generated unique per app at install




  ●
      High-level permissions restricted by
      Android runtime framework

                    Jon Oberheide - Android Hax - SummerCon 2010
App Distribution


   ●
       Application signing
        ●
            No CAs
        ●
            Self-signed by developers


   ●
       Android Market
        ●
            $25 signup, anyone can publish
        ●
            Anonymous sign-up possible



                    Jon Oberheide - Android Hax - SummerCon 2010
App Piracy


      ●
          Trivial copy protection provided by market


Off?                                                                On?
 ●
     Apps stored                                                    ●
                                                                        Apps stored in
     in /data/app/                                                      /data/app-private/
 ●
     Accessible to                                                  ●
                                                                        Only accessible
     users                                                              if rooted phone




                     Jon Oberheide - Android Hax - SummerCon 2010
Agenda


 • Android Security Overview

 • Market and the Mystical GTalkService

 • The RootStrap PDP

 • Wrap-Up / Q&A



           Jon Oberheide - Android Hax - SummerCon 2010   Slide # 10
Perceived Market Flow




BROWSE    INSTALL                          PAY           INSTALLED!
          Jon Oberheide - Android Hax - SummerCon 2010        Slide # 11
ACTUAL Market Flow


 • Google is a sneaky panda!
   – You don't actually download / install the app
     through the market application

 • When you click install in market app
   – Google servers push an out-of-band message
     down to you via persistent data connection
   – Triggers INSTALL_ASSET intent to start install
   – Intent handler fetches APK and installs


               Jon Oberheide - Android Hax - SummerCon 2010   Slide # 12
Dex Bytecode RE




         Jon Oberheide - Android Hax - SummerCon 2010   Slide # 13
GTalkService Connection


  • Persistent data connection
    – Speaks XMPP
    – Same connection now used for
      C2DM push service
  • It's SSL, but...
  • If you MITM or C2DM spoof
    – Remote intent / app install
  • If you pop GTalkService servers
    – Push down code to all Android phones in the world?
                Jon Oberheide - Android Hax - SummerCon 2010   Slide # 14
Jon Oberheide - Android Hax - SummerCon 2010   Slide # 15
Jon Oberheide - Android Hax - SummerCon 2010   Slide # 16
Jon Oberheide - Android Hax - SummerCon 2010   Slide # 17
Jon Oberheide - Android Hax - SummerCon 2010   Slide # 18
Disclaimer




  • Useful though if you want to fetch a
    large amount of apps and do some
    fuzzing, analysis, whatever
    – I've got a repo of ~10k apps

              Jon Oberheide - Android Hax - SummerCon 2010   Slide # 19
Agenda


 • Android Security Overview

 • Market and the Mystical GTalkService

 • The RootStrap PDP

 • Wrap-Up / Q&A



           Jon Oberheide - Android Hax - SummerCon 2010   Slide # 20
Android Native Code

  • Dalvik VM != sandbox
    – Not limited to executing dex bytecode
    – Can pop out of the VM to execute native code
  • Linux kernel = swiss cheese
    – Wonderful attack surface
    – Any 3rd party app can root your phone by exploiting a
      kernel vulnerability via native code
  • Native code packaged within APKs
    – But why limit execution of native code to build-time
      packaged modules?
                Jon Oberheide - Android Hax - SummerCon 2010   Slide # 21
RootStrap


  • Enter, RootStrap
    – Silent runtime fetching and execution of remote
      ARM payloads
    – Not really a bot..more of a general purpose
      distributed computing platform ;-)

  • Currently available
    in Android market

              Jon Oberheide - Android Hax - SummerCon 2010   Slide # 22
RootStrap Example




         Jon Oberheide - Android Hax - SummerCon 2010   Slide # 23
Native ARM Code Delivery

  • Fetch index file
    – Lists available exploits and module names
    – http://jon.oberheide.org/rootstrap/index
  • Yank down ARM modules
    – Dumped to Android app private storage
    – eg. /data/data/org.rootstrap/files, not ./libs
  • Load via JNI and execute each payload
    – System.load(“.../files/root1.so”);
    – result = root1();



                  Jon Oberheide - Android Hax - SummerCon 2010   Slide # 24
How to Build a Mobile Botnet

  • Build some fun legit-looking games / apps
    – Include RootStrap functionality
    – Periodically phone home to check for new payloads

  • As soon as new kernel vuln discovered, push
    out exploit payload
    – Before providers push out OTA patch
    – Trivial to win that race, slow OTA updates

  • Rootkit a bunch of phones!
                Jon Oberheide - Android Hax - SummerCon 2010   Slide # 25
A Wolf in Vampire's Clothing?


  • RootStrap app is boring and not sneaky
    – No one would intentionally download it
    – Need something legit looking to get a
      significant install base

  • How about an RootStrap-enabled app
    claiming to be a preview for the upcoming
    Twilight Eclipse movie?!?

              Jon Oberheide - Android Hax - SummerCon 2010   Slide # 26
Fake Twilight Eclipse App




          Jon Oberheide - Android Hax - SummerCon 2010   Slide # 27
Andy and Jaime Don't Like It :-(


                                            • Still, 200+ downloads
                                                 in under 24 hours

                                            • With a legit-looking
                                                 app/game, you could
                                                 collect quite an install
                                                 base for RootStrap


           Jon Oberheide - Android Hax - SummerCon 2010           Slide # 28
RootStrap Payloads


  • sock_sendpage NULL deref
    – Old, but still works on some phones
    – fork/execve from JNI is a bit wacky


  • Supervisor App vulns?
    – su without approval
    – “jailbroken” phone is less safe

  • Meterpretux?
                Jon Oberheide - Android Hax - SummerCon 2010   Slide # 29
Agenda


 • Android Security Overview

 • Market and the Mystical GTalkService

 • The RootStrap PDP

 • Wrap-Up / Q&A



           Jon Oberheide - Android Hax - SummerCon 2010   Slide # 30
Wrap-Up



 • Native code support sucks.
   – Not so easy to take away
   – Build-time signing / loader verification?
 • Android homework
   –   Poke at the GTalkService code paths
   –   Write some RootStrap payloads
   –   Port to other platforms?
   –   Fuzz the new Android Acrobat app!
                Jon Oberheide - Android Hax - SummerCon 2010   Slide # 31
Q&A



      QUESTIONS?
            Jon Oberheide
           @jonoberheide
         jon@oberheide.org
       http://jon.oberheide.org



      Jon Oberheide - Android Hax - SummerCon 2010   Slide # 32

More Related Content

Viewers also liked

My presentation on Android in my college
My presentation on Android in my collegeMy presentation on Android in my college
My presentation on Android in my collegeSneha Lata
 
Android seminar-presentation
Android seminar-presentationAndroid seminar-presentation
Android seminar-presentationconnectshilpa
 
Presentation on Android operating system
Presentation on Android operating systemPresentation on Android operating system
Presentation on Android operating systemSalma Begum
 

Viewers also liked (6)

My presentation on Android in my college
My presentation on Android in my collegeMy presentation on Android in my college
My presentation on Android in my college
 
Android seminar ppt
Android seminar pptAndroid seminar ppt
Android seminar ppt
 
Android seminar-presentation
Android seminar-presentationAndroid seminar-presentation
Android seminar-presentation
 
Android ppt
Android pptAndroid ppt
Android ppt
 
Presentation on Android operating system
Presentation on Android operating systemPresentation on Android operating system
Presentation on Android operating system
 
Android ppt
Android ppt Android ppt
Android ppt
 

Similar to Android Hax

Android Jumpstart ESC SV 2012 Part I
Android Jumpstart ESC SV 2012 Part IAndroid Jumpstart ESC SV 2012 Part I
Android Jumpstart ESC SV 2012 Part IOpersys inc.
 
Embedded Android Workshop at Embedded Linux Conference Europe 2011
Embedded Android Workshop at Embedded Linux Conference Europe 2011Embedded Android Workshop at Embedded Linux Conference Europe 2011
Embedded Android Workshop at Embedded Linux Conference Europe 2011Opersys inc.
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowKarim Yaghmour
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowOpersys inc.
 
Embedded Android Workshop at Android Open 2011
Embedded Android Workshop at Android Open 2011Embedded Android Workshop at Android Open 2011
Embedded Android Workshop at Android Open 2011Opersys inc.
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowOpersys inc.
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android WorkshopOpersys inc.
 
Android beyond the smartphone
Android beyond the smartphoneAndroid beyond the smartphone
Android beyond the smartphoneChris Simmonds
 
Embedded Android Workshop with Lollipop
Embedded Android Workshop with LollipopEmbedded Android Workshop with Lollipop
Embedded Android Workshop with LollipopOpersys inc.
 
Embedded Android Workshop at AnDevConII
Embedded Android Workshop at AnDevConIIEmbedded Android Workshop at AnDevConII
Embedded Android Workshop at AnDevConIIOpersys inc.
 
Embedded Android Workshop at Embedded World Conference 2013
Embedded Android Workshop at Embedded World Conference 2013Embedded Android Workshop at Embedded World Conference 2013
Embedded Android Workshop at Embedded World Conference 2013Opersys inc.
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowOpersys inc.
 
Embedded Android Workshop / ELC 2013
Embedded Android Workshop / ELC 2013Embedded Android Workshop / ELC 2013
Embedded Android Workshop / ELC 2013Opersys inc.
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with NougatOpersys inc.
 
Embedded Android Workshop at ELC Europe
Embedded Android Workshop at ELC EuropeEmbedded Android Workshop at ELC Europe
Embedded Android Workshop at ELC EuropeOpersys inc.
 
Android jumpstart at ESC Boston 2011
Android jumpstart at ESC Boston 2011Android jumpstart at ESC Boston 2011
Android jumpstart at ESC Boston 2011Opersys inc.
 
Droidcon 2013 france - The Growth of Android in Embedded Systems
Droidcon 2013 france - The Growth of Android in Embedded SystemsDroidcon 2013 france - The Growth of Android in Embedded Systems
Droidcon 2013 france - The Growth of Android in Embedded SystemsBenjamin Zores
 
Embedded Android Workshop with Oreo
Embedded Android Workshop with OreoEmbedded Android Workshop with Oreo
Embedded Android Workshop with OreoOpersys inc.
 
Embedded Android Workshop with Lollipop
Embedded Android Workshop with LollipopEmbedded Android Workshop with Lollipop
Embedded Android Workshop with LollipopOpersys inc.
 
Embedded Android Workshop at AnDevCon IV
Embedded Android Workshop at AnDevCon IVEmbedded Android Workshop at AnDevCon IV
Embedded Android Workshop at AnDevCon IVOpersys inc.
 

Similar to Android Hax (20)

Android Jumpstart ESC SV 2012 Part I
Android Jumpstart ESC SV 2012 Part IAndroid Jumpstart ESC SV 2012 Part I
Android Jumpstart ESC SV 2012 Part I
 
Embedded Android Workshop at Embedded Linux Conference Europe 2011
Embedded Android Workshop at Embedded Linux Conference Europe 2011Embedded Android Workshop at Embedded Linux Conference Europe 2011
Embedded Android Workshop at Embedded Linux Conference Europe 2011
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with Marshmallow
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with Marshmallow
 
Embedded Android Workshop at Android Open 2011
Embedded Android Workshop at Android Open 2011Embedded Android Workshop at Android Open 2011
Embedded Android Workshop at Android Open 2011
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with Marshmallow
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android Workshop
 
Android beyond the smartphone
Android beyond the smartphoneAndroid beyond the smartphone
Android beyond the smartphone
 
Embedded Android Workshop with Lollipop
Embedded Android Workshop with LollipopEmbedded Android Workshop with Lollipop
Embedded Android Workshop with Lollipop
 
Embedded Android Workshop at AnDevConII
Embedded Android Workshop at AnDevConIIEmbedded Android Workshop at AnDevConII
Embedded Android Workshop at AnDevConII
 
Embedded Android Workshop at Embedded World Conference 2013
Embedded Android Workshop at Embedded World Conference 2013Embedded Android Workshop at Embedded World Conference 2013
Embedded Android Workshop at Embedded World Conference 2013
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with Marshmallow
 
Embedded Android Workshop / ELC 2013
Embedded Android Workshop / ELC 2013Embedded Android Workshop / ELC 2013
Embedded Android Workshop / ELC 2013
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with Nougat
 
Embedded Android Workshop at ELC Europe
Embedded Android Workshop at ELC EuropeEmbedded Android Workshop at ELC Europe
Embedded Android Workshop at ELC Europe
 
Android jumpstart at ESC Boston 2011
Android jumpstart at ESC Boston 2011Android jumpstart at ESC Boston 2011
Android jumpstart at ESC Boston 2011
 
Droidcon 2013 france - The Growth of Android in Embedded Systems
Droidcon 2013 france - The Growth of Android in Embedded SystemsDroidcon 2013 france - The Growth of Android in Embedded Systems
Droidcon 2013 france - The Growth of Android in Embedded Systems
 
Embedded Android Workshop with Oreo
Embedded Android Workshop with OreoEmbedded Android Workshop with Oreo
Embedded Android Workshop with Oreo
 
Embedded Android Workshop with Lollipop
Embedded Android Workshop with LollipopEmbedded Android Workshop with Lollipop
Embedded Android Workshop with Lollipop
 
Embedded Android Workshop at AnDevCon IV
Embedded Android Workshop at AnDevCon IVEmbedded Android Workshop at AnDevCon IV
Embedded Android Workshop at AnDevCon IV
 

Recently uploaded

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 

Recently uploaded (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 

Android Hax

  • 1. Android Hax Jon Oberheide jon@oberheide.org Jon Oberheide - Android Hax - SummerCon 2010 Slide # 1
  • 2. Agenda • Android Security Overview • Market and the Mystical GTalkService • The RootStrap PDP • Wrap-Up / Q&A Jon Oberheide - Android Hax - SummerCon 2010 Slide # 2
  • 3. Android Overview • Base platform • ARM core • Linux 2.6.3x kernel • Native Libraries • libc, WebKit, etc • Dalvik VM • Register-based VM • Runs dex bytecode • Applications • Developed in Java • Runs on Dalvik VM • Linux process 1-1 Jon Oberheide - Android Hax - SummerCon 2010
  • 4. Hardware Features ● ARM11 TrustZone? ● Unused! ● ARM11 Jazelle JVM? ● Unused! ● ARMv6 eXecute-Never (XN)? ● Unused! Jon Oberheide - Android Hax - SummerCon 2010
  • 5. Linux Environment Executable Non- stack/heap! randomized Mobile ASLR sucks. mmap/brk! Jon Oberheide - Android Hax - SummerCon 2010
  • 6. Permission-Based Model ● Apps explicitly request pre-defined permissions ● Examples: ● Cellular: calls, SMS, MMS ● Network, bluetooth, wifi ● Hardware settings: vibrate, backlight, etc ● Location: coarse/fine ● App data: contacts, calendar Jon Oberheide - Android Hax - SummerCon 2010
  • 7. App Sandboxing ● “Sandboxed” by standard UNIX uid/gid ● generated unique per app at install ● High-level permissions restricted by Android runtime framework Jon Oberheide - Android Hax - SummerCon 2010
  • 8. App Distribution ● Application signing ● No CAs ● Self-signed by developers ● Android Market ● $25 signup, anyone can publish ● Anonymous sign-up possible Jon Oberheide - Android Hax - SummerCon 2010
  • 9. App Piracy ● Trivial copy protection provided by market Off? On? ● Apps stored ● Apps stored in in /data/app/ /data/app-private/ ● Accessible to ● Only accessible users if rooted phone Jon Oberheide - Android Hax - SummerCon 2010
  • 10. Agenda • Android Security Overview • Market and the Mystical GTalkService • The RootStrap PDP • Wrap-Up / Q&A Jon Oberheide - Android Hax - SummerCon 2010 Slide # 10
  • 11. Perceived Market Flow BROWSE INSTALL PAY INSTALLED! Jon Oberheide - Android Hax - SummerCon 2010 Slide # 11
  • 12. ACTUAL Market Flow • Google is a sneaky panda! – You don't actually download / install the app through the market application • When you click install in market app – Google servers push an out-of-band message down to you via persistent data connection – Triggers INSTALL_ASSET intent to start install – Intent handler fetches APK and installs Jon Oberheide - Android Hax - SummerCon 2010 Slide # 12
  • 13. Dex Bytecode RE Jon Oberheide - Android Hax - SummerCon 2010 Slide # 13
  • 14. GTalkService Connection • Persistent data connection – Speaks XMPP – Same connection now used for C2DM push service • It's SSL, but... • If you MITM or C2DM spoof – Remote intent / app install • If you pop GTalkService servers – Push down code to all Android phones in the world? Jon Oberheide - Android Hax - SummerCon 2010 Slide # 14
  • 15. Jon Oberheide - Android Hax - SummerCon 2010 Slide # 15
  • 16. Jon Oberheide - Android Hax - SummerCon 2010 Slide # 16
  • 17. Jon Oberheide - Android Hax - SummerCon 2010 Slide # 17
  • 18. Jon Oberheide - Android Hax - SummerCon 2010 Slide # 18
  • 19. Disclaimer • Useful though if you want to fetch a large amount of apps and do some fuzzing, analysis, whatever – I've got a repo of ~10k apps Jon Oberheide - Android Hax - SummerCon 2010 Slide # 19
  • 20. Agenda • Android Security Overview • Market and the Mystical GTalkService • The RootStrap PDP • Wrap-Up / Q&A Jon Oberheide - Android Hax - SummerCon 2010 Slide # 20
  • 21. Android Native Code • Dalvik VM != sandbox – Not limited to executing dex bytecode – Can pop out of the VM to execute native code • Linux kernel = swiss cheese – Wonderful attack surface – Any 3rd party app can root your phone by exploiting a kernel vulnerability via native code • Native code packaged within APKs – But why limit execution of native code to build-time packaged modules? Jon Oberheide - Android Hax - SummerCon 2010 Slide # 21
  • 22. RootStrap • Enter, RootStrap – Silent runtime fetching and execution of remote ARM payloads – Not really a bot..more of a general purpose distributed computing platform ;-) • Currently available in Android market Jon Oberheide - Android Hax - SummerCon 2010 Slide # 22
  • 23. RootStrap Example Jon Oberheide - Android Hax - SummerCon 2010 Slide # 23
  • 24. Native ARM Code Delivery • Fetch index file – Lists available exploits and module names – http://jon.oberheide.org/rootstrap/index • Yank down ARM modules – Dumped to Android app private storage – eg. /data/data/org.rootstrap/files, not ./libs • Load via JNI and execute each payload – System.load(“.../files/root1.so”); – result = root1(); Jon Oberheide - Android Hax - SummerCon 2010 Slide # 24
  • 25. How to Build a Mobile Botnet • Build some fun legit-looking games / apps – Include RootStrap functionality – Periodically phone home to check for new payloads • As soon as new kernel vuln discovered, push out exploit payload – Before providers push out OTA patch – Trivial to win that race, slow OTA updates • Rootkit a bunch of phones! Jon Oberheide - Android Hax - SummerCon 2010 Slide # 25
  • 26. A Wolf in Vampire's Clothing? • RootStrap app is boring and not sneaky – No one would intentionally download it – Need something legit looking to get a significant install base • How about an RootStrap-enabled app claiming to be a preview for the upcoming Twilight Eclipse movie?!? Jon Oberheide - Android Hax - SummerCon 2010 Slide # 26
  • 27. Fake Twilight Eclipse App Jon Oberheide - Android Hax - SummerCon 2010 Slide # 27
  • 28. Andy and Jaime Don't Like It :-( • Still, 200+ downloads in under 24 hours • With a legit-looking app/game, you could collect quite an install base for RootStrap Jon Oberheide - Android Hax - SummerCon 2010 Slide # 28
  • 29. RootStrap Payloads • sock_sendpage NULL deref – Old, but still works on some phones – fork/execve from JNI is a bit wacky • Supervisor App vulns? – su without approval – “jailbroken” phone is less safe • Meterpretux? Jon Oberheide - Android Hax - SummerCon 2010 Slide # 29
  • 30. Agenda • Android Security Overview • Market and the Mystical GTalkService • The RootStrap PDP • Wrap-Up / Q&A Jon Oberheide - Android Hax - SummerCon 2010 Slide # 30
  • 31. Wrap-Up • Native code support sucks. – Not so easy to take away – Build-time signing / loader verification? • Android homework – Poke at the GTalkService code paths – Write some RootStrap payloads – Port to other platforms? – Fuzz the new Android Acrobat app! Jon Oberheide - Android Hax - SummerCon 2010 Slide # 31
  • 32. Q&A QUESTIONS? Jon Oberheide @jonoberheide jon@oberheide.org http://jon.oberheide.org Jon Oberheide - Android Hax - SummerCon 2010 Slide # 32