Pen Testing Iphone Ipad iOS Applications
Pen Testing Iphone Ipad iOS Applications
Flora Bottaccio
Security Analyst at ADVTOOLS
Sebastien Andrivet
Director, co-founder of ADVTOOLS
ADVTOOLS
Swiss company founded in 2002 in Geneva Specialized in Information Security & Problems Diagnosis
Pentesting Security Audits Forensics Secure Development
Agenda
Overviews Previous researches iPhone/iPad application pentest
Our methodology
Native Applications:
Written in Objective-C (+ C/C++) Compiled into CPU code: ARM for actual devices, x86 for iOS Simulator
iOS Applications
Distributed as .ipa files
in fact simply zip files
Objective-C
Objective-C = C + Smalltalk Object oriented language Created in early 1980s by Stepstone Objective-C 2.0 released with Leopard (Mac OS X 10.5) Can be mixed with C and C++
Reverse Engineering
Not so obvious at first:
ARM instruction set Objective-C & objc_msgSend Generated code sometimes strange Few (working) scripts and tools
Data storage
plist files (Property lists)
Used and abused Binary (depreciated) or XML
Sqlite 3
From time to time
Previous researches
In general, out of date Often inaccurate But contain interesting information We will give here only some examples
Nicolas Seriot
Not exactly on the same subject (about privacy) Excellent source of info However, a little out of date (everything is quickly out of date with Apple devices)
ARTeam
About cracking, not pentesting Brilliant But very old now (2008 & 2009)
Previous Researches
Some interesting documents available Nothing specifically about pentesting iOS application and that is realistic and useable This is one of the reasons we make this presentation today
Step 1: Device
Dedicated iPhone or iPad Jailbreak
Avoid iPad 2 for the moment
Install tools
Tools
Cydia APT 0.7 Strict adv-cmds Darwin CC Tools GNU Debugger inetutils lsof MobileTerminal netcat network-cmds nmap OpenSSH tcpdump top wget Crackulous
Default Passwords
By default, there are two users:
root mobile
Step 2 : Workstation
Windows:
OK
Linux, FreeBSD,
Good luck! Possible but you will need a Windows to run some tools (virtual machine)
Some Tools
Windows:
SecureCRT or Putty, WinSCP plist Editor for Windows
Mac OS X:
ssh, SecureCRT, Cyberduck XCode
Windows / Mac:
SQLite Database Browser Apple iPhone Configuration Utility Wireshark Burp / Webscarab / IDA Pro (+ ARM decompiler)
Our Tools
ADVsock2pipe
Remote network captures (Windows)
ADVinterceptor 2.0
Communications interception DNS & Web Servers
Step 3: Network
Wifi
Internet
Firewall
LAN
Step 4: Pentesting
Step A: Install app. from iTunes Step B: Reconnaissance (passive)
B.1: Network capture B.2: Interception B.3: Artifacts B.4: Decrypt + Reverse engineering
tcpdump + netcat
Proxy
etc.
Demos
3G+Wifi
Wifi 2G/3G
Internet
Wifi
VNC Client
Shell
Demos
Goal is to illustrate the previous points, not to make a complete pentest This is also to show the catastrophic level of security of some iOS apps
Demo # 1
An application that stores securely password Data are encrypted except the password
Demo # 2
Network capture with
tcpdump netcap ADVsock2pipe Wireshark
Demo # 3
French application (passengers) Interception with proxy method & Burp Password in clear inside the SSL tunnel: not really a problem Password also in clear in a file (Property List): not good
Demo # 4
French retailer Interception with
ADVinterceptor + Burp
Thank you
To contact us:
www.advtools.com