136
iOS Application Penetration Testing Attack & Defense Author: JongWon Kim [email protected]

iOS Application Penetation Test

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: iOS Application Penetation Test

iOS Application

Penetration Testing

Attack & Defense

Author:

JongWon Kim

[email protected]

Page 2: iOS Application Penetation Test

Angenda

• What’s the iOS App?

• Monoculture – Code Signing

– Sandboxing

– Encryption

• The Perspective of Pen Tester – Compile Option

– URLScheme

– Insecure Database

– Runtime Analysis

– Transport Security

Page 3: iOS Application Penetation Test

What’s the iOS App?

• Development in Xcode – You don’t have to buy a Mac since this is for

BlackBox Assessment

• Applications written primarily in Objective-C Compiled(ARM) Executable – Need to background about the structure of Objective-C

• Encrypted Executable

• Installed by “mobile” user – Compared to each Android apps which use

different UID/GID

Page 4: iOS Application Penetation Test

Angenda

• What’s the iOS App?

• Monoculture – Code Signing

– Sandboxing

– Encryption

• The Perspective of Pen Tester – Compile Option

– URLScheme

– Insecure Database

– Runtime Analysis

– Transport Security

Page 5: iOS Application Penetation Test

Monoculture – Code Signing

•Code Signing

–Provisioning Profiles

–Signed Applications

–Entitlements

Page 6: iOS Application Penetation Test

Monoculture – Code Signing

• Provisioning Profile

– Asymmetric cryptography

– UDIDS(prevents running of restricted

devices)

– Certificate(with trust based on the

signing by a developer)

– App ID in the info.plist

Page 7: iOS Application Penetation Test

Monoculture – Code Signing

• Developer Certificates

Developer Program

Device

Testing Ad Hoc App Store In-House

Apple Developer No No No No

University Program Yes No No No

Standard Program Yes Yes Yes No

Enterprise Program Yes Yes No Yes

Page 8: iOS Application Penetation Test

Monoculture – Code Signing

• Provisioning Profile

Page 9: iOS Application Penetation Test

Monoculture – Code Signing

• Signed Applications

– All iOS executable binaries and applications

must be signed by a trusted certificate

[Ad-hoc code signed executable]

Page 10: iOS Application Penetation Test

Monoculture – Code Signing

• Signed Applications

– All iOS executable binaries and applications

must be signed by a trusted certificate

[Normal code signed executable]

Page 11: iOS Application Penetation Test

Monoculture – Code Signing

•Entitlements

–Application-Identifier

–Get-task-allow(Debug)

–Keychain-access-groups

Page 12: iOS Application Penetation Test

Monoculture – Code Signing

Page 13: iOS Application Penetation Test

Monoculture – SandBoxing

• Sandboxing – Third party apps assigned “container” seatbelt

profile

– Function calls hooked by the TrustedBSD

layer will pass through Sandbox.kext for

policy enforcement

Compared to

Andorid

UID/GID

Page 14: iOS Application Penetation Test

Monoculture - Encryption

• Nand Solite State – Boot: Low Level Bootloader

– Plog: Effaceable area(BAGI, Dkey, EMF!)

– Nvm: Environments variables

– Firm: iBoot, device tree and boot logos

– Fsys: OS, DATA

– Rsrv: Filesystem partition

boot block 0

plog block 1

nvm blocks 2-7

firm blocks 8-15

fsys blocks 16-4084

rsrv blocks 4085-

4100

Page 15: iOS Application Penetation Test

Monoculture - Encryption

• EMF! – Used to encrypt the filesystem

• Dkey – Used to encrypt the master key of the

protection class "NSFileProtectionNone" (the majority of files)

• BAGI – Used to produce the encryption keys for the

other master keys

Page 16: iOS Application Penetation Test

Monoculture - Encryption

• Data Protection

Level Description

No Protection The file is not encrypted on the file-system

Complete

Protection

The file is encrypted on the file-system and

inaccessible when the device is locked

Complete

Unless Open

The file is encrypted on the file-system and inaccessible

while closed. When a device is unlocked an app can

maintain an open handle to the file even after it is

subsequently locked, however during this time the file will

not be encrypted

Complete Until

First User

Authentication

The file is encrypted on the file-system and inaccessible

until the device is unlocked for the first time. This helps

offer some protection against attacks the require a

device reboot

Dkey

on Plog

Page 17: iOS Application Penetation Test

Monoculture - Encryption

• File System Encryption – Every File is encrypted with unique key "cprotect"

key

– File key is stored in the file metadata

– Metadata is encrypted with EMF Key

– Content is grouped into protection class

– Each protection class assigned a master encryption key

– Master keys are protected by device key and passcode

– Protected master keys form system keybag

Page 18: iOS Application Penetation Test

Monoculture - Encryption

Page 19: iOS Application Penetation Test

Monoculture - Encryption

Page 20: iOS Application Penetation Test

Monoculture - Encryption

Page 21: iOS Application Penetation Test

Monoculture - Encryption

Page 22: iOS Application Penetation Test

Monoculture - Encryption

Page 23: iOS Application Penetation Test

Monoculture – Old Things

• PIE(Positon Independent Executable) – Exploit mitigation security feature that allows an application to

take full advantage of ASLR

• Stack-Smashing Protection – “Canary” is placed on the stack directly before the local variables

to protect the saved base pointer

• Automatic Reference Counting – Introduced in iOS SDK version 5.0 to move the responsibility of

memory management from the developer to the compiler

– Offers some security benefits as it reduces the likelihood of developers introducing memory corruption(specifically object use-after-free and double free vulnerabilities)

Page 24: iOS Application Penetation Test

Angenda

• What’s the iOS App?

• Monoculture – Code Signing

– Sandboxing

– Encryption

• The Perspective of Pen Tester – Compile Option

– URLScheme

– Insecure Database

– Runtime Analysis

– Transport Security

Page 25: iOS Application Penetation Test

Compile Option Check

• PIE(Positon Independent Executable)

• Stack-Smashing Protection

• Automatic Reference Counting

Page 26: iOS Application Penetation Test

Compile Option Check

• Where is the Excutable File? – Smart

– Brute

Page 27: iOS Application Penetation Test

Compile Option Check

• PIE(Positon Independent Executable) – GmailHybrid

– FaceBook

Page 28: iOS Application Penetation Test

Compile Option Check

• Stack-Smashing Protection – GmailHybrid

– FaceBook

Page 29: iOS Application Penetation Test

Compile Option Check

• Automatic Reference Counting – GmailHybrid

– FaceBook

Page 30: iOS Application Penetation Test

Angenda

• What’s the iOS App?

• Monoculture – Code Signing

– Sandboxing

– Encryption

• The Perspective of Pen Tester – Compile Option

– URLScheme

– Insecure Database

– Runtime Analysis

– Transport Security

Page 31: iOS Application Penetation Test

URLSchema - Overview

• No real Inter-Process Communication

• Apps prohibited from sharing because of

sandbox

• Apps sometimes need to share data

• Apps can register a custom protocol

handler

Page 32: iOS Application Penetation Test

URLSchema - Overview

• Two methods for implementing protocol

handlers

• handleOpenURL

– Now deprecated

• openURL

– Provides bundle identifier

– Allows developer to validate source app

Page 33: iOS Application Penetation Test

URLSchema - Attack

• Skype registers the “skype://” protocol

handler

• Malicious web site could make calls

• Skype app did not prompt or validate

before call

– Allows developer to validate source app

• Play the Video

Page 34: iOS Application Penetation Test

Angenda

• What’s the iOS App?

• Monoculture – Code Signing

– Sandboxing

– Encryption

• The Perspective of Pen Tester – Compile Option

– URLScheme

– Insecure Database

– Runtime Analysis

– Transport Security

Page 35: iOS Application Penetation Test

Insecure Data Storage

• Databases

• Plists

• Keyboard Cache

• Image Cache

• Keychain

• Cookie Binary

• Error Logs

• Hidden Files(ex. Citi Mobile app)

– Samples: Password_Keeper, Pic Lock, iPassword

Page 36: iOS Application Penetation Test

Databases - Overview

• Data stored in the Sqlite in un-

encrypted

• SQLite files are stored un-encrypted

in the iOS backups

• Delete files can be recovered by

carving the HFS Journal

• Not deleted completely

Page 37: iOS Application Penetation Test

Databases - Attack

• Password_Keeper – Interfaces

– FaceBook

Page 38: iOS Application Penetation Test

Databases - Attack

• Password_Keeper – Save ID/Password

Page 39: iOS Application Penetation Test

Databases - Attack

• Password_Keeper – Clear Text in the Sqlite

Page 40: iOS Application Penetation Test

Database - Defense

• Do not store sensitive data in clear text • Use custom encryption

• Protect Sqlite files with data protection API

• Implement classes for secure file wipe

• Purge the data upon deletion with VACUUM SQL command – VACUUM rebuild the databases

– Doing it for every delete consume time

• Before deleting the SQL record, replace the data with junk values – Data and Junk value length has to be same

Page 41: iOS Application Penetation Test

Database - Defense

– Step 1: Create the Table

Page 42: iOS Application Penetation Test

Database - Defense

– Step 2: Check out Strings in the Sqlite

Page 43: iOS Application Penetation Test

Database - Defense

– Step 3: Delete one row and Check out deleted

Completely

Page 44: iOS Application Penetation Test

Database - Defense

– Step 4: Delete it completely

Page 45: iOS Application Penetation Test

Insecure Data Storage

• Databases(SQLite, coreData)

• Plists

• Keyboard Cache

• Image Cache

• Keychain

• Cookie Binary

• Error Logs

• Hidden Files(ex. Citi Mobile app)

Page 46: iOS Application Penetation Test

Plists - Overview

• Property list files - Key value pairs stored in binary

• Identified by a file header – bplist

• Designed to store user's properties and configuration information

• Not protected by Data protection

• But Apps store credentials such as username, password, and session information

Page 47: iOS Application Penetation Test

Plists - Attack

• Pic Lock

– FaceBook

Page 48: iOS Application Penetation Test

Plists - Attack

• Pic Lock

Page 49: iOS Application Penetation Test

Plists – Defense

• Do not store sensitive data in Plist files

• If required, use custom encryption

• Create plist files Library/Caches folder

– iTunes does not backup caches directory

• For better security, Implement classes for

secure file wipe

– Before deleting the file overwrite the file bytes with

junk values

Page 50: iOS Application Penetation Test

Insecure Data Storage

• Databases(SQLite, coreData)

• Plists

• Keyboard Cache

• Image Cache

• Keychain

• Cookie Binary

• Error Logs

• Hidden Files(ex. Citi Mobile app)

Page 51: iOS Application Penetation Test

Keyboard Cache - Overview

• Designed to auto complete the

predictive common words

• Secure fields are not stored – passwords are safe

• String with all digits are not stored – Pins and credit card number are safe

• Data typed into text fields are cached

Page 52: iOS Application Penetation Test

Keyboard Cache - Attack

• iPassword

Page 53: iOS Application Penetation Test

Keyboard Cache - Attack

• Keyboard Cache – iPassword

– What if it is banking information?

Page 54: iOS Application Penetation Test

Keyboard Cache - Defense

• Keyboard Cache – Disable auto correction

• Mark it as a secure field – mytextField.secureTextEntry = YES

• Copy&Paste

Page 55: iOS Application Penetation Test

Insecure Data Storage

• Databases(SQLite, coreData)

• Plists

• Keyboard Cache

• Image Cache

• Keychain

• Cookie Binary

• Error Logs

• Hidden Files(ex. Citi Mobile app)

Page 56: iOS Application Penetation Test

Image Cache - Overview

• Takes screen shots of the application

to trick you

• Sensitive data may get cached – App directory/Library/Caches/Snapshots

Page 57: iOS Application Penetation Test

Image Cache - Attack

• Image Cache – Mail App

Press Home Button

Two Times

Page 58: iOS Application Penetation Test

Image Cache - Attack

• Image Cache – Mail App

IPod

My Local

Machine

Page 59: iOS Application Penetation Test

Defense – Image Cache

• Remove sensitive data or change the screen before the applicationDidEnterBackground() function returns

• Instead of hiding or removing sensitive data you can also prevent back-grounding altogerher by setting the "Application does not run in background" property in the application's Info.plist file

Page 60: iOS Application Penetation Test

Databases - Attack

• Databases – Mail App

Page 61: iOS Application Penetation Test

Databases - Attack

• Databases – Mail App(Subject)

Page 62: iOS Application Penetation Test

Databases - Attack

• Databases – Mail App(Body)

Page 63: iOS Application Penetation Test

Insecure Data Storage

• Databases(SQLite, coreData)

• Plists

• Keyboard Cache

• Image Cache

• Keychain

• Cookie Binary

• Error Logs

• Hidden Files(ex. Citi Mobile app)

Page 64: iOS Application Penetation Test

Keychain - Overview

• Keychain encryption is tied to the device

– Protected entries are tied to the user's passcode

• Keychain file is accessible to all the

application

• Application can only acess it's own key

chain items

– Based on app keychain access group

Page 65: iOS Application Penetation Test

Keychain - Overview

Attribute Description

kSecAttrAccessibleAlways The keychain item is always accessible

kSecAttrAccessibleWhenUnlocked The keychain item is only accessible

when the device is unlocked.

kSecAttrAccessibleAfterFirstUnlock

They keychain item is only accessible after

the first unlock from boot. This helps offer

some protection against attacks that require

a device reboot

kSecAttrAccessibleAlwaysThisDevice

Only

The keychain item is always accessible but

cannot be migrated to other devices

kSecAttrAccessibleWhenUnlockedThi

sDeviceOnly

The keychain item is only accessible when

the device is unlocked and may not be

migrated to other devices

kSecAttrAccessibleAfterFirstUnlock

ThisDeviceOnly

The keychain item is accessible after the

first unlock from boot and may not be

migrated to other devices

Page 66: iOS Application Penetation Test

Keychain - Attack

• Keychain_Dumper

Page 67: iOS Application Penetation Test

Keychain - Defense

• Do not store sensitive data in clear text

• Encrypt the data using custom

encryption

• Use data protection API while storing

data in keychain

• By default entries are created with

kSecAttrAccessibleWhenUnlocked data

protection

Page 68: iOS Application Penetation Test

Insecure Data Storage

• Databases(SQLite, coreData)

• Plists

• Keyboard Cache

• Image Cache

• Keychain

• Cookie Binary

• Error Logs

• Hidden Files(ex. Citi Mobile app)

Page 69: iOS Application Penetation Test

Coockies Binary

• Binary file to store the cookies

• Persistent cookies are stored along

with the flags(Secure, HTTPOnly)

• Most iOS apps not prompt the user

for login every time and creates

persistent cookies

Page 70: iOS Application Penetation Test

Cookie Binary

Login

Sucess

IPod

My Local

Machine

Page 71: iOS Application Penetation Test

Insecure Data Storage

• Databases(SQLite, coreData)

• Plists

• Keyboard Cache

• Image Cache

• Keychain

• Cookie Binary

• Error Logs

• Hidden Files(ex. Citi Mobile app)

Page 72: iOS Application Penetation Test

Error Logs

• Apps may write sensitive data in logs – Debugging(NSLog calls)

– Trouble shooting

– Request & Response

• Located at - /private/var/log/syslog

• Syslog is out of sandbox - Any app can access it

• Do not write sensitive data in the syslog file

Page 73: iOS Application Penetation Test

Insecure Data Storage

• Databases(SQLite, coreData)

• Plists

• Keyboard Cache

• Image Cache

• Keychain

• Cookie Binary

• Error Logs

• Hidden Files(ex. Citi Mobile app[Fixed])

Page 74: iOS Application Penetation Test

Angenda

• What’s the iOS App?

• Monoculture – Code Signing

– Sandboxing

– Encryption

• The Perspective of Pen Tester – Compile Option

– URLScheme

– Insecure Database

– Runtime Analysis

– Transport Security

Page 75: iOS Application Penetation Test

Runtime Analysis - Overview

• Developed in Objective – Superset of C

– Exiting methods can be overwritten easily

• Self distributed Apps are not encrypted

• AppStore binaries are encrypted

• Decrypts the apps when loaded into memory

Page 76: iOS Application Penetation Test

Runtime Analysis - Tools

• Clutch – Decrypt the binary

• Class-Dump-Z – Extract the class information and identify

interesting class

• Cycript – Combination of JavaScript and Objective-C

interpreter

– Gives access to all classes and instance variables within the app

• GDB & IDA Pro Samples: Coupang, Password_Keeper, piracydemo2

Page 77: iOS Application Penetation Test

Runtime Analysis –

Decrypt Manually

ARM v6

ARM v7

Encryped

Binary

Page 78: iOS Application Penetation Test

Runtime Analysis –

Decrypt Manually

(gdb) set sharedlibrary load-rules ".*" ".*" none (gdb) set inferior-auto-start-dyld off (gdb) set sharedlibrary preload-libraries off (gdb) rb doModInitFunctions Breakpoint 1 at 0x2fe0d526 <function, no debug info> __dyld__ZN16ImageLoaderMachO18doModInitFunctionsERKN11Image (gdb) r Starting program: /private/var/mobile/Applications/3DC4CAC7-A429-449E-BB6C-A985E3A644 Program received signal SIGABRT, Aborted. 0x3a5b7350 in ?? () (gdb) dump memory coupang.bin 12288 950272 (gdb) kill Kill the program being debugged? (y or n) y (gdb) q

Page 79: iOS Application Penetation Test

Runtime Analysis –

Decrypt Manually

• Success, but it consumes time!!!

Page 80: iOS Application Penetation Test

Runtime Analysis

• Authentication bypass

• Breaking simple locks

• Bypassing restriction that stops apps

from running on Jailbroken device

• Extract hardcode encryption keys

• Extract app passcodes

• Malicious code injection

Page 81: iOS Application Penetation Test

Runtime Analysis - Attack

• Bypassing Lock Screen – Password_Keeper

– FaceBook

Page 82: iOS Application Penetation Test

Runtime Analysis

• Encryption

Page 83: iOS Application Penetation Test

Runtime Analysis –

Decrypt Automatically

• Clutch

Page 84: iOS Application Penetation Test

Runtime Analysis - ClassDump

• ClassDump

No More

Obfuscation

Page 85: iOS Application Penetation Test

Runtime Analysis - ClassDump

• ClassDump

Page 86: iOS Application Penetation Test

Runtime Analysis - Cycript

• Cycript

Page 87: iOS Application Penetation Test

Runtime Analysis - ClassDump

• Cycript

Page 88: iOS Application Penetation Test

Runtime Analysis - Cycript

• Cycript

Page 89: iOS Application Penetation Test

Runtime Analysis - Cycript

• Cycript

Step(1/3)

Enter the Code

Page 90: iOS Application Penetation Test

Runtime Analysis - Cycript

• Cycript

Step(2/3)

Page 91: iOS Application Penetation Test

Runtime Analysis - Cycript

• Cycript

Step(3/3)

Get rid of

Lock Screen

Page 92: iOS Application Penetation Test

Runtime Analysis

• Authentication bypass

• Breaking simple locks

• Bypassing restriction that stops apps

from running on Jailbroken device

• Extract hardcode encryption keys

• Extract app passcodes

• Malicious code injection

Page 93: iOS Application Penetation Test

Runtime Analysis - Attack

• Bypassing JailBreak Detection – Demo_App

Page 94: iOS Application Penetation Test

Runtime Analysis - Attack

• Figure out Attractive Instance

Page 95: iOS Application Penetation Test

Runtime Analysis - Attack

• Figure out Attractive Instance

Page 96: iOS Application Penetation Test

Runtime Analysis - Attack

• Figure out Attractive Instance

Page 97: iOS Application Penetation Test

Runtime Analysis - GDB

• GDB – Set the BreakPoint

Page 98: iOS Application Penetation Test

Runtime Analysis - GDB

• GDB - Continue

Continue on GDB and Hit the

“Am I Jailbroken?”

Page 99: iOS Application Penetation Test

Runtime Analysis - GDB

• GDB – Set the breakpoints at

“objc_msgSend”

Page 100: iOS Application Penetation Test

Runtime Analysis - GDB

• GDB – Check Out Breakpoints

Page 101: iOS Application Penetation Test

Runtime Analysis - GDB

• GDB – That’s not what we want

Page 102: iOS Application Penetation Test

Runtime Analysis - GDB

• GDB – That’s not what we want

Page 103: iOS Application Penetation Test

Runtime Analysis - GDB

• GDB – That’s not what we want

Page 104: iOS Application Penetation Test

Runtime Analysis - GDB

• GDB – That’s exactly what we want

Page 105: iOS Application Penetation Test

Runtime Analysis - GDB

• GDB – Manipulate the r0

Page 106: iOS Application Penetation Test

Runtime Analysis - GDB

• GDB

Page 107: iOS Application Penetation Test

Runtime Analysis - GDB

• GDB - Sueccess

Page 108: iOS Application Penetation Test

Runtime Analysis - Defense

• Detection JailBreak(1) – Sandbox

Page 109: iOS Application Penetation Test

Runtime Analysis - Defense

• Detection JailBreak(2) – Filesystem

1. /Library/MobileSubstrate/MobileSubstrate.dylib

2. /Application/Cydia.app

3. /var/cache/apt

4. /var/lib/apt

5. /var/lib/cydia

6. /var/log/syslog

7. /var/tmp/cydia.log

8. /bin/bash, /bin/sh

9. /usr/sbin/sshd

10. /usr/libexec/ssh-keysign

11. /etc/ssh/sshd_config

12. /etc/apt

Page 110: iOS Application Penetation Test

Runtime Analysis - Defense

• Detection JailBreak(3) – Symbolic Link

1. /Library/Ringtones

2. /Library/Wallpaper

3. /Library/arm-apple-darwin9

4. /usr/include

5. /usr/libexec

6. /usr/share

Page 111: iOS Application Penetation Test

Runtime Analysis - Defense

• Protect Runtime – OZ option: Inline compile

– Strip: Get rid of unnessesary symbol table

– Debugging Flag: P_Traced

– dladdr: Checking address space

Page 112: iOS Application Penetation Test

Angenda

• What’s the iOS App?

• Monoculture – Code Signing

– Sandboxing

– Encryption

• The Perspective of Pen Tester – Compile Option

– URLScheme

– Insecure Database

– Runtime Analysis

– Transport Security

Page 113: iOS Application Penetation Test

Transport Security - Overview

•UDID

•GeoLocation

•SSL

•Mac Address

Page 114: iOS Application Penetation Test

Transport Security - UDID

• Much like the Pentium 3 CPU, each

Apple iPhone is equipped with a unique,

application-visible serial number(40-

characcter) called a Unique Device ID

(UDID).

• According to Apple, the use of UDIDs

allows businesses to ensure that devices

continue to comply with required policies.

• Not Any more!!!

Page 115: iOS Application Penetation Test

Transport Security - UDID

Page 116: iOS Application Penetation Test

Transport Security - UDID

Page 117: iOS Application Penetation Test

Transport Security - Overview

•UDID

•GeoLocation

•SSL

•Mac Address

Page 118: iOS Application Penetation Test

Transport Security - GeoLocation

• Provided by the Core Location framework

• Avoid being “too accurate”

• Can be set by one of the following constants: – kCLLocationAccuracyBestForNavigation;

– kCLLocationAccuracyBest;

– kCLLocationAccuracyNearestTenMeters;

– kCLLocationAccuracyHundredMeters;

– kCLLocationAccuracyKilometer;

– kCLLocationAccuracyThreeKilometers;

Page 119: iOS Application Penetation Test

Transport Security - GeoLocation

• Without Agreement

Page 120: iOS Application Penetation Test

Transport Security - GeoLocation

• Without Agreement

Page 121: iOS Application Penetation Test

Transport Security - Overview

•UDID

•GeoLocation

•SSL

•Mac Address

Page 122: iOS Application Penetation Test

Transport Security - SSL

• Vunerable to MITM

– ex) Global Banking App(It uses

“allowsAnyHTTPSCertificateForHost” which

overrides self-signed certificate)

Page 123: iOS Application Penetation Test

Transport Security - SSL

• Password Authentication

Page 124: iOS Application Penetation Test

Transport Security - SSL

• Password Authentication

Page 125: iOS Application Penetation Test

Transport Security - SSL

• Password Authentication

Page 126: iOS Application Penetation Test

Transport Security - SSL

• Password Authentication

Page 127: iOS Application Penetation Test

Transport Security - SSL

• Password Authentication

Page 128: iOS Application Penetation Test

Transport Security –

SSL(Defense)

• NSURLRequest – Prohibit the use of self-signed

certificates(!allowsAnyHTTPSCertificateForHost)

• NSURLConnection – Ignore cert

usingcontinueWithoutCredentialForAuthenticationChallenge selector

• CFNetwork framework – kCFStreamSSLAllowsExpiredCertificates

– kCFStreamSSLAllowsAnyRoot

– kCFStreamSSLAllowsAnyRoot

– kCFStreamSSLValidatesCertificateChain

Page 129: iOS Application Penetation Test

Transport Security - Overview

•UDID

•GeoLocation

•SSL

•Mac Address

Page 130: iOS Application Penetation Test

Transport Security - MAC

• Ads

Page 131: iOS Application Penetation Test

Transport Security - MAC

• Ads

Page 132: iOS Application Penetation Test

Transport Security - MAC

• Ads

Page 133: iOS Application Penetation Test

Reference - 1

• Half of iOS apps 'violate Apple's privacy policy

– http://www.digitalspy.co.uk/tech/news/a493520/half-of-ios-apps-violate-apples-privacy-policy.html

• iOS_Application Insecurity final

– http://www.mdsec.co.uk/research/iOS_Application_Insecurity_final.pdf

• iOS Application Insecurity wp v1.0 final

– http://www.mdsec.co.uk/research/iOS_Application_Insecurity_wp_v1.0_final.pdf

• Introduction to ios platform security

– http://blog.mdsec.co.uk/2012/05/introduction-to-ios-platform-security.html

• Code Signing

– http://installbuilder.bitrock.com/docs/installbuilder-userguide/ar01s16.html

– http://developer.apple.com/library/mac/#technotes/tn2206/_index.html

Page 134: iOS Application Penetation Test

Reference - 2

• Pentesting iPhone Applications

– http://resources.infosecinstitute.com/pentesting-iphone-applications/

– http://www.securitylearn.net/

• iOS Application Security part4

– http://resources.infosecinstitute.com/ios-application-security-part-4-runtime-analysis-

using-cycript-yahoo-weather-app/

• Cycript_Tricks

– http://iphonedevwiki.net/index.php/Cycript_Tricks

• Keychain Dumper

– https://github.com/ptoomey3/Keychain-Dumper

• Books

– Hacking and Securing iOS Applications

• iOS Secure Development Source Boston 2011

– https://www.isecpartners.com/media/12964/ios_secure_development_source_bosto

n_2011.pdf

• Auditting iPhone and iPad applications by Ilja van Sprundel

• DaiZovi/BH_US_11_DaiZovi_iOS_Security_WP

– http://media.blackhat.com/bh-us-

11/DaiZovi/BH_US_11_DaiZovi_iOS_Security_WP.pdf

Page 135: iOS Application Penetation Test

Reference - 3

• Reverse engineering sous Android et iOS

– www.ossir.org/jssi/jssi2013/3A.pdf

• iPhone data protection in depth

– http://conference.hitb.org/hitbsecconf2011ams/materials/D2T2%20-%20Jean-Baptiste%20Be%CC%81drune%20&%20Jean%20Sigwald%20-%20iPhone%20Data%20Protection%20in%20Depth.pdf

• Apple Sandbox

– http://securityevaluators.com/files/papers/apple-sandbox.pdf

• iOS_data_protection

– http://ensiwiki.ensimag.fr/images/7/7f/SecurIMAG-2012-09-27-iOS_data_protection.pdf

• syscan11 breaking ios code signing

– http://reverse.put.as/wp-content/uploads/2011/06/syscan11_breaking_ios_code_signing.pdf

• Syscan-2012-iOS-Applications-and-the-Lion-City-Presso

– http://reverse.put.as/wp-content/uploads/2011/06/Syscan-2012-iOS-Applications-and-the-Lion-City-Presso.pdf

• BlackHat_EU_2011_Dhanjani_Attacks_Against_Apples_iOS-WP

– http://media.blackhat.com/bh-eu-11/Nitesh_Dhanjani/BlackHat_EU_2011_Dhanjani_Attacks_Against_Apples_iOS-WP.pdf

Page 136: iOS Application Penetation Test

- Thank you -