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

June 22, 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. - Walkthrough of an exploit.
  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. Network Security - Configure your device’s proxy settings. - Install

    the self-signed SSL certificate. - Boom. Intercept any HTTPS call made from the device.
  5. Network Security - Configure your device’s proxy settings. - Install

    the self-signed SSL certificate. - Boom. Intercept any HTTPS call made from the device.
  6. 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.
  7. 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
  8. Cycript ~ root# cycript -p Instagram cy# UIApp.delegate.window.rootViewController #"<IGRootViewController: 0x155cead0>"

    cy# UIApp.delegate.window.rootViewController.view.subviews[0] @[#"<UIImageView: 0x157b2850;, #"<UIButton: 0x165c8f90; frame = (12 512; 296 44);] cy# var logInButton = new Instance(0x165c8f90); cy# welcomeLabel.text = "Hello Mobile Mondays!"
  9. Cycript ~ root# cycript -p VulnerableApp cy# User.messages[‘isAdmin’] = function()

    { return True; } function() { return True;} cy# [APIManager privateKey]; “2EqecahatHaMUphetRUvaTrus-YesPeopleActuallyDoThis”
  10. 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.
  11. What we’ll do - Steal a Parse app’s API key/secret

    credentials. - Access restricted user posts.
  12. Anywall - An official Parse demo app. - Allows you

    to see messages posted by users within 4000 ft.
  13. Loading all posts ~ root# cycript -p Anywall cy# var

    query = [PFQuery queryWithClassName:@"Posts"]; #"<PFQuery: 0x156e43b0>" cy# var objects = [query findObjects]; cy# [objects[0] objectForKey:@"location"][@"latitude"] 22.36REDACTED cy# [objects[0] objectForKey:@"location"][@"longitude"] 114.10REDACTED
  14. 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.