Strategic Analysis of The iOS Jailbreak Development Community
Strategic Analysis of The iOS Jailbreak Development Community
Exploit Usermode
Vulnerability Through
Malicious Data
iOS Userland Injection Attack Graph
Unprivileged
Native Code
Execution
Exploit User
Privilege Escalation
Vulnerability
Jailbreak
Temporary Kernel Mode
running
Jailbreak Code Execution
kernel
iOS Userland Untether Attack Graph
Boot-Time
Privileged File
Return-oriented ...
Write Access
execution
Jailbreak
running
kernel
Obtain
Overwrite signed Untethered
Apple's
kernelcache Jailbreak
Private Key
Types of iOS Jailbreaks
Exploit
Interrupted
Untethered Exploit Kernel Boot Time ROP Incomplete Code
Boot
Jailbreak Vulnerability Execution Signing
Process
Vulnerability
Exploit
Device Privileged Write Kickstart Boot Time Exploit BPF_STX
MobileBackup Jailbroken
Connected File Write and Incomplete Privileged ROP Kernel
Directory Kernel
over USB Access Code Sign Exploit Execution Vulnerability
Traversal
• Web-based
untethered
userland jailbreak
for iOS <= 4.0.1
• Timeline
• 8/1/2010: Released
• 8/11/2010: Patched
by iOS 3.2.2 and 4.0.2
“Star” Jailbreak Injection Vector
Exploit CFF
CharStrings Stack Return- Exploit IOSurface Jailbreak
Malicious Kernel Mode Temporary
Memory oriented Integer Overflow running
CFF Font Code Execution Jailbreak
Corruption Execution (CVE-2010-2973) kernel
(CVE-2010-1797)
Exploit
Drop Launchd Boot-Time Kernel Jailbreak
Privileged File IOSurface Untethered
libgmalloc Interposition Return-oriented mode code running
Write Access Integer Jailbreak
Exploit execution execution kernel
Overflow
• Create /var/db/.launchd_use_gmalloc,
causing launchd to load
/usr/lib/libgmalloc.dylib
• Crafted libgmalloc.dylib has no executable
segments (no code signature needed),
uses dyld interposing to point exported
functions to stack pivots
• Pivot stack and execute ROP when called
JailbreakMe 3.0 “Saffron”
• Déjà Vu of “Star”
• Malicious PDF file in web page exploits
Type 1 font program interpreter memory
corruption vulnerability (CVE-2011-0226)
• ROP payload exploits kernel vulnerability in
IOMobileFramebuffer (CVE-2011-0227)
• Timeline
• July 2, 2011: Leaked
• July 5, 2011: Released
• July 15, 2011: Patched in iOS 4.3.4
“Saffron” Injection Vector
--------------------------------------------------------------------------------
File: at.bin SHA1: 49b6ea93254f9767ad8d314dd77ecb6850f18412
--------------------------------------------------------------------------------
0x00000000 8e push 0x3
0x00000001 8b push 0x0
0x00000002 0c 21 op_setcurrentpoint
0x00000004 8e push 0x3
0x00000005 0a callsubr #03
0x00000006 fb ef push 0xfea50000
0x00000008 b5 push 0x2a
0x00000009 0c 10 callothersubr #42 nargs=-347
0x0000000b 0c 10 callothersubr
0x0000000d 16 op_hmoveto
0x0000000e 16 op_hmoveto
0x0000000f 16 op_hmoveto
0x00000010 0c 21 op_setcurrentpoint
0x00000012 0c 02 op_hstem3
0x00000014 0c 02 op_hstem3
0x00000016 0c 02 op_hstem3
0x00000018 0c 02 op_hstem3
0x0000001a 0c 02 op_hstem3
[...]
http://esec-lab.sogeti.com/post/Analysis-of-the-jailbreakme-v3-font-exploit
“Saffron” Untether
• Create /var/db/.launchd_use_gmalloc,
causing launchd to load libgmalloc.dylib
• libgmalloc.dylib has no text segments (no
code signature needed), uses Mach-O
relocations to adjust ROP addresses for
ASLR
• Initializers pivot stack and execute ROP
payload to exploit IOMobileFramebuffer
What About Android?
Malware Authors 0
Dan Rosenberg
Justin Case
Ken Millington
unrevoked
sc2k
Oberheide / Larimer
Revolutionary
Scott Walker
Stealth
0 2 4 6 8 10 12
[certs]
comment = certificates
path = /accounts/1000/certificates
root preexec = /accounts/devuser/r.sh
[media]
comment = media
path = /accounts/1000/shared
root preexec = /accounts/devuser/r.sh
[dtm]
comment = DTM
path = /accounts/1000/sys/dtm
root preexec = /accounts/devuser/r.sh
Lessons
1. http://www.theiphonewiki.com
2. http://www.ekoparty.org/archive/2010/eko
party_2010-Monti-iphone_rootkit.pdf
3. http://esec-lab.sogeti.com/post/Analysis-
of-the-jailbreakme-v3-font-exploit
4. http://www.trailofbits.com/resources/mobil
e_eip-04-19-2012.pdf
5. http://www.sourceconference.com/public
ations/bos12pubs/Lanier.Nell%20-
%20Mobile.pdf