ios exploitation · 2015. 2. 17. · codi binari assembly. exploits & payloads • què son?...
TRANSCRIPT
![Page 1: iOS Exploitation · 2015. 2. 17. · Codi binari Assembly. Exploits & Payloads • Què son? • Com es diferencien? • On intervenen? Vulnerabilitat Exploit Payload dóna lloc executa](https://reader034.vdokument.com/reader034/viewer/2022052103/603e71be36cbb640882d327f/html5/thumbnails/1.jpg)
iOS Exploitation
Iñaki MirXavi Álvarez
2015CONFERÈNCIA
SOBRE SOFTWAREA L’ESCOLA PIA MATARÓ
![Page 2: iOS Exploitation · 2015. 2. 17. · Codi binari Assembly. Exploits & Payloads • Què son? • Com es diferencien? • On intervenen? Vulnerabilitat Exploit Payload dóna lloc executa](https://reader034.vdokument.com/reader034/viewer/2022052103/603e71be36cbb640882d327f/html5/thumbnails/2.jpg)
Índex• Introducció
• De què tracta? • Per què iOS?• Objectius
• Com ho aconseguim?• Mesures de seguretat• Creant Remak3
• Descripció• Estructura• Funcionament
• Conclusions
![Page 3: iOS Exploitation · 2015. 2. 17. · Codi binari Assembly. Exploits & Payloads • Què son? • Com es diferencien? • On intervenen? Vulnerabilitat Exploit Payload dóna lloc executa](https://reader034.vdokument.com/reader034/viewer/2022052103/603e71be36cbb640882d327f/html5/thumbnails/3.jpg)
De què tracta ?
• Anàlisi i vulneració de la seguretat dels iDevices
• Creació de software
• Modificació del sistema operatiu
![Page 4: iOS Exploitation · 2015. 2. 17. · Codi binari Assembly. Exploits & Payloads • Què son? • Com es diferencien? • On intervenen? Vulnerabilitat Exploit Payload dóna lloc executa](https://reader034.vdokument.com/reader034/viewer/2022052103/603e71be36cbb640882d327f/html5/thumbnails/4.jpg)
Per què iOS ?
0M
200M
400M
600M
800M
Set ‘1
0Oct
‘11Mar
‘12Se
t ‘12
Gen ‘
13Jun
‘13
Oct ‘13
Jun ‘1
4
• 800+ milions de iDevicesactivats
• 130 milions el darrer any
• 98% a Fortune 500
![Page 5: iOS Exploitation · 2015. 2. 17. · Codi binari Assembly. Exploits & Payloads • Què son? • Com es diferencien? • On intervenen? Vulnerabilitat Exploit Payload dóna lloc executa](https://reader034.vdokument.com/reader034/viewer/2022052103/603e71be36cbb640882d327f/html5/thumbnails/5.jpg)
Per què iOS ?• Innovador • Segur
• Possibilitats limitades
![Page 6: iOS Exploitation · 2015. 2. 17. · Codi binari Assembly. Exploits & Payloads • Què son? • Com es diferencien? • On intervenen? Vulnerabilitat Exploit Payload dóna lloc executa](https://reader034.vdokument.com/reader034/viewer/2022052103/603e71be36cbb640882d327f/html5/thumbnails/6.jpg)
Objectius
• Trencar la seguretat d’iOS
• Aconseguir permisos
• Executar aplicacions de tercers
Crear un programa que permeti el JAILBREAK
![Page 7: iOS Exploitation · 2015. 2. 17. · Codi binari Assembly. Exploits & Payloads • Què son? • Com es diferencien? • On intervenen? Vulnerabilitat Exploit Payload dóna lloc executa](https://reader034.vdokument.com/reader034/viewer/2022052103/603e71be36cbb640882d327f/html5/thumbnails/7.jpg)
Jailbreak• Tethered • Semi-Tethered
• Untethered
![Page 8: iOS Exploitation · 2015. 2. 17. · Codi binari Assembly. Exploits & Payloads • Què son? • Com es diferencien? • On intervenen? Vulnerabilitat Exploit Payload dóna lloc executa](https://reader034.vdokument.com/reader034/viewer/2022052103/603e71be36cbb640882d327f/html5/thumbnails/8.jpg)
Jailbreak• Cydia
![Page 9: iOS Exploitation · 2015. 2. 17. · Codi binari Assembly. Exploits & Payloads • Què son? • Com es diferencien? • On intervenen? Vulnerabilitat Exploit Payload dóna lloc executa](https://reader034.vdokument.com/reader034/viewer/2022052103/603e71be36cbb640882d327f/html5/thumbnails/9.jpg)
Com ho aconseguim?
Enginyeria Inversa
Exploits (Scripts amb Payloads)
![Page 10: iOS Exploitation · 2015. 2. 17. · Codi binari Assembly. Exploits & Payloads • Què son? • Com es diferencien? • On intervenen? Vulnerabilitat Exploit Payload dóna lloc executa](https://reader034.vdokument.com/reader034/viewer/2022052103/603e71be36cbb640882d327f/html5/thumbnails/10.jpg)
Enginyeria Inversa
IDA
Dissasembler Debugger
Codi binari
Assembly
![Page 11: iOS Exploitation · 2015. 2. 17. · Codi binari Assembly. Exploits & Payloads • Què son? • Com es diferencien? • On intervenen? Vulnerabilitat Exploit Payload dóna lloc executa](https://reader034.vdokument.com/reader034/viewer/2022052103/603e71be36cbb640882d327f/html5/thumbnails/11.jpg)
Exploits & Payloads
• Què son?
• Com es diferencien?
• On intervenen?
Vulnerabilitat
Exploit
Payload
dóna lloc
executa
![Page 12: iOS Exploitation · 2015. 2. 17. · Codi binari Assembly. Exploits & Payloads • Què son? • Com es diferencien? • On intervenen? Vulnerabilitat Exploit Payload dóna lloc executa](https://reader034.vdokument.com/reader034/viewer/2022052103/603e71be36cbb640882d327f/html5/thumbnails/12.jpg)
Mesures de seguretat
![Page 13: iOS Exploitation · 2015. 2. 17. · Codi binari Assembly. Exploits & Payloads • Què son? • Com es diferencien? • On intervenen? Vulnerabilitat Exploit Payload dóna lloc executa](https://reader034.vdokument.com/reader034/viewer/2022052103/603e71be36cbb640882d327f/html5/thumbnails/13.jpg)
Procès 1
Procès II
DFUo
RecoveryMode
si no fallasi falla
signa
Comença al iniciar l’iDevice.Cada procès verifica el següent.
Si un procès falla, permet la restauració del SO.
Secure Bootchain
![Page 14: iOS Exploitation · 2015. 2. 17. · Codi binari Assembly. Exploits & Payloads • Què son? • Com es diferencien? • On intervenen? Vulnerabilitat Exploit Payload dóna lloc executa](https://reader034.vdokument.com/reader034/viewer/2022052103/603e71be36cbb640882d327f/html5/thumbnails/14.jpg)
• BootROM BootROM
LLB
signaVe implicita amb el hardware.
No es pot reescriure.Verifica signatura d’LLB.
Si es troba una vulnerabilitat NO ES REPARABLE. DFU
si falla
Secure Bootchain
![Page 15: iOS Exploitation · 2015. 2. 17. · Codi binari Assembly. Exploits & Payloads • Què son? • Com es diferencien? • On intervenen? Vulnerabilitat Exploit Payload dóna lloc executa](https://reader034.vdokument.com/reader034/viewer/2022052103/603e71be36cbb640882d327f/html5/thumbnails/15.jpg)
• Low Level Bootloader BootROM
LLBsigna
Verifica la integritat del firmware.Verifica la signatura d’iBoot.
DFU
si falla
iBoot
Secure Bootchain
![Page 16: iOS Exploitation · 2015. 2. 17. · Codi binari Assembly. Exploits & Payloads • Què son? • Com es diferencien? • On intervenen? Vulnerabilitat Exploit Payload dóna lloc executa](https://reader034.vdokument.com/reader034/viewer/2022052103/603e71be36cbb640882d327f/html5/thumbnails/16.jpg)
• iBootBootROM
LLB
signa
Inicialitza el hardware.Verifica la signatura del Kernel.
Recovery
si fallaiBoot
Kernel
Secure Bootchain
![Page 17: iOS Exploitation · 2015. 2. 17. · Codi binari Assembly. Exploits & Payloads • Què son? • Com es diferencien? • On intervenen? Vulnerabilitat Exploit Payload dóna lloc executa](https://reader034.vdokument.com/reader034/viewer/2022052103/603e71be36cbb640882d327f/html5/thumbnails/17.jpg)
• KernelBootROM
LLBEs el nucli del sistema operatiu.
Porta implementats els drivers i les extensions per l’interacció software-
hardware (IOKit).
Recovery si falla
iBoot
Kernel
Secure Bootchain
![Page 18: iOS Exploitation · 2015. 2. 17. · Codi binari Assembly. Exploits & Payloads • Què son? • Com es diferencien? • On intervenen? Vulnerabilitat Exploit Payload dóna lloc executa](https://reader034.vdokument.com/reader034/viewer/2022052103/603e71be36cbb640882d327f/html5/thumbnails/18.jpg)
Restringeix l’accés de les aplicacions a recursos del sistema i dades de l’usuari.
Sandboxing
Sandbox extensió Kernel
![Page 19: iOS Exploitation · 2015. 2. 17. · Codi binari Assembly. Exploits & Payloads • Què son? • Com es diferencien? • On intervenen? Vulnerabilitat Exploit Payload dóna lloc executa](https://reader034.vdokument.com/reader034/viewer/2022052103/603e71be36cbb640882d327f/html5/thumbnails/19.jpg)
Encriptació• Apple utilitza criptografia asimètrica per signar el programari
dels seus dispositius
• RSA• AES Desencriptem el kernel, extraiem la KBAG i cridant a la funció aes_decrypt amb aquesta d’argument ens retorna les claus del firmware.
![Page 20: iOS Exploitation · 2015. 2. 17. · Codi binari Assembly. Exploits & Payloads • Què son? • Com es diferencien? • On intervenen? Vulnerabilitat Exploit Payload dóna lloc executa](https://reader034.vdokument.com/reader034/viewer/2022052103/603e71be36cbb640882d327f/html5/thumbnails/20.jpg)
Creant Remak3
![Page 21: iOS Exploitation · 2015. 2. 17. · Codi binari Assembly. Exploits & Payloads • Què son? • Com es diferencien? • On intervenen? Vulnerabilitat Exploit Payload dóna lloc executa](https://reader034.vdokument.com/reader034/viewer/2022052103/603e71be36cbb640882d327f/html5/thumbnails/21.jpg)
Descripció• Jailbreak Semi-Tethered
• Compatibilitat
• iPhone 4• Mac OS X
![Page 22: iOS Exploitation · 2015. 2. 17. · Codi binari Assembly. Exploits & Payloads • Què son? • Com es diferencien? • On intervenen? Vulnerabilitat Exploit Payload dóna lloc executa](https://reader034.vdokument.com/reader034/viewer/2022052103/603e71be36cbb640882d327f/html5/thumbnails/22.jpg)
Llenguatges
• C
• Java
• AppleScript
• Bash
• PHP
![Page 23: iOS Exploitation · 2015. 2. 17. · Codi binari Assembly. Exploits & Payloads • Què son? • Com es diferencien? • On intervenen? Vulnerabilitat Exploit Payload dóna lloc executa](https://reader034.vdokument.com/reader034/viewer/2022052103/603e71be36cbb640882d327f/html5/thumbnails/23.jpg)
Exploits
Limera1n
• Payloads: dirhelper, fstab, ramdisk
iOS 4.1
0x210x210x210x21... !reinicia i torna a escriure desde
0x0
![Page 24: iOS Exploitation · 2015. 2. 17. · Codi binari Assembly. Exploits & Payloads • Què son? • Com es diferencien? • On intervenen? Vulnerabilitat Exploit Payload dóna lloc executa](https://reader034.vdokument.com/reader034/viewer/2022052103/603e71be36cbb640882d327f/html5/thumbnails/24.jpg)
Exploits
• Limera1n exploit
![Page 25: iOS Exploitation · 2015. 2. 17. · Codi binari Assembly. Exploits & Payloads • Què son? • Com es diferencien? • On intervenen? Vulnerabilitat Exploit Payload dóna lloc executa](https://reader034.vdokument.com/reader034/viewer/2022052103/603e71be36cbb640882d327f/html5/thumbnails/25.jpg)
Software emprat• xpwntool - Bootchain modificat per ometre mesures de
seguretat.
• ramdisk ssh_rd - Permet la connexió de l’iPhone ambl’ordinador via SSH.
• Llibreries libimobiledevice / libusbllibreries opensn0w syringelibxpwn
•XCode
![Page 26: iOS Exploitation · 2015. 2. 17. · Codi binari Assembly. Exploits & Payloads • Què son? • Com es diferencien? • On intervenen? Vulnerabilitat Exploit Payload dóna lloc executa](https://reader034.vdokument.com/reader034/viewer/2022052103/603e71be36cbb640882d327f/html5/thumbnails/26.jpg)
Funcionament
iOS Lliure
SSH
Reinici
Jailbreak
Boot
![Page 27: iOS Exploitation · 2015. 2. 17. · Codi binari Assembly. Exploits & Payloads • Què son? • Com es diferencien? • On intervenen? Vulnerabilitat Exploit Payload dóna lloc executa](https://reader034.vdokument.com/reader034/viewer/2022052103/603e71be36cbb640882d327f/html5/thumbnails/27.jpg)
FuncionamentBootROM iBSS iBEC DFU escriu iBoot
exploit
iBoot(modificat) executa payload
(800 bytes)
Fals Recovery
puja payload
inicia ramdisk + protocol SSH (mitjançant connexió SSH copiem cydia + payloads)
BootROM DFU
esborra signatures
escriu zeros a les adresses base on començen les signatures del bootchain
i aplica patch al kernel
exploit
![Page 28: iOS Exploitation · 2015. 2. 17. · Codi binari Assembly. Exploits & Payloads • Què son? • Com es diferencien? • On intervenen? Vulnerabilitat Exploit Payload dóna lloc executa](https://reader034.vdokument.com/reader034/viewer/2022052103/603e71be36cbb640882d327f/html5/thumbnails/28.jpg)
Conclusions
Jailbreak Semi-Tethered
Objectius assolits parcialment
![Page 29: iOS Exploitation · 2015. 2. 17. · Codi binari Assembly. Exploits & Payloads • Què son? • Com es diferencien? • On intervenen? Vulnerabilitat Exploit Payload dóna lloc executa](https://reader034.vdokument.com/reader034/viewer/2022052103/603e71be36cbb640882d327f/html5/thumbnails/29.jpg)
Gràcies per la vostra atenció
![Page 30: iOS Exploitation · 2015. 2. 17. · Codi binari Assembly. Exploits & Payloads • Què son? • Com es diferencien? • On intervenen? Vulnerabilitat Exploit Payload dóna lloc executa](https://reader034.vdokument.com/reader034/viewer/2022052103/603e71be36cbb640882d327f/html5/thumbnails/30.jpg)
Q&A