iPhone Rootkit? There's an App for that! - Reverse Engineering Mac ...
iPhone Rootkit? There's an App for that! - Reverse Engineering Mac ... iPhone Rootkit? There's an App for that! - Reverse Engineering Mac ...
The HowThe “star” PDF Exploit – Code execution• Classic stack overflow• BoF in CoreGraphics CFF(Compact Font Format) handling long strings• Overwrites $pc (EIP for ARM)• Code still running as “mobile” at this point• Leverages IOSurface (IOKit) bug for privilege escalation and sandboxescapeThe IOKit Vulnerability – Priv. escalation / breaks out of the sandbox• Kernel integer overflow in handling of IOSurface properties• Calls setuid(0) making Safari and all its loaded exploit code run as root• Dominoes all fall down from thereThe Jailbreak Phase – Setting up residence on the iDevice• Patches out restrictive kernel functionality• Installs a basic jailbreak filesystem along with Cydia (APT based packagemanager)• “Polite” and clean - Even calls setuid(501) back to “mobile” once it’s finished.Copyright Trustwave 2010
Weaponizing
- Page 5 and 6: iPhone/iOS Security Overview
- Page 7 and 8: Architecture OverviewApplications P
- Page 9 and 10: Application SecurityCode signing•
- Page 11 and 12: Jailbreaking Overview
- Page 13 and 14: Jailbreakme.com A Thing to Behold
- Page 15: What it looks likeVisit h'p://jailb
- Page 19 and 20: Patch PlanReversing the installui.d
- Page 21 and 22: My “Big Fat Rootkit”… so farC
- Page 23 and 24: Set-upA vanilla un-jailbroken iPhon
- Page 25 and 26: Hardware: Mic and AudioAudio record
- Page 27 and 28: Dumping Process DataSeveral interes
- Page 29 and 30: Targeting iOS ApplicationsiOS isn
- Page 31 and 32: Demo App Backdoor
- Page 33 and 34: Binary Reversing Prep (continued…
- Page 35 and 36: No More SecretsHint: find the LC
- Page 37 and 38: Mach Binary Encryption (continued
- Page 39 and 40: What’s your point?For starters…
- Page 41 and 42: Objective-C Method HookingIt’s ca
- Page 43 and 44: Objective-C Method Hook ExampleLets
- Page 45 and 46: Injecting Our LibraryConventionally
- Page 47 and 48: ConclusionsLots of security researc
- Page 49 and 50: Reversing Redux: The Binary “star
- Page 51 and 52: … continued: eggMalformed Times-
- Page 53 and 54: class-dump on installui.dylib (aka
The HowThe “star” PDF Exploit – Code execution• Classic stack overflow• BoF in CoreGraphics CFF(Compact Font Format) h<strong>an</strong>dling long strings• Overwrites $pc (EIP <strong>for</strong> ARM)• Code still running as “mobile” at this point• Leverages IOSurface (IOKit) bug <strong>for</strong> privilege escalation <strong>an</strong>d s<strong>an</strong>dboxescapeThe IOKit Vulnerability – Priv. escalation / breaks out of the s<strong>an</strong>dbox• Kernel integer overflow in h<strong>an</strong>dling of IOSurface properties• Calls setuid(0) making Safari <strong>an</strong>d all its loaded exploit code run as root• Dominoes all fall down from thereThe Jailbreak Phase – Setting up residence on the iDevice• Patches out restrictive kernel functionality• Installs a basic jailbreak filesystem along with Cydia (APT based packagem<strong>an</strong>ager)• “Polite” <strong>an</strong>d cle<strong>an</strong> - Even calls setuid(501) back to “mobile” once it’s finished.Copyright Trustwave 2010