Upgrade to Pro — share decks privately, control downloads, hide ads and more …

iOS App Security

iOS App Security

A brief introduction to hacking iOS applications. This covers:

- Network security.
- Static analysis.
- Runtime analysis and manipulation.
- Decompilation and reverse-engineering.

To get a better understanding of the topic, check out DVIA:
http://damnvulnerableiosapp.com/#learn

Kiran Panesar

April 29, 2015
Tweet

More Decks by Kiran Panesar

Other Decks in Technology

Transcript

  1. What we’ll cover - Network security. - Static analysis. -

    Runtime analysis & manipulation. - Decompilation and reverse engineering. - A fun demo.
  2. Network Security - No API is safe! - Intercept network

    traffic. - Self-sign SSL certificates - Replay attacks, request forgery, etc.
  3. Network Security - No API is safe! - Intercept network

    traffic. - Self-sign SSL certificates - Replay attacks, request forgery, etc.
  4. iNalyzer - The ultimate static analysis tool for iOS apps.

    - Dumps headers. - Creates a full set of documentation for an app. - Full class hierarchy, interaction diagrams, string analysis. - Uses Doxygen. - By default it’ll only work with system apps. - Use clutch to decrypt any app.
  5. iNalyzer ~ root# clutch Anywall ~ root# mv Anywall.ipa Anywall.zip

    ~ root# unzip Anywall.zip ~ root# iNalyzer5 --direct Anywall.app/ iNalyzer [1/9] Dumping Headers:Done ... iNalyzer [9/9] Patching Headers:Done iNalyzer done, file saved at:/var/root/Documents/ iNalyzer/Anywall-direct.ipa
  6. Cycript ~ root# cycript -p Instagram cy# UIApp.delegate.window.rootViewController #"<IGRootViewController: 0x155cead0>"

    cy# UIApp.delegate.window.rootViewController.view.subviews[0] @[#"<UIImageView: 0x157b2850;, #"<UILabel: 0x157b2f40; text = 'Log in to...';] cy# var welcomeLabel = new Instance(0x157b2f40); cy# welcomeLabel.text = "Hello code & cans!"
  7. Cycript ~ root# cycript -p VulnerableApp cy# User.messages[‘isAdmin’] = function()

    { return True; } function() { return True;} cy# [APIManager privateKey]; “2EqecahatHaMUphetRUvaTrus”
  8. Introspy - A method tracing tool. - Allows us to

    set up tracers on anything we want. - Hooks into methods, prints out values, and continues. - Doesn’t disturb the execution of the program, it just quietly scrapes all the data.
  9. What we’ll do - Steal a Parse app’s API key/secret

    credentials. - Access restricted data. - Make the app crash for every single user (not really).
  10. Defence - Use PT_DENY_ATTACH to disable debugging tracing. - Obfuscation.

    - Secure programming. - Distractions and false flags. - Disable the app if jailbroken or cracked. - Exit the app if suspicious activity is detected.