Jailbreaking iOS
  How an iPhone breaks free




             Kai Aras - CSM
       Stuttgart Media University
What is iOS ?


•   Apples Operating System for iPhone, iPodTouch and iPad

•   Based on Mac OSX

•   Latest release 4.2.1
What is a Jailbreak ?
What is a Jailbreak ?

•   removes certain security mechanisms to allow installation and
    distribution of untrusted 3rd party applications.
What is a Jailbreak ?

•   removes certain security mechanisms to allow installation and
    distribution of untrusted 3rd party applications.

•   patches code signing to achieve unsigned code execution
What is a Jailbreak ?

•   removes certain security mechanisms to allow installation and
    distribution of untrusted 3rd party applications.

•   patches code signing to achieve unsigned code execution

•   makes you play angry birds for free...
Why does it exist ?

•   Closed Platform

•   Software Distribution controlled by Apple (walled garden)

•   3rd party developers cannot modify system components

•   3rd party developers can only use public APIs

•   people enjoy hacking things ;)
What about the name - Jailbreak ?


•   seems to be originated in first hackers breaking out of the so called
    chroot jail.
What can be done with a JB ?
What can be done with a JB ?
•   Install software that is unsupported by Apple.
What can be done with a JB ?
•   Install software that is unsupported by Apple.

    •   Apps, Addons, Themes
What can be done with a JB ?
•   Install software that is unsupported by Apple.

    •   Apps, Addons, Themes

•   Activate the Device (unofficial carriers)
What can be done with a JB ?
•   Install software that is unsupported by Apple.

    •   Apps, Addons, Themes

•   Activate the Device (unofficial carriers)

•   Unlock the device.
What can be done with a JB ?
•   Install software that is unsupported by Apple.

    •   Apps, Addons, Themes

•   Activate the Device (unofficial carriers)

•   Unlock the device.

•   Do custom development that requires deeper system integration.
What can be done with a JB ?
•   Install software that is unsupported by Apple.

    •   Apps, Addons, Themes

•   Activate the Device (unofficial carriers)

•   Unlock the device.

•   Do custom development that requires deeper system integration.

•   Install pirated software ☹
A state of the art prison
    iOS Hardware and Software Design
iOS Hardware Architecture
iOS Hardware Architecture
        Application Processor
iOS Hardware Architecture
        Application Processor
                                iOS
                                User interaction
                                  Applications
                                       ...
iOS Hardware Architecture
        Application Processor
                                iOS
                                User interaction
                                  Applications
                                       ...
         Baseband Processor
iOS Hardware Architecture
        Application Processor
                                iOS
                                User interaction
                                  Applications
                                       ...
         Baseband Processor

                                NucleusOS
                                Radio communication
iOS Hardware
                           Architecture
     audio                                             WIFI

    display                                                BT

    camera                                             GSM

  Application Processor               Baseband Processor
                              UART

                               I2S
                              GPIO
                              DMA
power managment
iOS Hardware
                           Architecture
     audio                                                      WIFI

    display                                                         BT

    camera                                                      GSM

  Application Processor                        Baseband Processor
                              UART

                               I2S
                              GPIO
                              DMA
                                        controls
power managment
                                     sim/net-lock !
iOS Security Architecture
iOS Security Architecture

•   Sandboxing
iOS Security Architecture

•   Sandboxing

•   Memory protection
iOS Security Architecture

•   Sandboxing

•   Memory protection

•   Code signing
iOS Security Architecture

•   Sandboxing

•   Memory protection

•   Code signing

•   Encryption
Sandboxing

•   NAND Flash

•   FTL : converts logical partitions to NAND flash architecture

•   looks like Block Device                     / (RO)
                                           (System Partition)
                                                                     /private/var (RW)
                                                                          (User Partition)



•   System Partition / (RO)                                     Block Device

    User Partition /private/var                                     FTL

                                                                  NAND
Sandboxing
                                               / (RO)               /private/var (RW)

•
                                          (System Partition)             (User Partition)
    System Partition read only
                                                               Block Device

•   3rd party lives on user partition                              FTL

•   Apps run as mobile user                                      NAND


•   Kernel signature checks executables in systemcall execve()
Memory Protection

•   W^X Policy

    •   a page is either writable or executable but never both!

•   Non-executable stack & heap

•   No ASLR! -> ROP
Code Signing

•   implemented inside the Kernel

•   Kernel signature checks executables in systemcall execve()

•   Kernel stored on System Partition (kernelcache)

•   Kernel is signature checked before being loaded.
Encryption

•   Everything is encrypted

•   Hardware AES Engine

•   Keys derived from hardware keys GID-key UID-key

•   Possible to use Jailbreak tools e.g. Syringe to use the hardware engine
iOS Boot Sequence


•   Normal Boot

•   Recovery Mode

•   DFU Mode
Normal Boot


                        LLB
Bootrom               (Low Level                iBoot               Kernel               Application
                      Bootloader)


                       NOR                      NOR                 NAND                  NAND
          signature                 signature           signature            signature
            check                     check               check                check
DFU Mode
            LLB
Bootrom   (Low Level               iBoot   Kernel    Application
          Bootloader)
                        minimal
                         iBoot




Bootrom     iBSS                   iBEC    Kernel


                                           Ramdisk
Recovery Mode

                        LLB
Bootrom               (Low Level                iBoot   Kernel
                      Bootloader)




          signature                 signature           Kernel
            check                     check


                                                        Ramdisk
Attacking the chain of trust


                        LLB                                                               System
Bootrom               (Low Level                iBoot               Kernel                                      Application
                      Bootloader)                                                        Software


          signature                 signature           signature            signature              signature
            check                     check               check                check                  check
Attacking the chain of trust
attack here




                            LLB                                                               System
Bootrom                   (Low Level                iBoot               Kernel                                      Application
                          Bootloader)                                                        Software


              signature                 signature           signature            signature              signature
                check                     check               check                check                  check
Attacking the chain of trust
(cannot be fixed)

  attack here




                                 LLB                                                               System
 Bootrom                       (Low Level                iBoot               Kernel                                      Application
                               Bootloader)                                                        Software


                   signature                 signature           signature            signature              signature
                     check                     check               check                check                  check
Attacking the chain of trust
(cannot be fixed)

  attack here                                            attack here




                                 LLB                                                                     System
 Bootrom                       (Low Level                  iBoot                   Kernel                                      Application
                               Bootloader)                                                              Software


                   signature                 signature                 signature            signature              signature
                     check                     check                     check                check                  check
Attacking the chain of trust
(cannot be fixed)

  attack here                                            attack here               attack here




                                 LLB                                                                          System
 Bootrom                       (Low Level                  iBoot                    Kernel                                          Application
                               Bootloader)                                                                   Software


                   signature                 signature                 signature                 signature              signature
                     check                     check                     check                     check                  check
Attacking the chain of trust
(cannot be fixed)

  attack here                                            attack here               attack here                                       attack here




                                 LLB                                                                          System
 Bootrom                       (Low Level                  iBoot                    Kernel                                          Application
                               Bootloader)                                                                   Software


                   signature                 signature                 signature                 signature              signature
                     check                     check                     check                     check                  check
Breaking free


                        LLB                                                               System
Bootrom               (Low Level                iBoot               Kernel                                      Application
                      Bootloader)                                                        Software


          signature                 signature           signature            signature              signature
            check                     check               check                check                  check
Breaking free
1. Patch out all the signature checks



                         LLB                                                               System
 Bootrom               (Low Level                iBoot               Kernel                                      Application
                       Bootloader)                                                        Software


           signature                 signature           signature            signature              signature
             check                     check               check                check                  check
Breaking free
1. Patch out all the signature checks
2. Install Cydia to manage unsigned 3rd                                                                            Cydia
            party applications
                         LLB                                                               System
 Bootrom               (Low Level                iBoot               Kernel                                      Application
                       Bootloader)                                                        Software


           signature                 signature           signature            signature              signature
             check                     check               check                check                  check
How it’s done
How it’s done

•   exploit code-execution vulnerability to deploy and execute jailbreak-
    payload
How it’s done

•   exploit code-execution vulnerability to deploy and execute jailbreak-
    payload

•   execute payload, if required gain root by exploiting privilege escalation
    vulnerability
How it’s done

•   exploit code-execution vulnerability to deploy and execute jailbreak-
    payload

•   execute payload, if required gain root by exploiting privilege escalation
    vulnerability

•   patch LLB, iBoot and Kernel to remove signature checks
How it’s done

•   exploit code-execution vulnerability to deploy and execute jailbreak-
    payload

•   execute payload, if required gain root by exploiting privilege escalation
    vulnerability

•   patch LLB, iBoot and Kernel to remove signature checks

•   install cydia to allow installation of unsigned 3rd party applications.
Star (jailbreakme.com)
Star (jailbreakme.com)

•   Web based Jailbreak
Star (jailbreakme.com)

•   Web based Jailbreak

•   Injection Vector: Userland Process (via HTTP)
Star (jailbreakme.com)

•   Web based Jailbreak

•   Injection Vector: Userland Process (via HTTP)

•   first exploits CFF Font Parser (via PDF) in Mobile Safari
Star (jailbreakme.com)

•   Web based Jailbreak

•   Injection Vector: Userland Process (via HTTP)

•   first exploits CFF Font Parser (via PDF) in Mobile Safari

•   then exploits IOSurface Kernel extension (via ROP)
Star                                    1

                                   Payload 1
                    2

                Payload 2                     3

                                     Mobile
                                     Safari
                    6              PDF CFF Font
                                      Parser      4
                                                       7
                         System    Applicatio
   iBoot   Kernel                                     Cydia
                        Software       n




                                        5
Star                                    1

                                                                Payload 1
                                                 2

1. Payload1: Malformed PDF                   Payload 2                     3

                                                                  Mobile
                                                                  Safari
                                                 6              PDF CFF Font
                                                                   Parser      4
                                                                                    7
                                                      System    Applicatio
                                iBoot   Kernel                                     Cydia
                                                     Software       n




                                                                     5
Star                                    1

                                                                Payload 1
                                                 2

1. Payload1: Malformed PDF                   Payload 2                     3

                                                                  Mobile
2. Payload2: Post Install                                         Safari
                                                 6              PDF CFF Font
                                                                   Parser      4
                                                                                    7
                                                      System    Applicatio
                                iBoot   Kernel                                     Cydia
                                                     Software       n




                                                                     5
Star                                    1

                                                                 Payload 1
                                                  2

1. Payload1: Malformed PDF                    Payload 2                     3

                                                                   Mobile
2. Payload2: Post Install                                          Safari
                                                  6              PDF CFF Font
                                                                    Parser      4
3. Deploy Payload1 via HTTP                                                          7
                                                       System    Applicatio
                                 iBoot   Kernel                                     Cydia
                                                      Software       n




                                                                      5
Star                                    1

                                                                 Payload 1
                                                  2

1. Payload1: Malformed PDF                    Payload 2                     3

                                                                   Mobile
2. Payload2: Post Install                                          Safari
                                                  6              PDF CFF Font
                                                                    Parser      4
3. Deploy Payload1 via HTTP                                                          7
                                                       System    Applicatio
                                 iBoot   Kernel                                     Cydia
                                                      Software       n
4. Exploit Userland Process

                                                                      5
Star                                            1

                                                                            Payload 1
                                                             2

1. Payload1: Malformed PDF                               Payload 2                     3

                                                                              Mobile
2. Payload2: Post Install                                                     Safari
                                                             6              PDF CFF Font
                                                                               Parser      4
3. Deploy Payload1 via HTTP                                                                     7
                                                                  System    Applicatio
                                            iBoot   Kernel                                     Cydia
                                                                 Software       n
4. Exploit Userland Process
5. Exploit Kernel to gain root privileges                                        5
Star                                            1

                                                                            Payload 1
                                                             2

1. Payload1: Malformed PDF                               Payload 2                     3

                                                                              Mobile
2. Payload2: Post Install                                                     Safari
                                                             6              PDF CFF Font
                                                                               Parser      4
3. Deploy Payload1 via HTTP                                                                     7
                                                                  System    Applicatio
                                            iBoot   Kernel                                     Cydia
                                                                 Software       n
4. Exploit Userland Process
5. Exploit Kernel to gain root privileges                                        5


6. Download Payload2
Star                                          1

                                                                            Payload 1
                                                             2

1. Payload1: Malformed PDF                               Payload 2                     3

                                                                              Mobile
2. Payload2: Post Install                                                     Safari
                                                             6              PDF CFF Font
                                                                               Parser      4
3. Deploy Payload1 via HTTP                                                                     7
                                                                  System    Applicatio
                                            iBoot   Kernel                                     Cydia
                                                                 Software       n
4. Exploit Userland Process
5. Exploit Kernel to gain root privileges                                        5


6. Download Payload2
7. Install libraries and install Cydia
greenpois0n
greenpois0n

•   PC based Jailbreak
greenpois0n

•   PC based Jailbreak

•   also Jailbreak Toolkit (Syringe, Cyanide, Anthrax...*)
greenpois0n

•   PC based Jailbreak

•   also Jailbreak Toolkit (Syringe, Cyanide, Anthrax...*)

•   exploits Bootrom vulnerability (limera1n exploit)
greenpois0n

•   PC based Jailbreak

•   also Jailbreak Toolkit (Syringe, Cyanide, Anthrax...*)

•   exploits Bootrom vulnerability (limera1n exploit)

•   then exploits Kernel vulnerability (undisclosed exploit)
greenpois0n

•   PC based Jailbreak

•   also Jailbreak Toolkit (Syringe, Cyanide, Anthrax...*)

•   exploits Bootrom vulnerability (limera1n exploit)

•   then exploits Kernel vulnerability (undisclosed exploit)

•   Injection vector: Bootloader communication (DFU Mode)
greenpois0n
      Bootrom    iBSS




                 iBSS
                Payload




                 iBoot    Kernel


                          Ramdisk

                           Loader.app
greenpois0n
1.   exploit bootrom vulnerability
                                     Bootrom    iBSS




                                                iBSS
                                               Payload




                                                iBoot    Kernel


                                                         Ramdisk

                                                          Loader.app
greenpois0n
1.   exploit bootrom vulnerability
                                     Bootrom    iBSS
2.   upload iBSS



                                                iBSS
                                               Payload




                                                iBoot    Kernel


                                                         Ramdisk

                                                          Loader.app
greenpois0n
1.   exploit bootrom vulnerability
                                     Bootrom    iBSS
2.   upload iBSS
3.   upload iBSS payload


                                                iBSS
                                               Payload




                                                iBoot    Kernel


                                                         Ramdisk

                                                          Loader.app
greenpois0n
1.   exploit bootrom vulnerability
                                     Bootrom    iBSS
2.   upload iBSS
3.   upload iBSS payload
4.   execute iBSS payload

                                                iBSS
                                               Payload




                                                iBoot    Kernel


                                                         Ramdisk

                                                          Loader.app
greenpois0n
1.     exploit bootrom vulnerability
                                            Bootrom    iBSS
2.     upload iBSS
3.     upload iBSS payload
4.     execute iBSS payload
     4.1. upload, patch and jump to iBoot              iBSS
                                                      Payload




                                                       iBoot    Kernel


                                                                Ramdisk

                                                                 Loader.app
greenpois0n
1.     exploit bootrom vulnerability
                                            Bootrom    iBSS
2.     upload iBSS
3.     upload iBSS payload
4.     execute iBSS payload
     4.1. upload, patch and jump to iBoot              iBSS
     4.2. upload iBoot payload                        Payload




                                                       iBoot    Kernel


                                                                Ramdisk

                                                                 Loader.app
greenpois0n
1.     exploit bootrom vulnerability
                                            Bootrom    iBSS
2.     upload iBSS
3.     upload iBSS payload
4.     execute iBSS payload
     4.1. upload, patch and jump to iBoot              iBSS
     4.2. upload iBoot payload                        Payload

     4.3. upload ramdisk


                                                       iBoot    Kernel


                                                                Ramdisk

                                                                 Loader.app
greenpois0n
1.     exploit bootrom vulnerability
                                            Bootrom    iBSS
2.     upload iBSS
3.     upload iBSS payload
4.     execute iBSS payload
     4.1. upload, patch and jump to iBoot              iBSS
     4.2. upload iBoot payload                        Payload

     4.3. upload ramdisk
     4.4. execute ramdisk

                                                       iBoot    Kernel


                                                                Ramdisk

                                                                 Loader.app
greenpois0n
1.     exploit bootrom vulnerability
                                            Bootrom    iBSS
2.     upload iBSS
3.     upload iBSS payload
4.     execute iBSS payload
     4.1. upload, patch and jump to iBoot              iBSS
     4.2. upload iBoot payload                        Payload

     4.3. upload ramdisk
     4.4. execute ramdisk
     4.5. set kernel boot args
                                                       iBoot    Kernel


                                                                Ramdisk

                                                                 Loader.app
greenpois0n
1.     exploit bootrom vulnerability
                                            Bootrom    iBSS
2.     upload iBSS
3.     upload iBSS payload
4.     execute iBSS payload
     4.1. upload, patch and jump to iBoot              iBSS
     4.2. upload iBoot payload                        Payload

     4.3. upload ramdisk
     4.4. execute ramdisk
     4.5. set kernel boot args
                                                       iBoot    Kernel
     4.6. upload kernel cache

                                                                Ramdisk

                                                                 Loader.app
greenpois0n
1.     exploit bootrom vulnerability
                                            Bootrom    iBSS
2.     upload iBSS
3.     upload iBSS payload
4.     execute iBSS payload
     4.1. upload, patch and jump to iBoot              iBSS
     4.2. upload iBoot payload                        Payload

     4.3. upload ramdisk
     4.4. execute ramdisk
     4.5. set kernel boot args
                                                       iBoot    Kernel
     4.6. upload kernel cache
     4.7. boot
                                                                Ramdisk

                                                                 Loader.app
greenpois0n
1.  exploit bootrom vulnerability
                                         Bootrom    iBSS
2.  upload iBSS
3.  upload iBSS payload
4.  execute iBSS payload
  4.1. upload, patch and jump to iBoot              iBSS
  4.2. upload iBoot payload                        Payload

  4.3. upload ramdisk
  4.4. execute ramdisk
  4.5. set kernel boot args
                                                    iBoot    Kernel
  4.6. upload kernel cache
  4.7. boot
                                                             Ramdisk
5. install loader.app
                                                              Loader.app
Conclusion

•   Fun from a technical perspective

•   Actually useful for only a few (Unlockers, Developers)

•   Mostly used for the wrong purposes

    •   Crapware like themes and custom sms sounds

    •   Software pirating
more in the final paper...
         slides available at
      http://blog.010dev.com
Unlocking
          signature                signature
            check                    check




Bootrom               Bootloader               Firmware
                                               (Nucleus OS)



 ROM                                  NOR
                                               seczone


                       protected area
                           contains:
                      encrypted lock-state
Unlocking
          signature                signature
            check                    check




Bootrom               Bootloader               Firmware
                                               (Nucleus OS)



 ROM                                  NOR
                                               seczone
                                                                     1. truly unlock
                       protected area                         by altering lock-state in seczone
                           contains:
                      encrypted lock-state
Unlocking
          signature                signature
            check                    check                        2. unlock on-the-fly
                                                              by constantly overriding netlock
                                                                     checks in firmware
Bootrom               Bootloader               Firmware
                                               (Nucleus OS)



 ROM                                  NOR
                                                   X
                                               seczone
                                                                     1. truly unlock
                       protected area                         by altering lock-state in seczone
                           contains:
                      encrypted lock-state
Unlocking
    2. unlock on-the-fly
by constantly overriding netlock
       checks in firmware
Unlocking
    2. unlock on-the-fly
by constantly overriding netlock
       checks in firmware




                               Nucleus OS        seczone

                                                 NOR




                            Baseband Processor
Unlocking
                    2. unlock on-the-fly
                by constantly overriding netlock
                       checks in firmware




        iOS                                    Nucleus OS        seczone

                                                                 NOR

                             UART



Application Processor                       Baseband Processor
Unlocking
                                               2. unlock on-the-fly
run deamon process on                      by constantly overriding netlock
 application processor                            checks in firmware             exploit code execution
  * (requires jailbreak)                                                       vulnerabilities to override
                                                                                  netlock „on-the-fly“


                                 unlockd

                                   iOS                                    Nucleus OS          X          seczone

                                                                                                             NOR

                                                        UART



                           Application Processor                       Baseband Processor

More Related Content

PPTX
iOS jailbreaking
PPTX
iOS-Application-Security-iAmPr3m
PPTX
Pentesting iPhone applications
PPT
Mobile Security Assessment: 101
PDF
Dark Side of iOS [SmartDevCon 2013]
PDF
YOW! Connected 2014 - Developing Secure iOS Applications
PDF
from Realtime Operating systems to unlocking iPhones in less than 30 slides
PDF
CrikeyCon 2015 - iOS Runtime Hacking Crash Course
iOS jailbreaking
iOS-Application-Security-iAmPr3m
Pentesting iPhone applications
Mobile Security Assessment: 101
Dark Side of iOS [SmartDevCon 2013]
YOW! Connected 2014 - Developing Secure iOS Applications
from Realtime Operating systems to unlocking iPhones in less than 30 slides
CrikeyCon 2015 - iOS Runtime Hacking Crash Course

What's hot (20)

PDF
Hacking and Securing iOS Apps : Part 1
PDF
Iphone Presentation for MuMe09
PDF
iOS Application Penetation Test
PDF
Ruxmon April 2014 - Introduction to iOS Penetration Testing
PDF
Yow connected developing secure i os applications
PDF
I Want More Ninja – iOS Security Testing
PDF
Pentesting iOS Apps - Runtime Analysis and Manipulation
PPTX
Hacking and securing ios applications
PDF
OWASP Melbourne - Introduction to iOS Application Penetration Testing
PDF
Attacking and Defending Apple iOS Devices
PDF
iOS Application Penetration Testing
PDF
iOS Application Security
PDF
Online Retailer's Conference 2013 - Hacking Mobile Applications - Industry Ca...
PPT
iOS Hacking: Advanced Pentest & Forensic Techniques
PPT
iOS Application Penetration Testing for Beginners
PPTX
Pentesting iOS Applications
PDF
Обмен учетными данными между iOS 8 приложениями и вебом, Константин Чернухо, ...
PPTX
iOS Security and Encryption
PDF
Security Best Practices for Mobile Development
PDF
Toorcon 2010: IPhone Rootkits? There's an App for That
Hacking and Securing iOS Apps : Part 1
Iphone Presentation for MuMe09
iOS Application Penetation Test
Ruxmon April 2014 - Introduction to iOS Penetration Testing
Yow connected developing secure i os applications
I Want More Ninja – iOS Security Testing
Pentesting iOS Apps - Runtime Analysis and Manipulation
Hacking and securing ios applications
OWASP Melbourne - Introduction to iOS Application Penetration Testing
Attacking and Defending Apple iOS Devices
iOS Application Penetration Testing
iOS Application Security
Online Retailer's Conference 2013 - Hacking Mobile Applications - Industry Ca...
iOS Hacking: Advanced Pentest & Forensic Techniques
iOS Application Penetration Testing for Beginners
Pentesting iOS Applications
Обмен учетными данными между iOS 8 приложениями и вебом, Константин Чернухо, ...
iOS Security and Encryption
Security Best Practices for Mobile Development
Toorcon 2010: IPhone Rootkits? There's an App for That
Ad

Viewers also liked (20)

PPT
a quick Introduction to PyPy
PPT
Jail breaking
PPTX
Presentation on iOS
PPTX
Apple iOS
PDF
iOS (Vulner)ability
PDF
iOS Version History: A Visual Timeline
PPT
Introduction to iOS
PDF
63080008-MATIC_KUNAVER-Samodejno_prepoznavanje_obraznih_izrazov_na_iOS_platformi
PDF
Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak
PDF
iOS Architecture and MVC
PPTX
Apple iOS - A modern way to mobile operating system
PDF
History of iOS
PPTX
Multiverse theory powerpoint final
PDF
Apple iOS Report
PPTX
Ios operating system
PPTX
Haptic Technology #Manoj_Rockstar
PPTX
Triangulación
PPTX
Data mining fp growth
a quick Introduction to PyPy
Jail breaking
Presentation on iOS
Apple iOS
iOS (Vulner)ability
iOS Version History: A Visual Timeline
Introduction to iOS
63080008-MATIC_KUNAVER-Samodejno_prepoznavanje_obraznih_izrazov_na_iOS_platformi
Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak
iOS Architecture and MVC
Apple iOS - A modern way to mobile operating system
History of iOS
Multiverse theory powerpoint final
Apple iOS Report
Ios operating system
Haptic Technology #Manoj_Rockstar
Triangulación
Data mining fp growth
Ad

Similar to Jailbreaking iOS (20)

PDF
You suck at Memory Analysis
PPTX
Deep Dive into WinRT
PDF
Toorcon Seattle 2011 - Browser Exploit Packs
PDF
Cigarette VS Bubble Gum
PDF
PPTX
Android and Intel Inside
PDF
Beginner’s Guide on How to Start Exploring IoT Security 1st Session
PPTX
Android and ios cracking, hackintosh included !
PDF
Android Internals
PDF
Mobile Showcase Moblin2
PDF
Eloi Sanfélix y Javier Moreno - Hardware hacking on your couch [RootedCON 2012]
PPTX
Android village @nullcon 2012
PPTX
Game Development for Nokia Asha Devices with Java ME #1
PDF
Mobile operating systems
PDF
108484130 pod2g-jailbreak-techniques-wwjc-2012
PDF
13.30 hr Hebinck
PPT
Attacking Embedded Devices (No Axe Required)
PDF
It's Assembler, Jim, but not as we know it: (ab)using binaries from embedded ...
PPT
Android architechture
You suck at Memory Analysis
Deep Dive into WinRT
Toorcon Seattle 2011 - Browser Exploit Packs
Cigarette VS Bubble Gum
Android and Intel Inside
Beginner’s Guide on How to Start Exploring IoT Security 1st Session
Android and ios cracking, hackintosh included !
Android Internals
Mobile Showcase Moblin2
Eloi Sanfélix y Javier Moreno - Hardware hacking on your couch [RootedCON 2012]
Android village @nullcon 2012
Game Development for Nokia Asha Devices with Java ME #1
Mobile operating systems
108484130 pod2g-jailbreak-techniques-wwjc-2012
13.30 hr Hebinck
Attacking Embedded Devices (No Axe Required)
It's Assembler, Jim, but not as we know it: (ab)using binaries from embedded ...
Android architechture

More from Kai Aras (6)

PDF
Design patterns - Singleton&Command
PDF
OpenAmi - a short Introduction
DOC
Projektdokumentation Kai Aras Ss08
PPT
Sounddesign - Pi - Kai Aras - WS08/09
PPTX
Algorythm
PPT
Virtual Reality - Tracking Applications
Design patterns - Singleton&Command
OpenAmi - a short Introduction
Projektdokumentation Kai Aras Ss08
Sounddesign - Pi - Kai Aras - WS08/09
Algorythm
Virtual Reality - Tracking Applications

Recently uploaded (20)

PDF
1 - Historical Antecedents, Social Consideration.pdf
PPTX
Benefits of Physical activity for teenagers.pptx
PPTX
2018-HIPAA-Renewal-Training for executives
PDF
OpenACC and Open Hackathons Monthly Highlights July 2025
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PDF
“A New Era of 3D Sensing: Transforming Industries and Creating Opportunities,...
PPTX
Modernising the Digital Integration Hub
PDF
Zenith AI: Advanced Artificial Intelligence
PPTX
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
PDF
sustainability-14-14877-v2.pddhzftheheeeee
DOCX
search engine optimization ppt fir known well about this
PPTX
Configure Apache Mutual Authentication
PDF
CloudStack 4.21: First Look Webinar slides
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
The influence of sentiment analysis in enhancing early warning system model f...
PDF
Credit Without Borders: AI and Financial Inclusion in Bangladesh
PPT
Geologic Time for studying geology for geologist
PPTX
Microsoft Excel 365/2024 Beginner's training
PDF
STKI Israel Market Study 2025 version august
PPTX
TEXTILE technology diploma scope and career opportunities
1 - Historical Antecedents, Social Consideration.pdf
Benefits of Physical activity for teenagers.pptx
2018-HIPAA-Renewal-Training for executives
OpenACC and Open Hackathons Monthly Highlights July 2025
Taming the Chaos: How to Turn Unstructured Data into Decisions
“A New Era of 3D Sensing: Transforming Industries and Creating Opportunities,...
Modernising the Digital Integration Hub
Zenith AI: Advanced Artificial Intelligence
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
sustainability-14-14877-v2.pddhzftheheeeee
search engine optimization ppt fir known well about this
Configure Apache Mutual Authentication
CloudStack 4.21: First Look Webinar slides
Module 1.ppt Iot fundamentals and Architecture
The influence of sentiment analysis in enhancing early warning system model f...
Credit Without Borders: AI and Financial Inclusion in Bangladesh
Geologic Time for studying geology for geologist
Microsoft Excel 365/2024 Beginner's training
STKI Israel Market Study 2025 version august
TEXTILE technology diploma scope and career opportunities

Jailbreaking iOS

  • 1. Jailbreaking iOS How an iPhone breaks free Kai Aras - CSM Stuttgart Media University
  • 2. What is iOS ? • Apples Operating System for iPhone, iPodTouch and iPad • Based on Mac OSX • Latest release 4.2.1
  • 3. What is a Jailbreak ?
  • 4. What is a Jailbreak ? • removes certain security mechanisms to allow installation and distribution of untrusted 3rd party applications.
  • 5. What is a Jailbreak ? • removes certain security mechanisms to allow installation and distribution of untrusted 3rd party applications. • patches code signing to achieve unsigned code execution
  • 6. What is a Jailbreak ? • removes certain security mechanisms to allow installation and distribution of untrusted 3rd party applications. • patches code signing to achieve unsigned code execution • makes you play angry birds for free...
  • 7. Why does it exist ? • Closed Platform • Software Distribution controlled by Apple (walled garden) • 3rd party developers cannot modify system components • 3rd party developers can only use public APIs • people enjoy hacking things ;)
  • 8. What about the name - Jailbreak ? • seems to be originated in first hackers breaking out of the so called chroot jail.
  • 9. What can be done with a JB ?
  • 10. What can be done with a JB ? • Install software that is unsupported by Apple.
  • 11. What can be done with a JB ? • Install software that is unsupported by Apple. • Apps, Addons, Themes
  • 12. What can be done with a JB ? • Install software that is unsupported by Apple. • Apps, Addons, Themes • Activate the Device (unofficial carriers)
  • 13. What can be done with a JB ? • Install software that is unsupported by Apple. • Apps, Addons, Themes • Activate the Device (unofficial carriers) • Unlock the device.
  • 14. What can be done with a JB ? • Install software that is unsupported by Apple. • Apps, Addons, Themes • Activate the Device (unofficial carriers) • Unlock the device. • Do custom development that requires deeper system integration.
  • 15. What can be done with a JB ? • Install software that is unsupported by Apple. • Apps, Addons, Themes • Activate the Device (unofficial carriers) • Unlock the device. • Do custom development that requires deeper system integration. • Install pirated software ☹
  • 16. A state of the art prison iOS Hardware and Software Design
  • 18. iOS Hardware Architecture Application Processor
  • 19. iOS Hardware Architecture Application Processor iOS User interaction Applications ...
  • 20. iOS Hardware Architecture Application Processor iOS User interaction Applications ... Baseband Processor
  • 21. iOS Hardware Architecture Application Processor iOS User interaction Applications ... Baseband Processor NucleusOS Radio communication
  • 22. iOS Hardware Architecture audio WIFI display BT camera GSM Application Processor Baseband Processor UART I2S GPIO DMA power managment
  • 23. iOS Hardware Architecture audio WIFI display BT camera GSM Application Processor Baseband Processor UART I2S GPIO DMA controls power managment sim/net-lock !
  • 26. iOS Security Architecture • Sandboxing • Memory protection
  • 27. iOS Security Architecture • Sandboxing • Memory protection • Code signing
  • 28. iOS Security Architecture • Sandboxing • Memory protection • Code signing • Encryption
  • 29. Sandboxing • NAND Flash • FTL : converts logical partitions to NAND flash architecture • looks like Block Device / (RO) (System Partition) /private/var (RW) (User Partition) • System Partition / (RO) Block Device User Partition /private/var FTL NAND
  • 30. Sandboxing / (RO) /private/var (RW) • (System Partition) (User Partition) System Partition read only Block Device • 3rd party lives on user partition FTL • Apps run as mobile user NAND • Kernel signature checks executables in systemcall execve()
  • 31. Memory Protection • W^X Policy • a page is either writable or executable but never both! • Non-executable stack & heap • No ASLR! -> ROP
  • 32. Code Signing • implemented inside the Kernel • Kernel signature checks executables in systemcall execve() • Kernel stored on System Partition (kernelcache) • Kernel is signature checked before being loaded.
  • 33. Encryption • Everything is encrypted • Hardware AES Engine • Keys derived from hardware keys GID-key UID-key • Possible to use Jailbreak tools e.g. Syringe to use the hardware engine
  • 34. iOS Boot Sequence • Normal Boot • Recovery Mode • DFU Mode
  • 35. Normal Boot LLB Bootrom (Low Level iBoot Kernel Application Bootloader) NOR NOR NAND NAND signature signature signature signature check check check check
  • 36. DFU Mode LLB Bootrom (Low Level iBoot Kernel Application Bootloader) minimal iBoot Bootrom iBSS iBEC Kernel Ramdisk
  • 37. Recovery Mode LLB Bootrom (Low Level iBoot Kernel Bootloader) signature signature Kernel check check Ramdisk
  • 38. Attacking the chain of trust LLB System Bootrom (Low Level iBoot Kernel Application Bootloader) Software signature signature signature signature signature check check check check check
  • 39. Attacking the chain of trust attack here LLB System Bootrom (Low Level iBoot Kernel Application Bootloader) Software signature signature signature signature signature check check check check check
  • 40. Attacking the chain of trust (cannot be fixed) attack here LLB System Bootrom (Low Level iBoot Kernel Application Bootloader) Software signature signature signature signature signature check check check check check
  • 41. Attacking the chain of trust (cannot be fixed) attack here attack here LLB System Bootrom (Low Level iBoot Kernel Application Bootloader) Software signature signature signature signature signature check check check check check
  • 42. Attacking the chain of trust (cannot be fixed) attack here attack here attack here LLB System Bootrom (Low Level iBoot Kernel Application Bootloader) Software signature signature signature signature signature check check check check check
  • 43. Attacking the chain of trust (cannot be fixed) attack here attack here attack here attack here LLB System Bootrom (Low Level iBoot Kernel Application Bootloader) Software signature signature signature signature signature check check check check check
  • 44. Breaking free LLB System Bootrom (Low Level iBoot Kernel Application Bootloader) Software signature signature signature signature signature check check check check check
  • 45. Breaking free 1. Patch out all the signature checks LLB System Bootrom (Low Level iBoot Kernel Application Bootloader) Software signature signature signature signature signature check check check check check
  • 46. Breaking free 1. Patch out all the signature checks 2. Install Cydia to manage unsigned 3rd Cydia party applications LLB System Bootrom (Low Level iBoot Kernel Application Bootloader) Software signature signature signature signature signature check check check check check
  • 48. How it’s done • exploit code-execution vulnerability to deploy and execute jailbreak- payload
  • 49. How it’s done • exploit code-execution vulnerability to deploy and execute jailbreak- payload • execute payload, if required gain root by exploiting privilege escalation vulnerability
  • 50. How it’s done • exploit code-execution vulnerability to deploy and execute jailbreak- payload • execute payload, if required gain root by exploiting privilege escalation vulnerability • patch LLB, iBoot and Kernel to remove signature checks
  • 51. How it’s done • exploit code-execution vulnerability to deploy and execute jailbreak- payload • execute payload, if required gain root by exploiting privilege escalation vulnerability • patch LLB, iBoot and Kernel to remove signature checks • install cydia to allow installation of unsigned 3rd party applications.
  • 53. Star (jailbreakme.com) • Web based Jailbreak
  • 54. Star (jailbreakme.com) • Web based Jailbreak • Injection Vector: Userland Process (via HTTP)
  • 55. Star (jailbreakme.com) • Web based Jailbreak • Injection Vector: Userland Process (via HTTP) • first exploits CFF Font Parser (via PDF) in Mobile Safari
  • 56. Star (jailbreakme.com) • Web based Jailbreak • Injection Vector: Userland Process (via HTTP) • first exploits CFF Font Parser (via PDF) in Mobile Safari • then exploits IOSurface Kernel extension (via ROP)
  • 57. Star 1 Payload 1 2 Payload 2 3 Mobile Safari 6 PDF CFF Font Parser 4 7 System Applicatio iBoot Kernel Cydia Software n 5
  • 58. Star 1 Payload 1 2 1. Payload1: Malformed PDF Payload 2 3 Mobile Safari 6 PDF CFF Font Parser 4 7 System Applicatio iBoot Kernel Cydia Software n 5
  • 59. Star 1 Payload 1 2 1. Payload1: Malformed PDF Payload 2 3 Mobile 2. Payload2: Post Install Safari 6 PDF CFF Font Parser 4 7 System Applicatio iBoot Kernel Cydia Software n 5
  • 60. Star 1 Payload 1 2 1. Payload1: Malformed PDF Payload 2 3 Mobile 2. Payload2: Post Install Safari 6 PDF CFF Font Parser 4 3. Deploy Payload1 via HTTP 7 System Applicatio iBoot Kernel Cydia Software n 5
  • 61. Star 1 Payload 1 2 1. Payload1: Malformed PDF Payload 2 3 Mobile 2. Payload2: Post Install Safari 6 PDF CFF Font Parser 4 3. Deploy Payload1 via HTTP 7 System Applicatio iBoot Kernel Cydia Software n 4. Exploit Userland Process 5
  • 62. Star 1 Payload 1 2 1. Payload1: Malformed PDF Payload 2 3 Mobile 2. Payload2: Post Install Safari 6 PDF CFF Font Parser 4 3. Deploy Payload1 via HTTP 7 System Applicatio iBoot Kernel Cydia Software n 4. Exploit Userland Process 5. Exploit Kernel to gain root privileges 5
  • 63. Star 1 Payload 1 2 1. Payload1: Malformed PDF Payload 2 3 Mobile 2. Payload2: Post Install Safari 6 PDF CFF Font Parser 4 3. Deploy Payload1 via HTTP 7 System Applicatio iBoot Kernel Cydia Software n 4. Exploit Userland Process 5. Exploit Kernel to gain root privileges 5 6. Download Payload2
  • 64. Star 1 Payload 1 2 1. Payload1: Malformed PDF Payload 2 3 Mobile 2. Payload2: Post Install Safari 6 PDF CFF Font Parser 4 3. Deploy Payload1 via HTTP 7 System Applicatio iBoot Kernel Cydia Software n 4. Exploit Userland Process 5. Exploit Kernel to gain root privileges 5 6. Download Payload2 7. Install libraries and install Cydia
  • 66. greenpois0n • PC based Jailbreak
  • 67. greenpois0n • PC based Jailbreak • also Jailbreak Toolkit (Syringe, Cyanide, Anthrax...*)
  • 68. greenpois0n • PC based Jailbreak • also Jailbreak Toolkit (Syringe, Cyanide, Anthrax...*) • exploits Bootrom vulnerability (limera1n exploit)
  • 69. greenpois0n • PC based Jailbreak • also Jailbreak Toolkit (Syringe, Cyanide, Anthrax...*) • exploits Bootrom vulnerability (limera1n exploit) • then exploits Kernel vulnerability (undisclosed exploit)
  • 70. greenpois0n • PC based Jailbreak • also Jailbreak Toolkit (Syringe, Cyanide, Anthrax...*) • exploits Bootrom vulnerability (limera1n exploit) • then exploits Kernel vulnerability (undisclosed exploit) • Injection vector: Bootloader communication (DFU Mode)
  • 71. greenpois0n Bootrom iBSS iBSS Payload iBoot Kernel Ramdisk Loader.app
  • 72. greenpois0n 1. exploit bootrom vulnerability Bootrom iBSS iBSS Payload iBoot Kernel Ramdisk Loader.app
  • 73. greenpois0n 1. exploit bootrom vulnerability Bootrom iBSS 2. upload iBSS iBSS Payload iBoot Kernel Ramdisk Loader.app
  • 74. greenpois0n 1. exploit bootrom vulnerability Bootrom iBSS 2. upload iBSS 3. upload iBSS payload iBSS Payload iBoot Kernel Ramdisk Loader.app
  • 75. greenpois0n 1. exploit bootrom vulnerability Bootrom iBSS 2. upload iBSS 3. upload iBSS payload 4. execute iBSS payload iBSS Payload iBoot Kernel Ramdisk Loader.app
  • 76. greenpois0n 1. exploit bootrom vulnerability Bootrom iBSS 2. upload iBSS 3. upload iBSS payload 4. execute iBSS payload 4.1. upload, patch and jump to iBoot iBSS Payload iBoot Kernel Ramdisk Loader.app
  • 77. greenpois0n 1. exploit bootrom vulnerability Bootrom iBSS 2. upload iBSS 3. upload iBSS payload 4. execute iBSS payload 4.1. upload, patch and jump to iBoot iBSS 4.2. upload iBoot payload Payload iBoot Kernel Ramdisk Loader.app
  • 78. greenpois0n 1. exploit bootrom vulnerability Bootrom iBSS 2. upload iBSS 3. upload iBSS payload 4. execute iBSS payload 4.1. upload, patch and jump to iBoot iBSS 4.2. upload iBoot payload Payload 4.3. upload ramdisk iBoot Kernel Ramdisk Loader.app
  • 79. greenpois0n 1. exploit bootrom vulnerability Bootrom iBSS 2. upload iBSS 3. upload iBSS payload 4. execute iBSS payload 4.1. upload, patch and jump to iBoot iBSS 4.2. upload iBoot payload Payload 4.3. upload ramdisk 4.4. execute ramdisk iBoot Kernel Ramdisk Loader.app
  • 80. greenpois0n 1. exploit bootrom vulnerability Bootrom iBSS 2. upload iBSS 3. upload iBSS payload 4. execute iBSS payload 4.1. upload, patch and jump to iBoot iBSS 4.2. upload iBoot payload Payload 4.3. upload ramdisk 4.4. execute ramdisk 4.5. set kernel boot args iBoot Kernel Ramdisk Loader.app
  • 81. greenpois0n 1. exploit bootrom vulnerability Bootrom iBSS 2. upload iBSS 3. upload iBSS payload 4. execute iBSS payload 4.1. upload, patch and jump to iBoot iBSS 4.2. upload iBoot payload Payload 4.3. upload ramdisk 4.4. execute ramdisk 4.5. set kernel boot args iBoot Kernel 4.6. upload kernel cache Ramdisk Loader.app
  • 82. greenpois0n 1. exploit bootrom vulnerability Bootrom iBSS 2. upload iBSS 3. upload iBSS payload 4. execute iBSS payload 4.1. upload, patch and jump to iBoot iBSS 4.2. upload iBoot payload Payload 4.3. upload ramdisk 4.4. execute ramdisk 4.5. set kernel boot args iBoot Kernel 4.6. upload kernel cache 4.7. boot Ramdisk Loader.app
  • 83. greenpois0n 1. exploit bootrom vulnerability Bootrom iBSS 2. upload iBSS 3. upload iBSS payload 4. execute iBSS payload 4.1. upload, patch and jump to iBoot iBSS 4.2. upload iBoot payload Payload 4.3. upload ramdisk 4.4. execute ramdisk 4.5. set kernel boot args iBoot Kernel 4.6. upload kernel cache 4.7. boot Ramdisk 5. install loader.app Loader.app
  • 84. Conclusion • Fun from a technical perspective • Actually useful for only a few (Unlockers, Developers) • Mostly used for the wrong purposes • Crapware like themes and custom sms sounds • Software pirating
  • 85. more in the final paper... slides available at http://blog.010dev.com
  • 86. Unlocking signature signature check check Bootrom Bootloader Firmware (Nucleus OS) ROM NOR seczone protected area contains: encrypted lock-state
  • 87. Unlocking signature signature check check Bootrom Bootloader Firmware (Nucleus OS) ROM NOR seczone 1. truly unlock protected area by altering lock-state in seczone contains: encrypted lock-state
  • 88. Unlocking signature signature check check 2. unlock on-the-fly by constantly overriding netlock checks in firmware Bootrom Bootloader Firmware (Nucleus OS) ROM NOR X seczone 1. truly unlock protected area by altering lock-state in seczone contains: encrypted lock-state
  • 89. Unlocking 2. unlock on-the-fly by constantly overriding netlock checks in firmware
  • 90. Unlocking 2. unlock on-the-fly by constantly overriding netlock checks in firmware Nucleus OS seczone NOR Baseband Processor
  • 91. Unlocking 2. unlock on-the-fly by constantly overriding netlock checks in firmware iOS Nucleus OS seczone NOR UART Application Processor Baseband Processor
  • 92. Unlocking 2. unlock on-the-fly run deamon process on by constantly overriding netlock application processor checks in firmware exploit code execution * (requires jailbreak) vulnerabilities to override netlock „on-the-fly“ unlockd iOS Nucleus OS X seczone NOR UART Application Processor Baseband Processor