I o Shacking
I o Shacking
Techniques
Author(s): Ömer Coşkun & Mark de Groot
The supreme art of war is to subdue the enemy without fighting. Sun Tzu
$ whoami
2
Ömer Coşkun
¡ BEng. Computer Science
Research Assistant in
Quantum Cryptography
& Advanced Topics in AI
¡ Industry Experience
Mark de Groot
KPN – CISO , Ethical
¡ Industry Experience
Hacking
KPN – CISO , Ethical Hacking
Verizon – Threat &
Vulnerability Management
IBM ISS – Threat Intelligence ¡ Interests
¡ Interests Programming, Cryptography,
Reverse Engineering,
Algorithm Design, Programming, Cryptography, Software Explotation, CTF,
Reverse Engineering, Malware Analysis, OS Rfid, SDR
Internals, Rootkits
¡ Overview
Outline
3
¡ Motivation
¡ iOS Security Architecture
¡ Application Sandbox and SandBox Profiles
¡ File System Encryption
¡ Q/A
¡ Questions ?
Motivations
http://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-818.pdf
How does iOS SandBox Work?
7
Source: http://dl.packetstormsecurity.net/papers/general/apple-
sandbox.pdf
1
How does iOS SandBox Work?
kSBXProfileNoNetwork sandbox-compilerd
kSBXProfileNoWrite mDNSResponder
kSBXProfileNoWriteExceptTemporary apsd
kSBXProfilePureComputation AppleDiags
PasteBoard
Container
MobileSafari
MobileMail
struct segment_command_64
{ uint32_t cmd; uint32_t cmdsize;
char segname[16]; uint64_t
vmaddr; uint64_t vmsize;
uint64_t fileoff; uint64_t filesize;
vm_prot_t maxprot; vm_prot_t
initprot; uint32_t nsects; uint32_t
flags; };
https://developer.apple.com/library/mac/documentation/
DeveloperTools/Conceptual/MachORuntime/index.html
Decrypting Binaries (32-bit)
pentestBox:/private/var/mobile/Applications/2587B469-0147-4793-86CE-
B41A1C4468DC/banking.app root# otool -l BankingApp| grep crypt
14
cryptoff 16384
cryptsize 835584
cryptid 1
pentestBox:/private/var/mobile/Applications/2587B469-0147-4793-86CE-
15
B41A1C4468DC/banking.app root# otool -l BankingApp| grep crypt
cryptoff 16384
cryptsize 835584
cryptid 1
Source: https://www.hex-rays.com/products/ida/
22
Reversing iOS Apps: Dealing with
Crpyto
Check for interesting function calls as all the imports are
correctly resolved.
23
Reversing iOS Apps: Dealing with
Crypto
It seems the application evaluates the certificate here.
https://developer.apple.com/
library/mac/documentation/
Security/Reference/
certifkeytrustservices/
index.html
24
Reversing iOS Apps: Dealing with
Crypto
Data content is being encrypted using public key
before sending it to server.
https://developer.apple.com/
library/mac/documentation/
Security/Reference/
certifkeytrustservices/
index.html
26
Reversing iOS Apps: Hunting for
Public Key
Cross-references definitely help.
https://www.owasp.org/index.php/
OWASP_Mobile_Security_Project#tab=Top_10_Mobile_Risks
iOS Apps Penetration Testing
34
https://www.owasp.org/index.php/
IOS_Application_Security_Testing_Cheat_Sheet
35
iOS Apps Penetration Testing:
Network Traffic Analysis
https://www.wireshark.org/
36
iOS Apps Penetration Testing:
Network Traffic Analysis
Cacoa Packet
Analyzer:
www.tastycoco
abytes.com/
cpa/
SSL Interception: Function Hooks
Source Code:Tripware:
http://www.tripwire.com/state-of-security/vulnerability-management/
creating-iphone-rootkits-and-like-the-nsas-dropout-jeep/
Iphone Rootkit CookBook (cont’d)
Source Code:Tripware:
http://www.tripwire.com/state-of-security/vulnerability-management/
creating-iphone-rootkits-and-like-the-nsas-dropout-jeep/
Burp Suite: Atomize Everything
More than standard application communication interception. 47
Purpose
49
BurpExtender To write our own extension
Purpose
50
.NET Beautifier Makes VIEWState info human readable