38
Cracking and Analyzing Apple iCloud backups, Find My iPhone, Document Storage

SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

  • Upload
    apps

  • View
    16

  • Download
    3

Embed Size (px)

DESCRIPTION

On the outside, the iPhone 6 Plus looks like just a scaled up iPhone 6, but the internal hardware tells a slightly different story. The phones are very similar but far from identical.

Citation preview

Page 1: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

Cracking and Analyzing Apple iCloud backups, Find My iPhone, Document

Storage

Page 2: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

The need for iOS forensics

• More than 5 years on the market

• 7 iPhones, 5 iPods, 5 iPads

• 320+ million iPhones, 280+ million iPods, 120+ million iPads sold worldwide

• “Smart devices” – they do carry a lot of sensitive data

• Corporate deployments are increasing

Page 3: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

iOS data protection• Device passcode

• Protect unauthorized access to the device

• Bypassing is not enough (used in encryption)

• Disk encryption

• Keychain

• System-wide storage for sensitive data (keys, passwords etc)

• Data is encrypted

Page 4: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

iOS forensics

•Logical acquisition (iTunes backups)

• Physical acquisition

• iCloud backups and storage

Page 5: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

iOS forensics- logical acquisition- logical acquisition

• “Ask” device to produce backup

• Device must be unlocked (by passcode or iTunes)

• Device may produce encrypted backup

• Limited amount of information

Page 6: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

iOS forensics- physical acquisition- physical acquisition

•Boot-time exploit to run unsigned code

or

•Jailbreak

•Device lock state isn’t relevant, can bruteforce passcode

•Can get all information from the device

Page 7: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

iOS Data ProtectionEvery iOS device contains secure AES engine with two embedded keys:

•GID – shared by all devices of same “family”

•UID – unique per device

•Newer devices have additional UID+ key

There is no known way to extract GID or UID

Page 8: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

iOS data protection (cont-d)

• Content grouped by accessibility requirements:

• Available only when device is unlocked

• Available after first device unlock (and until power off)

• Always available

• Each protection class has a master key

• Master keys are protected by device key and passcode

• Protected master keys form system keybag

• New keys created during device restore

Page 9: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

iOS 4+ passcode• Passcode is used to compute passcode key

• Computation is tied to hardware key (UID/UID+)

• Same passcode will yield different passcode keys on different devices!

• Passcode key is required to unlock most keys from the system keybag

• Most files are protected with NSProtectionNone and don’t require a passcode

• Most keychain items are protected with ...WhenUnlocked or ...AfterFirstUnlock and require a passcode

Page 10: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

iOS 4+ passcode (cont-d)

• Passcode-to-Key transformation is slow

• Offline brute-force currently is not possible

• Requires extracting UID/UID+ key

• On-device bruteforce is slow

• 2 p/s on iPhone 3G, 7 p/s on iPad

• System keybag contains hint on password complexity

Page 11: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

iOS 4+ passcode (cont-d)

Page 12: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

iOS 5 Keychain

• SQLite3 DB, all columns are encrypted Available protection classes

• kSecAttrAccessibleWhenUnlocked (+ ...ThisDeviceOnly)

• kSecAttrAccessibleAfterFirstUnlock (+ ...ThisDeviceOnly)

• kSecAttrAccessibleAlways (+ ...ThisDeviceOnly)

• Random key for each item (AES)

• Item key is protected with corresponding protection class master key

Page 13: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

Ios• Only User partition is encrypted

• Available protection classes:

• NSProtectionNone

• NSProtectionComplete

• NSFileProtectionCompleteUntilFirstUserAuthentication

• NSFileProtectionCompleteUnlessOpen

• Per-file random encryption key

• File key protected with master key is stored in extended attributes (pretty much like Microsoft EFS)

• No protection class - partition key is used

• File system metadata and unprotected files

• Transparent encryption and decryption (same as pre-iOS 4)

Page 14: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

iCloud

• Introduced in Oct 2011

• Introduced with iOS 5

• Successor to MobileMe, .Mac, iTools

• 5 GB free storage

• Up to 50 GB paid storage

• Over 125 million users in April 2012

Page 15: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

iCloud services

Page 16: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

iCloud Control Panel

Page 17: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

iPhone backup - why?

Page 18: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

Mission: impossible :)

Page 19: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

iCloud backup - what• Messages (including iMessages)

• Application data

• Device settings

• Camera roll (photos and videos)

• Visual voicemails

• Purchases (music, movies, TV, apps, books)

• Home screen arrangement

• Ringtones

Page 20: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

iCloud backup - when

• Backup runs daily when device is:

• Connected to the Internet over Wi-Fi

• Connected to a power source

• Locked

• Can force backup

• [Settings] | [iCloud] | [Storage & Backup] | [Back Up Now]

Page 21: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

iCloud backup - how

Page 22: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

iCloud CP: backups

Page 23: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

iCloud backup protocol flow

• Dynamic: endpoints depend on Apple ID

• Built on Google Protocol Buffers (mostly)

• Files are split into chunks

• Apple provides file-to-chunks mapping, chunk encryption keys, and full request info to 3rd-party storage provider (Amazon/Microsoft)

• Encryption key depends on chunk data (deduplication?)

Page 24: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

iCloud backup protocol flow (cont-d)• /mbs/<personId>

• List of backups

• /mbs/<personId>/<backupUDID>/getKeys

• OTA backup keybag

• /mbs/<personId>/<backupUDID>/<snapshotId>/listFiles

• File manifest

• /mbs/<personId>/<backupUDID>/<snapshotId>/getFiles

• File auth tokens

• /mbs/<personId>/authorizeGet

• Info about containers of chunks for "les (FileGroups)

• Request containers of chunks (FileGroups)

• Containers of chunks

Page 25: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

iCloud encryption• Data stored at 3rd-party storage providers is

encrypted

• Apple has encryption keys to that data

• Few files are further encrypted using keys from OTA backup keybag

• Keychain items are encrypted using keys from OTA backup keybag

• Need key 0x835 (securityd) to decrypt most keys from OTA backup keybag

Page 26: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

iCloud backups - summary

• There is no user-con"gurable encryption for iCloud backups

• iCloud backups are stored in Microsoft and Amazon clouds in encrypted form

• Apple holds encryption keys and thus have access to data in iCloud backups

• If Apple stores 0x835 keys then it can also have access to Keychain data (i.e. passwords)

• Apple may have legal obligations to do this (e.g. LE)

Page 27: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

Find My Phone

Page 28: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

FindMyPhone protocol

Page 29: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

FindMyPhone - demo output

Page 30: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

iCloud documents

Page 31: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

iCloud CP: documents

Page 32: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

Get files from iCloudTo get list of files

•Authentication request (with given AppleID & password). Client gets mmeAuthToken in return; which, in order, is used to create authentication token (together with dsid). dsid (Destination Signaling IDentifier) is an unique ID assigned to the user when registering at iCloud.com.

•Request to get AccountSettings. Client gets an URL (ubiquityUrl) with an address to get UUID (unique user identifier), file list, info on file tokens and for authorization.

•Request to get file list (POST). Output (for every file):

• file name• file id• parent folder id• last change time• checksum• access rights

To download given file

•Request to get file token (using file id, checksum and aliasMap).

•Authorization request. Returns information on file chunks and containers. Output: container list (with URLs) and chunk information.

Page 33: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

Files in iCloud

Page 34: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud
Page 35: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

iCloud docs: demo output

Page 36: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

Possible usage• Backups in iCloud

• near-realtime acquisition (SMS, iMessage, mail, call logs)

• browse backup data without actual device

• download only data of specific type (need further work)

• Find My Phone

• keep track

• using Google Maps (or whatever)

• enter/leave some are

• 2+ devices

• Documents in iCloud

• open from 3rd party apps

• track changes

• download unsupported document data

•Forensics!

Page 37: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

Conclusion

• Balance between security, privacy and convenience

• iCloud security risks

• Use additional encryption

• Need further work (contacts, calendar, mode documents, converting documents, partial backup download, decrypting keychain, photo stream, 3rd party apps data: 1Password etc)

Page 38: SynapseIndia iPhone Apps- Presentation OnCracking and Analyzing Apple ICloud

Thank you!

Cracking and Analyzing Apple iCloud backups, Find My iPhone, Document

StorageCracking and Analyzing Apple iCloud backups, Find My iPhone, Document

StorageCracking and Analyzing Apple iCloud backups, Find My iPhone, Document

Storage

CanSecWest 2013Vladimir Katalov, ElcomSoft Co. Ltd.

http://www.elcomsoft.comhttp://blog.crackpassword.com

Facebook: ElcomSoftTwitter: @elcomsoft