Black Hat IOS Forensics Slides
Black Hat IOS Forensics Slides
Andrey Belenko
AGENDA
• Basics
• iOS Security
• iOS Data Protection
• Hands-On!
FORENSICS 101
GOALS:
1. Assuming physical access to the device extract
as much information as practical
2. Leave as little traces/artifacts as practical
WHY BOTHER?
iPod iPad iPhone
iPhone 4 + iOS 4
• Proper passcode protection
• Proper data encryption
• Common name: iOS Data Protection
• Challenge for iOS forensics
iPhone 4S, 5, 5c have minor changes
iOS 5-8 introduce incremental changes to
Data Protection
DATA PROTECTION
• More robust passcode protection
• Passcode participates in data encryption
• Offline bruteforce not possible
• Better disk encryption
• Per-file encryption key
• Better keychain encryption
• Per-item encryption key
• New iTunes backup format
• Slower password recovery
PROTECTION CLASSES
• Content grouped by accessibility requirements
• Available at all times
• Available only when device is unlocked
• Available after device has been unlocked at least once after
boot
• Random master key (class key) for each protection class
• Each class key encrypted with device key and optionally passcode
key
• Class keys for all protection classes are stored in System Keybag
• /var/keybags/systembag.kb
• New keybag is generated on device restore/wipe
KEYBAG PROTECTION
Passcode Key Device Key
... ...
PASSCODE
• Key negotiation/generation
• Device must be unlocked
• Since iOS 7 user must confirm
pairing
• Pairing record gives same
powers as knowing the passcode
IOS SECURITY
iPhone 5s
• 64-bit
• Secure Enclave (SEP)
• Touch ID
• More passcode-protected
devices
• Yet another challenge for
(physical) iOS forensics
• https://code.google.com/p/iphone-dataprotection/
• OS X to build ramdisk and modified kernel
• OS X or Windows to boot device
• Doesn’t reliably work from within VM because of
USB
SANTOKU
• We’ll be using Santoku Linux
0.5 as our base
• Based off Lubuntu 14.04
• Not a strict requirement at all –
can use any Linux distribution
libimobiledevice
http://www.libimobiledevice.org
https://github.com/libimobiledevice/
LIBIMOBILEDEVICE – BUILDING
• https://github.com/libimobiledevice/libplist/archive/1.12.tar.gz
• ./autogen.sh && make && sudo make install
• https://github.com/libimobiledevice/libusbmuxd/archive/1.0.10.tar.gz
• ./autogen.sh && make && sudo make install
• https://github.com/libimobiledevice/libimobiledevice/archive/1.1.7.tar.gz
• ./autogen.sh
--enable-dev-tools
• make && sudo make install
• https://github.com/libimobiledevice/usbmuxd/archive/1.1.0.tar.gz
• ./autogen.sh
--without-systemd (at least on Santoku 0.5)
• make && sudo make install
LIBIMOBILEDEVICE – BUILDING
ADDITIONAL TOOLS
• https://github.com/libimobiledevice/ideviceinstaller/archive/1.1.0.tar.gz
• ./autogen.sh
• make
• sudo make install
• https://github.com/libimobiledevice/ifuse/archive/1.1.3.tar.gz
• ./autogen.sh
• make
• sudo make install
LIBIMOBILEDEVICE
filerelaytest
FILE RELAY – SOURCES
Photos
AppleTV SafeHarbor tmp
Baseband SystemConfiguration MobileAsset
Bluetooth Ubiquity GameKitLogs
Caches UserDatabases Device-O-Matic
CoreLocation AppSupport MobileDelete
CrashReporter Voicemail itunesstored
CLTM VPN Accounts
demod WiFi AddressBook
Keyboard WirelessAutomation FindMyiPhone
Lockdown MapsLogs DataAccess
MobileBackup NANDDebugInfo DataMigrator
MobileInstallation IORegUSBDevice EmbeddedSocial
MobileMusicPlayer VARFS MobileCal
Network HFSMeta MobileNotes
FILE RELAY – CPIO.GZ
gunzip <file.cpio.gz>
cpio -imdv <file.cpio>
FILE RELAY – IOS 8
• Guarded in iOS 8
• /Library/Managed Preferences/mobile/
com.apple.mobile_file_relay.plist
• Set “Enabled” = true
HOUSE ARREST
Unmount
fusermount -u <location>
ICLOUD BACKUP
iLoot
https://github.com/hackappcom/iloot
THANKS!
ABelenko@viaforensics.com
@abelenko