IOS Application Security Part 4 - Runtime Analysis Using Cycript (Yahoo Weather App)
IOS Application Security Part 4 - Runtime Analysis Using Cycript (Yahoo Weather App)
iOSApplicationSecurityPart4RuntimeAnalysisUsingCycript(YahooWeatherApp)InfoSecResources
INFOSEC INSTITUTE
TOPICS
INTENSE SCHOOL
CONTRIBUTORS
JOB BOARD
CAREERS
CERTIFICATION TRACKER
CONTENT ARCHIVES
PHISH.IO
iOS Application
Security Part 4
Runtime Analysis Using
Cycript (Yahoo Weather
App)
JUMP TO
14
Tweet
Share
submit
12
Like
Introduction
In the previous article, we learnt about
the runtime capabilities of an IOS App
written in Objective-C which uses the
Cocoa framework. In this article, we will
look at how we can use a very essential
tool named Cycript to analyze and
modify the runtime of an IOS
application. In this article, we will be
performing our analysis on the Yahoo
Weather IOS app.
http://resources.infosecinstitute.com/iosapplicationsecuritypart4runtimeanalysisusingcycriptyahooweatherapp/
1/14
9/28/2015
iOSApplicationSecurityPart4RuntimeAnalysisUsingCycript(YahooWeatherApp)InfoSecResources
Cycript
Cycript is a javascript interpreter which
also understands Objective-C syntax,
meaning we can write either Objective-C
or javascript or even both in a particular
command. It can also hook into a
running process and help us to modify a
lot of the things in the application during
runtime. As far as its application to IOS
application is concerned, here are some
of the advantages of using Cycript.
1. We can hook into a running
process and find the names of all
classes being used, i.e the view
controllers, the internal and third
party libraries being used and even
the name of the Application
delegate.
2. For a particular class, i.e View
Controller, App delegate or any
other class, we can also find the
names of all the methods being
used.
3. We can also find the names of all
the instance variable and their
values at any particular time
during the runtime of an
application.
4. We can modify the values of the
instance variable during runtime.
5. We can perform Method Swizzling,
i.e replace the code of a particular
method with some other
implementation.
6. We can call any method in the
application during runtime
without it being in the actual code
of the application .
http://resources.infosecinstitute.com/iosapplicationsecuritypart4runtimeanalysisusingcycriptyahooweatherapp/
2/14
9/28/2015
iOSApplicationSecurityPart4RuntimeAnalysisUsingCycript(YahooWeatherApp)InfoSecResources
Installing Cycript
To install Cycript on your device, you
must download the latest version from
their official download page. Make sure
to download the latest version.
3/14
9/28/2015
iOSApplicationSecurityPart4RuntimeAnalysisUsingCycript(YahooWeatherApp)InfoSecResources
sharedApplication].
http://resources.infosecinstitute.com/iosapplicationsecuritypart4runtimeanalysisusingcycriptyahooweatherapp/
4/14
9/28/2015
iOSApplicationSecurityPart4RuntimeAnalysisUsingCycript(YahooWeatherApp)InfoSecResources
[UIApplication
sharedApplication].delegate. But since
we already defined a variable a as the
application instance, we can use the
following command as shown in the
figure below.
http://resources.infosecinstitute.com/iosapplicationsecuritypart4runtimeanalysisusingcycriptyahooweatherapp/
5/14
9/28/2015
iOSApplicationSecurityPart4RuntimeAnalysisUsingCycript(YahooWeatherApp)InfoSecResources
http://resources.infosecinstitute.com/iosapplicationsecuritypart4runtimeanalysisusingcycriptyahooweatherapp/
6/14
9/28/2015
iOSApplicationSecurityPart4RuntimeAnalysisUsingCycript(YahooWeatherApp)InfoSecResources
7/14
9/28/2015
iOSApplicationSecurityPart4RuntimeAnalysisUsingCycript(YahooWeatherApp)InfoSecResources
Perfect !!
Lets now investigate more and see what
more we can find out about the app. In
order to find out the current view
controller of the app, we must first find
out the keyWindow property. A
keyWindow is the window which is
currently accepting user interaction
(touch events) from the user. If you want
to find out all the windows in an app,
here is how you do it. Note that a
window is of the class type UIWindow.
http://resources.infosecinstitute.com/iosapplicationsecuritypart4runtimeanalysisusingcycriptyahooweatherapp/
8/14
9/28/2015
iOSApplicationSecurityPart4RuntimeAnalysisUsingCycript(YahooWeatherApp)InfoSecResources
http://resources.infosecinstitute.com/iosapplicationsecuritypart4runtimeanalysisusingcycriptyahooweatherapp/
9/14
9/28/2015
iOSApplicationSecurityPart4RuntimeAnalysisUsingCycript(YahooWeatherApp)InfoSecResources
10/14
9/28/2015
iOSApplicationSecurityPart4RuntimeAnalysisUsingCycript(YahooWeatherApp)InfoSecResources
PREV: IOS A
NEXT: IOS A
Prateek
Gianchandani
http://resources.infosecinstitute.com/iosapplicationsecuritypart4runtimeanalysisusingcycriptyahooweatherapp/
11/14