Pentesting iphone Applications. Satishb3 http://www.securitylearn.net



Similar documents
Pentesting Mobile Applications

Penetration Testing for iphone Applications Part 1

Pentesting iphone & ipad Apps Hack In Paris 2011 June 17

Mobile Applications: The True Potential Risks Where to look for information when performing a Pentest on a Mobile Application

Securing ios Applications. Dr. Bruce Sams, OPTIMAbit GmbH

ABSTRACT' INTRODUCTION' COMMON'SECURITY'MISTAKES'' Reverse Engineering ios Applications

Forensic analysis of iphone backups

Mobile Application Hacking for ios. 3-Day Hands-On Course. Syllabus

Mobile Application Security and Penetration Testing Syllabus

Security Testing Guidelines for mobile Apps

Security Guide. BlackBerry Enterprise Service 12. for ios, Android, and Windows Phone. Version 12.0

SYLLABUS MOBILE APPLICATION SECURITY AND PENETRATION TESTING. MASPT at a glance: v1.0 (28/01/2014) 10 highly practical modules

Enterprise Application Security Workshop Series

ios Testing Tools David Lindner Director of Mobile and IoT Security

Building a Mobile App Security Risk Management Program. Copyright 2012, Security Risk Advisors, Inc. All Rights Reserved

BlackBerry Enterprise Service 10. Secure Work Space for ios and Android Version: Security Note

CompTIA Mobile App Security+ Certification Exam (ios Edition) Live exam IOS-001 Beta Exam IO1-001

Workday Mobile Security FAQ

Security Vulnerabilities in 3rd-Party ios Applications

Mobile Application Hacking for Android and iphone. 4-Day Hands-On Course. Syllabus

Access Your Cisco Smart Storage Remotely Via WebDAV

Administering Jive Mobile Apps

ios Security Decoded Dave Test Classroom and Lab Computing Penn State ITS Feedback -

Please Complete Speaker Feedback Surveys. SecurityTube.net

Salesforce1 Mobile Security Guide

Penetration Testing with Kali Linux

Ensuring the security of your mobile business intelligence

Adobe Flash Player and Adobe AIR security

Attacking and Defending Apple ios Devices in the Enterprise Brandon Knight

APPLICATION SECURITY: FROM WEB TO MOBILE. DIFFERENT VECTORS AND NEW ATTACK

FINAL DoIT v.8 APPLICATION SECURITY PROCEDURE

How to break in. Tecniche avanzate di pen testing in ambito Web Application, Internal Network and Social Engineering

Novell Filr 1.0.x Mobile App Quick Start

BYOD Guidance: BlackBerry Secure Work Space

Attacking and Defending Apple ios Devices in the Enterprise Tom Eston

End User Devices Security Guidance: Apple OS X 10.10

Penetration Testing for iphone / ipad Applications

Product Manual. MDM On Premise Installation Version 8.1. Last Updated: 06/07/15

RSA SecurID Software Token 1.3 for iphone and ipad Administrator s Guide

Advanced ANDROID & ios Hands-on Exploitation

Attack and Penetration Testing 101

ACQUISITION AND ANALYSIS OF IOS DEVICES MATTIA EPIFANI SANS FORENSICS PRAGUE PRAGUE, 10 OCTOBER 2013

Why you need. McAfee. Multi Acess PARTNER SERVICES

SENSE Security overview 2014

ios applications reverse engineering Julien Bachmann

IBM Cognos Mobile Overview

Michael Seltzer COMP 116: Security Final Paper. Client Side Encryption in the Web Browser Mentor: Ming Chow

Sophos Mobile Control Installation guide. Product version: 3.5

ArcGIS Server Security Threats & Best Practices David Cordes Michael Young

Mobile Application Security Testing ASSESSMENT & CODE REVIEW

Smartphone Pentest Framework v0.1. User Guide

Kony Mobile Application Management (MAM)

Deploying iphone and ipad Security Overview

Criteria for web application security check. Version

VMware Horizon Workspace Security Features WHITE PAPER

SYNCSHIELD FEATURES. Preset a certain task to be executed. specific time.

End User Devices Security Guidance: Apple ios 8

3. Broken Account and Session Management. 4. Cross-Site Scripting (XSS) Flaws. Web browsers execute code sent from websites. Account Management

BlackBerry 10.3 Work and Personal Corporate

BlackBerry Enterprise Service 10. Universal Device Service Version: Administration Guide

ios Keychain Weakness FAQ Further Information on ios Password Protection

Mobile Application Security

Total Baby. Backup, Restore and itunes Backup Extraction

Mobile Device Management Version 8. Last updated:

{ipad Security} for K-12. Understanding & Mitigating Risk. plantemoran.com

Introduction to AirWatch and Configurator

Cloud Services MDM. ios User Guide

Novell Filr. Mobile Client

Web Application Report

Securing Secure Browsers

BASELINE SECURITY TEST PLAN FOR EDUCATIONAL WEB AND MOBILE APPLICATIONS

Sophos Mobile Control Installation guide. Product version: 3

Mobile Application Security: Who, How and Why

mobilecho: 5-Step Deployment Plan for Mobile File Management

Casper Suite. Security Overview

Legal notices. Legal notices. For legal notices, see

SonicWALL Mobile Connect. Mobile Connect for OS X 3.0. User Guide

Apple Client Management with JAMF. Andrew D Huston Client Infrastructure Group Informa8on Services Kent State University

Introduction to the EIS Guide

iphone in Business Security Overview

Chapter 1 Web Application (In)security 1

Still Aren't Doing. Frank Kim

Pen Testing ios Apps

Analysis of advanced issues in mobile security in android operating system

Configuration Guide BES12. Version 12.2

Resco Mobile CRM Security

Is Your SSL Website and Mobile App Really Secure?

Out of the Fire - Adding Layers of Protection When Deploying Oracle EBS to the Internet

Secure your ios applications and uncover hidden vulnerabilities by conducting penetration tests

Security for mobile apps

The purpose of this report is to educate our prospective clients about capabilities of Hackers Locked.

Check list for web developers

Sophos Mobile Control Installation guide. Product version: 3.6

Mobile Apps - Hands On

Transcription:

Pentesting iphone Applications Satishb3 http://www.securitylearn.net

Agenda iphone App Basics App development App distribution Pentesting iphone Apps Methodology Areas of focus Major Mobile Threats

Who am I < 1 Development Framework for functional testing tools 5+ Information Security Web application hacking, Network assessments, Reverse engineering, Mobile application hacking Other Activities OWASP Hyderabad Contributor Blogging www.securitylearn.net 3

iphone App Basics iphone released in 2007 110 million sales till March 2011 Browser based Applications HTML + CSS + JavaScript Native ios Applications Objective C & Cocoa Touch API Super set of C, Compiles into native code (ARM) App Store Centralized mechanism to distribute software Only Apple signed application are available Designed to protect the Apps from piracy & No malware

Why to build iphone Application? New business Good way to launch new services Urgency for clients Users want them Quick to develop Fame and Fortune Angry Birds cost $140k to develop and made $70 million in profits Source: mildtech.net

iphone Application Distribution Distributed as.ipa files ios Simulator Device testing Ad-Hoc Distribution In-House Distribution Over The Air Distribution App Store Distribution Apps have to obey Apple Review guidelines

Pentesting of iphone Applications Areas of focus include Network communication Privacy Issues Application Data Storage Reverse Engineering URL Schemes Push Notifications Overlap between iphone security and iphone App security

JailBreaking iphone does not allow unsigned applications Jailbreak gives a full access to the device Allows to install Apps which are not authorized (via Cydia) Can put your phone at increased risk to some security vulnerabilities Tools: PwnageTool, redsn0w, Sn0wbreeze, Greenpois0n, jailbreakme JailBreaking makes our work easy

Useful Cydia Apps Openssh : SSH to phone Adv-cmds : process commands like ps, kill Sqlite3 : Sqlite database client GNU Debugger: Reverse engineering Syslogd : To view iphone logs Tcpdump: capture traffic on phone com.ericasadun.utlities: plutil (view plist files) Darwin tools: Strings command Odcctools: otool, nm

SSH to iphone Install Open SSH from Cydia On workstation install SSH Client iphone has two users by default Root and mobile (password is alpine ) Connect to the phone as a root user via SSH SSH over WIFI > ssh root@iphoneip > password: alpine SSH over USB >./itunnel_mux --lport 1234 > ssh p 1234 root@127.0.0.1 > password: alpine SSH Clients Type Windows OS X Console Putty SSH client GUI WinSCP Cyberduck

Network Communication Mobile application pentesting isn t really all that different It involves network communication Communication mechanism Clear text transmission (http) Encrypted transmission (https) Use of Custom or Proprietary protocols

Clear text Transmission It s 2011. Still Apps run on http More possible MITM attacks because of WIFI Firesheep To analyze HTTP traffic Enable manual proxy in iphone (settings - > WIFI - > manual)

SSL Communication HTTPS is required for sensitive data transmission In SSL communication, Apps may fail to validate SSL cert allowsanyhttpscertificateforhost Apps which are validating the cert will not allow MITM similar to modern browsers like Google chrome, IE 8 To capture the traffic, load your proxy (burp) CA Cert to iphone Same applicable to other protocols which works on Cert

Custom Protocols Identify the communication protocol On SSH Terminal: > tcpdump -w traffic.pcap Load the.pcap in wireshark and analyze May not respect iphone proxy settings DNS Spoofing techniques to MITM Once you capture the traffic it is a typical web application pentesting in which attacks are done on the application server -Authentication, Authorization, Session management, weak ciphers.

Privacy Issues Every iphone has an unique device identifier called UDID Apps may collect the device UDID With UDID Possible to observe the user browsing patterns Feasible to locate user Geo location More possible attacks are documented in Eric Smith: iphone- Applications-Privacy-Issues.pdf One such application is Openfient : mobile social gaming network http://corte.si/posts/security/openfeint-udid-deanonymization/ Observe the network traffic to find out UDID transmission

Application Data Storage 76 percent of mobile Apps store user data on phone 10 percent Apps store passwords in clear text Source: viaforensics.com/appwatchdog Apps store information on phone For better performance Offline access Data storage locations Plist files Keychain Logs Screenshots Home directory

Application Directory Structure Application run in a sandbox (seatbelt) with mobile privileges Each application gets a private area of the file system App Home directory: /var/mobile/applications/[guid] SubDirectory Description Appname.app Contains the application code and static data Documents Library Library/Preferences/ Library/Caches/ tmp Data that may be shared with desktop through itunes Application support files App specific preferences Data that should persist across successive launches of the application but not needed to be backed up Temporary files that do not need to persist across successive launches of the application

Plist files Property list files often used to store user s properties of an App /var/mobile/applications/[appid]/documents/preferences Key value pairs are stored in binary format Easily extracted and modified with property list editor, plutil Look for usernames, passwords, cookies Apps may take Authentication/Authorization decisions Ex: admin=1, timeout=10 Do not store clear text data in plist files

Keychain SQLite database for sensitive data storage Four tables: genp, inet, cert, keys Located at: /var/keychains/keychain-2.db Keychain data is encrypted Uses hardware encryption key Uses user passcode for encryption Depends on accessibility constant of keychain entry Can not be moved to other device Idea is, developers can leverage keychains to have the OS to store information securely Not any more

Keychain Accessible to all the applications Application can only access it s key chain items On a JailBroken device It can be bypassed Keychain Dumper Tool by github Displays keychain entries of all the installed applications Use data protection API while storing data in keychain Use ksecattraccessiblewhenunlocked accessibility constant If phone is lost & user sets a passcode, it is difficult to retrieve protected contents in keychain Keychain data is encrypted with User Passcode

Error Logs Apps may write sensitive data in logs Debugging (NSLog calls) Trouble shooting Requests & Responses /private/var/log/syslog To view iphone logs Console App (from AppStore) Sync to itunes Mac OS X : ~/Library/Logs/CrashReporter/MobileDevice/<DEVICE_NAME> Windows XP: C:\Documents and Settings\<USERNAME>\Application Data\Apple computer\logs\crashreporter/<device_name>

Screenshot Home button shrinks your application with a nice effect ios takes screen shots of the application to create that effect Sensitive data may get cached App directory/library/caches/snapshots Solution 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 altogether by setting the "Application does not run in background" property in the application's Info.plist file

Screenshot Copied From SANS website

Home directory Apps can store data in application home directory Custom encryption mechanism can be used to store files Use Reverse engineering techniques to find encryption key Write tools to break the custom encryption

Reverse Engineering Apps downloaded from AppStore are encrypted Fairplay DRM (AES) On a JailBroken device, we can decrypt Apps easily Craculous : decrypts Apps on device Installous : installs decrypted Apps on device Self distributed Apps are not encrypted Hex Rays decompiler & Run time debugger (gdb) Look for Hard coded passwords and encryption keys Buffer Overflows ios 4.3 introduced ASLR support Apps must be compiled with PIE (position independent executable) for full support

URL Scheme Protocol Handlers - mailto:, tel: Browser to App interaction View Info.plist for supported schemes > plutil Facebook.app/Info.plist CFBundleURLName = "com.facebook"; CFBundleURLSchemes = ( fbauth, fb ); Parameters are supplied to the application Mailto:securitylearn.wordpress@gmail.com twitter://post?message=visit%20maniacdev.com Bad Input crash Apps

URL Scheme Decrypt the App to find parameters > strings Facebook.app/Facebook grep 'fb:' fb://online#offline fb://birthdays/(initwithmonth:)/(year:) fb://userset fb://nearby fb://place/(initwithpageid:) http://wiki.akosma.com/iphone_url_schemes Remote attacks URL Scheme allows to edit or delete data without user permission Ex: Skype URL Handler Dial Arbitrary Number <iframe src="skype://14085555555?call"></iframe>

Push Notifications App vendors use this service to push notifications to the user's device even when the app is in a frozen state Instant Messenger alerts the user when a new message is received even though the user is using another app Device token unique to ios instance is required Push notification data can be read by Apple Do not send Confidential data in notifications Do not allow push notifications to modify App data

Major mobile Threats Easy to lose phones Device is protected with passcode Sensitive files on the device are encrypted What s the threat? Data encryption in mobile is only available after boot up Boot Rom exploits all files on the device can be copied with in 10 minutes Passcode brute force 4 digit passcode can be brute forced with in 20 minutes Mobile App Risks Veracode Top 10 OWASP Top 10

References BlackHat 2011 - DaiZovi_iOS_Security Fraunhofer ios Device encryption security GitHub Keychain Dumper

Thank You Email : Satishb3@securitylearn.net Blog: http://www.securitylearn.net