Home
Explore
Submit Search
Upload
Login
Signup
Advertisement
iOS Application Security Testing
Report
Blueinfy Solutions
Follow
Web Security Products, Consulting & Training Company
Feb. 2, 2016
•
0 likes
3 likes
×
Be the first to like this
Show More
•
1,857 views
views
×
Total views
0
On Slideshare
0
From embeds
0
Number of embeds
0
Check these out next
Web Services Hacking and Security
Blueinfy Solutions
Security vulnerabilities decomposition
Katy Anton
Authentication: Cookies vs JWTs and why you’re doing it wrong
Derek Perkins
CIS13: Bootcamp: Ping Identity OAuth and OpenID Connect In Action with PingFe...
CloudIDSummit
Pentesting web applications
Satish b
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
Sam Bowne
Api security
teodorcotruta
OAuth 2.0 Security Reinforced
Torsten Lodderstedt
1
of
65
Top clipped slide
iOS Application Security Testing
Feb. 2, 2016
•
0 likes
3 likes
×
Be the first to like this
Show More
•
1,857 views
views
×
Total views
0
On Slideshare
0
From embeds
0
Number of embeds
0
Download Now
Download to read offline
Report
Software
iOS App testing
Blueinfy Solutions
Follow
Web Security Products, Consulting & Training Company
Advertisement
Advertisement
Advertisement
Recommended
Android attacks
Blueinfy Solutions
1.2K views
•
58 slides
Mobile Application Scan and Testing
Blueinfy Solutions
1.3K views
•
65 slides
Android secure coding
Blueinfy Solutions
1.3K views
•
20 slides
Html5 on mobile
Blueinfy Solutions
1K views
•
50 slides
Applciation footprinting, discovery and enumeration
Blueinfy Solutions
2.4K views
•
48 slides
Mobile code mining for discovery and exploits nullcongoa2013
Blueinfy Solutions
1K views
•
80 slides
More Related Content
Slideshows for you
(20)
Web Services Hacking and Security
Blueinfy Solutions
•
6.1K views
Security vulnerabilities decomposition
Katy Anton
•
495 views
Authentication: Cookies vs JWTs and why you’re doing it wrong
Derek Perkins
•
35K views
CIS13: Bootcamp: Ping Identity OAuth and OpenID Connect In Action with PingFe...
CloudIDSummit
•
12.4K views
Pentesting web applications
Satish b
•
12.4K views
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
Sam Bowne
•
3.8K views
Api security
teodorcotruta
•
725 views
OAuth 2.0 Security Reinforced
Torsten Lodderstedt
•
2.3K views
CNIT 129S: Ch 3: Web Application Technologies
Sam Bowne
•
1.1K views
Core defense mechanisms against security attacks on web applications
Karan Nagrecha
•
1.3K views
The Ultimate Guide to Mobile API Security
Stormpath
•
2.2K views
WebApp
Unk9vvN
•
225 views
CIS13: Bootcamp: Ping Identity SAML in Action with PingFederate Hands-On
CloudIDSummit
•
7.3K views
CNIT 129S: Securing Web Applications Ch 1-2
Sam Bowne
•
2K views
CNIT 128: 6: Mobile services and mobile Web (part 1: Beginning Through OAuth)
Sam Bowne
•
418 views
Token Authentication for Java Applications
Stormpath
•
8.5K views
CNIT 129S: 13: Attacking Users: Other Techniques (Part 2 of 2)
Sam Bowne
•
811 views
Protecting Your APIs Against Attack & Hijack
CA API Management
•
18.3K views
Alfresco DevCon 2019: Encryption at-rest and in-transit
Toni de la Fuente
•
1.1K views
D@W REST security
Gaurav Sharma
•
474 views
Similar to iOS Application Security Testing
(20)
Pentesting iPhone applications
Satish b
•
9.4K views
Expand Your Control of Access to IBM i Systems and Data
Precisely
•
126 views
Controlling Access to IBM i Systems and Data
Precisely
•
882 views
Pentesting Mobile Applications (Prashant Verma)
ClubHack
•
3.4K views
iOS application (in)security
iphonepentest
•
9.1K views
Security Imeprative for iOS and Android Apps
Symosis Security (Previously C-Level Security)
•
1K views
Learning about Security and Compliance in Office 365
Aptera Inc
•
832 views
AWS Summit 2013 | India - Extend your Datacenter in the Cloud and achieve Hig...
Amazon Web Services
•
1.1K views
Android Penetration Testing - Day 3
Mohammed Adam
•
41 views
Evaluating iOS Applications
iphonepentest
•
6.4K views
How to write secure code
Flaskdata.io
•
100 views
Citrix Day 2014: ShareFile Enterprise
Digicomp Academy AG
•
3.8K views
What Does a Full Featured Security Strategy Look Like?
Precisely
•
26 views
Q42015 SolarWinds Federal SE Webinar - Best Practices for IT Asset Discovery:...
SolarWinds
•
1.3K views
Understanding Database Encryption & Protecting Against the Insider Threat wit...
MongoDB
•
2.6K views
SCIM: Why It’s More Important, and More Simple, Than You Think - CIS 2014
Kelly Grizzle
•
17.2K views
CIS14: SCIM: Why It’s More Important, and More Simple, Than You Think
CloudIDSummit
•
1K views
Governance and Security in Cloud and Mobile Apps
Michael Scheidell
•
5K views
Windows Phone 8 Security and Testing WP8 Apps
Jorge Orchilles
•
1.9K views
Compliance technical controls and you rva sec 2019
Derek Banks
•
221 views
Advertisement
More from Blueinfy Solutions
(12)
Source Code Analysis with SAST
Blueinfy Solutions
•
2.7K views
HTML5 hacking
Blueinfy Solutions
•
3.1K views
CSRF, ClickJacking & Open Redirect
Blueinfy Solutions
•
5.5K views
XSS - Attacks & Defense
Blueinfy Solutions
•
3.9K views
Defending against Injections
Blueinfy Solutions
•
2.3K views
XPATH, LDAP and Path Traversal Injection
Blueinfy Solutions
•
3.1K views
Blind SQL Injection
Blueinfy Solutions
•
3.2K views
Application fuzzing
Blueinfy Solutions
•
2.3K views
SQL injection basics
Blueinfy Solutions
•
4.1K views
Assessment methodology and approach
Blueinfy Solutions
•
2.7K views
HTTP protocol and Streams Security
Blueinfy Solutions
•
2.5K views
Advanced applications-architecture-threats
Blueinfy Solutions
•
2.8K views
Recently uploaded
(20)
manual de acceso a slidesahre
AvilaCabellos
•
0 views
How Blockchain Tech is Powering WEB3.pdf
janakkumar16
•
0 views
Sales Whatsapp Messaging
Geminate Consultancy Services
•
5 views
Face Recognition attendance System.pptx
Tejas More
•
14 views
Sending 500 Calendar Invites May 29.pdf
31events.com
•
0 views
ZatinshchikovSV_M112201_Dragonblood_v2.pptx
ssuser5f47eb
•
1 view
SEMINAR Presentation ppt.pptx
WageYado
•
2 views
Blood Bank Managment System.pdf
Tejas More
•
4 views
ChatGPT Chatbot Integration with odoo
Geminate Consultancy Services
•
0 views
6 strategies to make your employees feel heard.docx
sweety618010
•
0 views
Best CRM Software for Business
Kit 19
•
0 views
Basics of Javascript
Universe41
•
2 views
Branch and bound.ppt
umairshams6
•
2 views
Sending a Calendar Invite to a VIP LIST - .pdf
31events.com
•
0 views
Why does your business need an enterprise portal.pdf
AnandPatel966376
•
0 views
Testing Contents.docx
ssuser305f65
•
3 views
embedded-linux-120203.pdf
twtester
•
0 views
HCL BigFix - DNUG Stammtisch Salzburg
DNUG e.V.
•
0 views
无法毕业?澳大利亚科廷科技大学毕业证书和学位证书办理
sefomo
•
2 views
dokumen.tips_ebs-r12-subledger-accounting.pdf
SayedMahfouz3
•
0 views
Advertisement
iOS Application Security Testing
© Blueinfy Solutions iOS
Attacks
© Blueinfy Solutions Insecure
Data Storage
© Blueinfy Solutions Insecure
Storage • Why application needs to store data – Ease of use for the user – Popularity – Competition – Activity with single click – Decrease Transaction time – Post/Get information to/from Social Sites • 9 out of 10 applications have this vulnerability
© Blueinfy Solutions Insecure
Storage • How attacker can gain access – Wifi – Default password after jail breaking (alpine) – Physical Theft – Temporary access to device
© Blueinfy Solutions Insecure
Storage • What information we usually find – Authentication Credentials – Authorization tokens – Financial Statements – Credit card numbers – Owner’s Information – Physical Address, Name, Phone number – Social Engineering Sites profile/habbits – SQL Queries
© Blueinfy Solutions System
Information Detail Location Applications /var/stash/Applications Etc /private/etc Var /private/var User /var/mobile Provisioning Profile /var/mobileDevice/ProvisioningProfiles Logs /var/log, /var/logs /var/mobile/Library/Logs Network Settings / var/preferences/SystemConfiguration/com.apple.network.identif ication.plist Wifi Settings /var/preferences/SystemConfiguration/com.apple.wifi.plist /var/preferences/SystemConfiguration/preferences.plist Apple ID, Owner information and Firmware Information /root/Library/Lockdown/data_ark.plist Keychain /var/Keychains KeyBoard Cache /User/Library/Keyboard/dynamic-text.dat Tmp /private/var/tmp
© Blueinfy Solutions Application
Information Detail Location Address Book /var/mobile/Library/AddressBook/AddressBook.sqlitedb /var/mobile/Library/AddressBook/ AddressBookImages.sqlitedb Last searched Google maps /var/mobile/Library/Caches/MapTiles/MapTiles.sqlitedb Google Map History Information /var/mobile/Library/Maps/History.plist /var/mobile/Library/Maps/Directions.plist Calendar /var/mobile/Library/Calendar/Calendar.sqlitedb Data under notes application /var/mobile/Library/Notes/notes.sqlite Configuration file for Applications /var/mobile/Library/Preferences Photos /var/mobile/Media/DCIM/ Application Pictures when HOME button is pressed (Each application has its own directory - Default applications) /User/Library/Caches/Snapshots
© Blueinfy Solutions Default
Services Information Detail Location Call History (Odd number is for Outgoing calls, Even number is for Incoming calls) /var/mobile/Library/Callhistory/call_history.db SMS (Odd number is for Outgoing calls, Even number is for Incoming calls) /var/mobile/Library/SMS/sms.db Voicemail /var/mobile/Library/Voicemail/voicemail.db Voice mail recording /var/mobile/Library/Voicemail/ System provided applications, ringtons and wallpapers /var/stash Call History /var/wireless/Library/CallHistory Call Log /var/wireless/Library/logs Call Preferences /var/wireless/Library/Preferences
© Blueinfy Solutions User
Installed Application Detail Location Installed Applications /User/Applications or /private/var/mobile/Applications Application Directory (Binary, supporting files /User/Applications/<app GUID>/<appname.app> or /private/var/mobile/Applications/<app GUID>/<appname.app> Applications documents i.e. images, PDF, text files /User/Applications/<app GUID>/Documents Application cookies /User/Applications/<app GUID>/Library/Cookies/Cookies.binarycookies Application Preferences (plist files) /User/Applications/<app GUID>/Library/Preferences Application temporary storage /User/Applications/<app GUID>/tmp Application crash report /User/Library/Logs/CrashReporter Application Screens when pressed HOME button /User/Applications/<app GUID>/Library/Caches/Snapshots
© Blueinfy Solutions Browser
information Detail Location Browser Cookie /var/mobile/Library/Cookies/Cookies.binarycookies Browser favorites (Book marks) /var/mobile/Library/Safari/Bookmarks.db Browser History /var/mobile/Library/Safari/History.plist Browser Settings /var/mobile/Library/Preferences/com.apple.mobilesafari.plist Browser Cache /User/Library/Caches/com.apple.WebAppCache/ApplicationCache.db
© Blueinfy Solutions Insecure
Data Storage • Access file system – CyberDuck • Plist files – xCode/plist Editor • Keychain file (hardware bound ency) – KeyChain Dumper • Information in Db files – SQLite Browser • Logs with queries – SQLite Browser Hands On – Look for Sensitive information in DVDs4Less Application
© Blueinfy Solutions Implementation
© Blueinfy Solutions Local
file access
© Blueinfy Solutions Insufficient
Transport Layer Protection
© Blueinfy Solutions Insecure
Network Channel • Important to encrypt data in the transmission • Easy to perform MiM attacks as Mobile devices uses untrusted network i.e open/Public WiFi, HotSpot, Carrier’s Network • Application deals with sensitive data i.e. – Authentication credentials – Authorization token – PII Information (Privacy Violation) (Owner Name, Phone number, UDID
© Blueinfy Solutions Insecure
Network Channel • Can sniff the traffic to get an access to sensitive data • SSL is the best way to secure communication channel • Common Issues – Does not deprecate HTTP requests – Allowing invalid certificates – Sensitive information in GET requests
© Blueinfy Solutions UI
Impersonation/Spoofing
© Blueinfy Solutions Activity
Monitoring
© Blueinfy Solutions Monitoring •
Default OS behavior after iOS 4.0 to cache all the URLS (Request/Response) in the local storage in file named cache.db file • Request/Response includes the login request with username and password • Cache.db file is not encrypted Hands On – Locate cache.db file in DVDs4less application and see request/response
© Blueinfy Solutions Malicious
Monitoring • Few services are shared between all the applications • A malicious user can write application to monitor these services – including clipboard monitor
© Blueinfy Solutions Sensitive
Data Retrieval
© Blueinfy Solutions PII
Information Leakage • Application usually have access to user’s private information i.e. Owner Name, Location, Physical Address, AppID, Phone Number • This information needs to be handled very carefully as per the law in some countries • Storing this information in plain text is not allowed in some countries
© Blueinfy Solutions Client
Side Injection
© Blueinfy Solutions SQL
Injection in Local database • Most Mobile platforms uses SQLite as database to store information on the device • Using any SQLite Database Browser, it is possible to access database logs which has queries and other sensitive database information • In case application is not filtering input, SQL Injection on local database is possible
© Blueinfy Solutions Poor
Authorization and Authentication
© Blueinfy Solutions Authorization
& Authentication • No password complexity specially on mobile • Hidden/No Logout button • Long session time out • No account lock out • Authorization flags or based on the local storage
© Blueinfy Solutions Improper
Session Handling
© Blueinfy Solutions Improper
Session • Session is key for any application for authorization • Application is sending sensitive information in GET request (Be it on HTTP or HTTPS) • GET requests are logged at multiple places • Ends us giving away session to the privilege user with malicious intent
© Blueinfy Solutions Session
Cookie • HTTP is state-less protocol • Application leverages session cookie to maintain state for the user • Session cookies are stored in binary format in iOS • File structure is public information • A python script has been written to uncover cookies (http://securitylearn.net/wp-content/uploads/tools/iOS/BinaryCookieReader.py)
© Blueinfy Solutions Security
Decisions Via Untrusted Inputs
© Blueinfy Solutions Untrusted
Source • Any input from client side which can be modified • Mainly authentication and authorization decisions based on the untrusted input • Easiest way for developer to solve complex issues/functionality • Attacker can get this information by either reverse engineering application or by checking local storage
© Blueinfy Solutions KeyChain
Dumper (Old Way) • Upload Keychain Dumper in "/private/var“ • Dump all of the entitlements necessary to access the entries in your target's keychain. • ./keychain_dumper -e > /var/tmp/entitlements.xml • Sign the obtained entitlements into keychain_dumper. • ldid -S/var/tmp/entitlements.xml keychain_dumper • Get all the keys • ./keychain_dumper
© Blueinfy Solutions KeyChain
Dumper – DON’T • Do not change Path (Tool just does not do a job well) • Set proper permissions – Keychain_dumper – Executable permission – keychain-2.db – Read permission • Files needs to be deleted before running it again
© Blueinfy Solutions KeyChain
Dumper – Easy Way • Shell Script • Shell Script to clean chmod +x /private/var/keychain_dumper chmod +r /private/var/Keychains/keychain-2.db ./keychain_dumper -e > /var/tmp/entitlements.xml ldid -S/var/tmp/entitlements.xml keychain_dumper ./keychain_dumper > /tmp/keys.txt rm -f /private/var/keychain_dumper rm -f /var/tmp/entitlements.xml
© Blueinfy Solutions KeyChain
Dumper (After 5.0) • Upload Keychain Dumper in "/private/var“ • Dump all of the entitlements necessary to access the entries in your target's keychain. • ./keychain_dumper -e > /var/tmp/entitlements.xml • To sign keychain_dumper file, transfer keychain_dumper and entitlements.xml file to any MAC machine • Install Keychain Access on MAC
© Blueinfy Solutions KeyChain
Dumper (Cont…) • Open keychain_access by opening binary at (/Applications/Utilties/Keychain Access.app/Contents/MacOS/Keychain Access) • Create a “code signing “ “self signed certificate” – Select Type as “Self Signed Root” – Select “Code Signing”
© Blueinfy Solutions KeyChain
Dumper (Cont…) • Sign keychain_dumper file using codesign command # codesign -fs "Test" --entitlements entitlements.xml keychain_dumper • Upload keychain_dumper to iOS device • Get all the keys • ./keychain_dumper
© Blueinfy Solutions KeyChain
Dumper – New Version • Easy as running a command • Upload on to server in /var directory • Give execute permission – Chmod +x /var/keychain_dumper • Get all the keys • ./keychain_dumper
© Blueinfy Solutions Side
Channel Data Leakage
© Blueinfy Solutions Data
Leakage to third party • Applications gather Private information and sends to advertisement servers • Advertisement companies pay per the application (This is how the free apps make money) instance
© Blueinfy Solutions Weak
Server Side Controls
© Blueinfy Solutions Server
Side Issues • Most Application makes server side calls to either web services or some other component. Security of server side component is equally important as client side • Controls to be tested on the server side – Security Control Categories for Server Side Application– Authentication, Access Controls/Authorization, API misuse, Path traversal, Sensitive information leakage,
© Blueinfy Solutions Server
Side Issues Error handling, Session management, Protocol abuse, Input validations, XSS, CSRF, Logic bypass, Insecure crypto, DoS, Malicious Code Injection, SQL injection, XPATH and LDAP injections, OS command injection, Parameter manipulations, BruteForce, Buffer Overflow, HTTP response splitting, HTTP replay, XML injection, Canonicalization, Logging and auditing.
© Blueinfy Solutions Broken
Cryptography
© Blueinfy Solutions Cryptography •
Broken implementation • Hash/Encoding used in place of encryption • Client side script in place of SSL
© Blueinfy Solutions Hooking
debugger in iOS Applications
© Blueinfy Solutions Binary
Auditing • AppStore Binary => .ipa file – It is a ZIP files with executables and resources (images, package info, config files...) • Simulator Binaries are x86 not ARM • Setup environment – Jailbreak first – SSH – Gdb/iphonedbg – otool/classdump
© Blueinfy Solutions Binary
Auditing • Install app on iOS devices – / var/mobile/Applications/<UUID>/<AppName>.ap p/ Or – /User/Applications/<UUID>/<AppName>.app/
© Blueinfy Solutions Binary
Auditing • Look at the directory
© Blueinfy Solutions Binary
Auditing • Look at the directory
© Blueinfy Solutions Binary
Auditing • Look at the directory
© Blueinfy Solutions Binary
Auditing • Decrypt the binary file – Each executable page is encrypted with AES and a MD5 checksum is computed • How to know if a binary is encrypted ? – LC_ENCRYPTION_INFO • cryptid : 1 if the binary is encrypted • cryptoffset : offset of the encrypted data • cryptsize : size of the encrypted data
© Blueinfy Solutions Binary
Auditing • How to get LC_ENCRYPTION_INFO • otool – tool available in cydia otool –l <APPNAME>| grep LC_ENCRYPTION_INFO –B1 –A4 Load command 10 cmd LC_ENCRYPTION_INFO cryptoff 4096 cryptsize 36864 cryptid 0
© Blueinfy Solutions Binary
Auditing • Unpack binary – Use a script that automates the process • Crackulous: tool from Cydia • Just select application, that’s it.
© Blueinfy Solutions Binary
Auditing • Manual method – Launch GDB – Set a breakpoint – Run the application – Extract the unencrypted executable code – Patch the architecture specific binary
© Blueinfy Solutions Binary
Auditing • Look at the binary, open in IDAPro and resolve obj_msgSend calls • Backtrace calls to objc_msgSend – By hand – Using Zynamics IDAPython scripts (objc_helper.py)
© Blueinfy Solutions Interesting
Items to look for • Locate the main class – UIApplicationDelegate – applicationDidFinishLaunching – ApplicationDidFinishLaunchingWithOptions • Views – UI*ViewController – viewDidLoad
© Blueinfy Solutions Using
GDB
© Blueinfy Solutions Interesting
Items to look for • HTTP(S) • NSURL • Sockets – CFSocketCreate • UIPasteBoard • Location based API • KeyChain API • ..
© Blueinfy Solutions Interesting
Items to look for • Some protocol handlers like,
© Blueinfy Solutions Interesting
Items to look for
© Blueinfy Solutions Interesting
Items to look for
© Blueinfy Solutions Automation
in Application Reviews
© Blueinfy Solutions Snoop-it •
The only tool today to automate iOS application reviews • Very handy and gives perfect pointer where to look for • A long way to go for automation like web • Demo – https://code.google.com/p/snoop-it/
© Blueinfy Solutions Conclusion
Advertisement