[Turn]ios tutorial–dumping the application Heap from Memory

Source: Internet
Author: User

? source:https://blog.netspi.com/ios-tutorial-dumping-the-application-heap-from-memory/

An essential part of pentesting IOS applications is analyzing the runtime of the application. In this blog, I'll be covering what to dump the heap from an IOS application. I'll also be releasing a little script to run on the IOS device to dump the heap of a specified application for you.

Can download the script from the? NetSPI Git Hub. The script basically wraps around GDB, but only dumps the ranges in memory that has "sub-regions". These sub-regions is usually where I find active credentials, anything that's currently being used in the UI, or instant Iated class properties. This technique currently only works for iOS 7 and lower or until there are a working GDB version for iOS 8. You also cannot use the version of GDB from the default Cydia repositories. You have the. Repository here: "Http://cydia.radare.org" or here's a direct link to the Deb P Ackage: "Http://cydia.radare.org/debs/gdb_1708_iphoneos-arm.deb". Below is a few screenshots of the process, and how the script works.

First, we launch the application, we want to capture the heap for and log in.

After we log into the app, we'll keep it at the first main screen which in the the the user ' s timeline.

Now we'll SSH into the device, so we can leave the application running without the app being put in the background by IOS.

Above is the output, the script provides during runtime. Here is giving the binary name that we want the script to dump.

above is all the. dmp files, the We can now start searching through for the credentials or any other sensitive data. You can usually find encryption keys or passwords from any instantiated classes this use encryption or contain the login P Rocess. I personally use a combination of the "strings" Command and "Xxd" as a hex dumper if you can use any hex editor this work s for you.

this technique can be used to determine if the application are not removing sensitive information from memory once the INS tantiated classes is done with the data. All applications should deallocate spaces in memory this deal with classes and methods, were used to handle sensitive Information, otherwise you run the risk of the information sitting available in memory for a attacker to see.

i ' ve included the GDB commands that is used in the script:

    • info mach-regions (look for sub-regions)
    • dump binary Memory heap1.dmp <sub-region range from Above>

Tags:? Gdb? Heap,?ios, huh? Memory

?

?

[Turn]ios tutorial–dumping the application Heap from Memory

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.