ICloud Keychain and IOS 7 Data Protection Presentation
ICloud Keychain and IOS 7 Data Protection Presentation
and
iOS 7 Data Protection
Andrey Belenko
Sr. Security Engineer @ viaForensics
Alexey Troshichev
@hackappcom founder
What is iCloud?
Whats inside?
Documents
Photos
Keychain
Hackers view
Bruteforce protection?
Bruteforce protection?
Bruteforce protection?
Find My iPhone
Brought to you by
hackapp.com
!
github.com/hackappcom/ibrute
@hackappcom
iCloud Keychain
Image: Apple Inc.
Motivation
http://support.apple.com/kb/HT4865
Intercepting SSL
Root CA cert
Proxy settings
SSL Proxy
(Burp, Charles, )
Authentication
GET /authenticate
AppleID, Password
DsID, mmeAuthToken, fmipAuthToken
icloud.com
/getAccountSettings
/getAccountSettings
Setup Options
*.keyvalueservice.icloud.com
Some Secret
*.escrowproxy.icloud.com
Key-Value Store
Not new
com.apple.security.cloudkeychainproxy3
Syncing between devices
com.apple.sbd3 (securebackupd3)
Copy to restore if no other devices
Escrow Proxy
Image: mariowiki.com
Key-Value Store
com.apple.security.cloudkeychainproxy3
S(D1_priv, D1_pub)
S(userPwd, D1_pub)
S(usrPwd, D2_pub)
Key-Value Store
com.apple.sbd3
Key
Description
com.apple.securebackup.enabled
com.apple.securebackup.record
SecureBackupMetadata
BackupKeybag
BackupUsesEscrow
BackupVersion
Version, currently @1
BackupUUID
Backup Keybag
Keychain Passwords
Key 1
yMa9ohCJ
Key 2
Key 3
AES-GCM
256 bit
tzzcVhE7
sDVoCnb
AES-Wrap Keys
RFC 3394
Backup Keybag
Key 1
Key 2
Key 3
AES-GCM
256 bit
Keychain Passwords
yMa9ohCJ
tzzcVhE7
sDVoCnb
AES-Wrap Keys
RFC 3394
Backup Keybag
Key 1
Key 2
Key 3
AES-GCM
256 bit
*.keyvalueservice.icloud.com
Keychain Passwords
yMa9ohCJ
tzzcVhE7
sDVoCnb
PBKDF2
SHA-256 x 10000
Random Password
BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4
AES-Wrap Keys
RFC 3394
Backup Keybag
Key 1
Key 2
Key 3
AES-GCM
256 bit
*.keyvalueservice.icloud.com
Keychain Passwords
yMa9ohCJ
tzzcVhE7
sDVoCnb
PBKDF2
SHA-256 x 10000
Random Password
BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4
AES-CBC
256 bit
*.escrowproxy.icloud.com
AES-Wrap Keys
RFC 3394
Backup Keybag
Key 1
Key 2
Key 3
AES-GCM
256 bit
*.keyvalueservice.icloud.com
Keychain Passwords
yMa9ohCJ
tzzcVhE7
sDVoCnb
Combats sniffing/MITM
Agreed-upon parameters:
Password verifier:
SALT random
x H(SALT,Password)
v g^x
Key Negotiation
a random, A g^a
ID, A
SALT, B
b random, B kv + g^b
u H(A, B)
u H(A, B)
x H(SALT, Password)
S (B - kg^x) ^ (a + ux)
K H(S)
S (Av^u) ^ b
K H(S)
Key Verification
M H(H(N) H(g), H(ID), SALT, A, B, K)
M
H(A, M, K)
(Aborts if M is invalid)
Agreed-upon parameters:
Password verifier:
H SHA-256
N, g RFC 5054 w. 2048-bit group
k H(N, g)
SALT random
x H(SALT,Password)
v g^x
Key Negotiation
a random, A g^a
b random, B kv + g^b
u H(A, B)
u H(A, B)
x H(SALT, Password)
S (B - kg^x) ^ (a + ux)
K H(S)
S (Av^u) ^ b
K H(S)
Key Verification
M H(H(N) H(g), H(ID), SALT, A, B, K)
M, SMS CODE
H(A, M, K)
(Aborts if M is invalid)
OK
OK
OK
Description
get_club_cert
enroll
get_records
get_sms_targets
generate_sms_challenge
srp_init
recover
alter_sms_target
Escrow Record
iCloud Security Code
1234
PBKDF2
SHA-256 x 10000
Random Password
BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4
AES-CBC
256 bit
*.escrowproxy.icloud.com
AES-Wrap Keys
RFC 3394
*.keyvalueservice.icloud.com
Keychain Passwords
Backup Keybag
Key 1
Key 2
Key 3
AES-GCM
256 bit
yMa9ohCJ
tzzcVhE7
sDVoCnb
Escrow Record
iCloud Security Code
1234
Random Password
BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4
PBKDF2
SHA-256 x 10000
AES-CBC
256 bit
*.escrowproxy.icloud.com
Escrow Record
Key PBKDF2-SHA256(iCSC, 10000)
EscrowRecord AES-CBC(Key, RandomPassword)
Escrow Record
Key PBKDF2-SHA256(iCSC, 10000)
EscrowRecord AES-CBC(Key, RandomPassword)
Escrow Record
Key PBKDF2-SHA256(iCSC, 10000)
EscrowRecord AES-CBC(Key, RandomPassword)
Escrow Record
Key PBKDF2-SHA256(iCSC, 10000)
EscrowRecord AES-CBC(Key, RandomPassword)
Escrow Record
Key PBKDF2-SHA256(iCSC, 10000)
EscrowRecord AES-CBC(Key, RandomPassword)
Escrow Record
Key PBKDF2-SHA256(iCSC, 10000)
Setup Options
Complex iCSC
iCloud Security Code
correct horse battery staple
PBKDF2
SHA-256 x 10000
Random Password
BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4
AES-CBC
256 bit
*.escrowproxy.icloud.com
AES-Wrap Keys
RFC 3394
Backup Keybag
Key 1
Key 2
Key 3
AES-GCM
256 bit
*.keyvalueservice.icloud.com
Keychain Passwords
yMa9ohCJ
tzzcVhE7
sDVoCnb
Complex iCSC
Setup Options
Random iCSC
iCloud Security Code
correct horse battery staple
PBKDF2
SHA-256 x 10000
Random Password
AES-CBC
256 bit
BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4
*.escrowproxy.icloud.com
AES-Wrap Keys
RFC 3394
*.keyvalueservice.icloud.com
Keychain Passwords
Backup Keybag
Key 1
Key 2
Key 3
AES-GCM
256 bit
yMa9ohCJ
tzzcVhE7
sDVoCnb
Random iCSC
iCloud Security Code
correct horse battery staple
PBKDF2
SHA-256 x 10000
Random Password
BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4
AES-CBC
256 bit
*.escrowproxy.icloud.com
AES-Wrap Keys
RFC 3394
Backup Keybag
Key 1
Key 2
Key 3
AES-GCM
256 bit
*.keyvalueservice.icloud.com
Keychain Passwords
yMa9ohCJ
tzzcVhE7
sDVoCnb
Random iCSC
Random Password
BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4
AES-Wrap Keys
RFC 3394
Backup Keybag
Key 1
Key 2
Key 3
AES-GCM
256 bit
*.keyvalueservice.icloud.com
Keychain Passwords
yMa9ohCJ
tzzcVhE7
sDVoCnb
Random iCSC
Setup Options
iCloud
Keychain
Keychain
Backup
Keychain
Sync
Master
Password
Escrow
No iCloud Security Code
Random iCloud Security Code
Complex iCloud Security Code
Simple iCloud Security Code
Conclusions
Conclusions
Thank You!
Questions are welcome :-)
!
!
@abelenko
@hackappcom