iOS 10 使用 dumpdecrypted 砸壳

《ios应用逆向工程:分析与实战》这本书中讲到的砸壳方法适用于32位较老设备,本文介绍在 iOS10.0.1 iPad Air 64位设备上使用 dumpdecrypted为 AppStore 上的 App 砸壳!
  • 从 github 上下载 dumpdecrypted源码
  • 编译 dumpdecrypted.dylib: 进入 dumpdecrypted 目录运行 make命令,成功后会生成一个 dumpdecrypted.dylib 文件。
  • 将 dumpdecrypted.dylib 文件拷贝到需要砸壳应用的沙盒Document目录:使用 iFunBox 选中你要的应用程序红框部分为对应沙盒目录,直接将dumpdecrypted.dylib 拖到该目录。


    iOS 10 使用 dumpdecrypted 砸壳_第1张图片
    image.png

    由于 AppStore App 对沙盒以外的绝大多数目录没有写权限,所以我们需要
    将 dumpdecrypted.dylib 拷贝到沙盒目录下,缺少本步骤会报以下错误:

dyld: could not load inserted library 'dumpdecrypted.dylib' because no suitable image found.  Did find:
            dumpdecrypted.dylib: stat() failed with errno=1
Trace/BPT trap: 5
  • ssh 到 iOS 设备
    使用 pp 助手工具设备工具打开 ssh 通道
    打开命令行输入下图提示的语句ssh root@localhost -p 2222来登录,默认密码为alpine。
DaFenQI@MrZz:~/Desktop/dumpdecrypted% ssh root@localhost -p 2222
root@localhost's password: 
DaFenQiiPad:~ root# 

登录成功后使用 ps-e 命令查看设备中运行的进程,找到 App 可执行文件的路径,类似 /var/mobile/Containers/Bundle/Application/XXXXXXXX- XXXX-XXXX-XXXX- XXXXXXXXXXXX/TargetApp.app/。


iOS 10 使用 dumpdecrypted 砸壳_第2张图片
image.png
  • 使用以下命令砸壳:
DYLD_INSERT_LIBRARIES=/path/to/dumpdecrypted.dylib /path/to/executable
  • 在本运行环境下会报以下错误信息:
dyld: could not load inserted library 'dumpdecrypted.dylib' because no suitable image found.  Did find:
    dumpdecrypted.dylib: required code signature missing for 'dumpdecrypted.dylib'
Abort trap: 6
  • 解决思路:
    直接 google 报错信息
    google iOS10 dumpdecrypted
    在搜索到的内容中筛选信息得出猜测
    应该是dumpdecrypted.dylib未签名
    解决方案使用 ldid 工具的 ldid -S dumpdecrypted.dylib 命令给 dumpdecrypted.dylib 签名
DaFenQiiPad:/root# ldid -S private/var/mobile/Containers/Data/Application/FC66F79B-E67C-4746-845E-AB20778AA036/Documents/dumpdecrypted.dylib
  • 运行砸壳命令,以下信息提示砸壳成功,生成 .decrypted 在
    dumpdecrypted.dylib 所在目录下!
DISCLAIMER: This tool is only meant for security research purposes, not for application crackers.

[+] detected 64bit ARM binary in memory.
[+] offset to cryptid found: @0x1000ccc58(from 0x1000cc000) = c58
[+] Found encrypted data at address 00004000 of length 15843328 bytes - type 1.
[+] Opening /private/var/containers/Bundle/Application/B9DBC5DA-4F84-46E6-8C8D-3BA68CD32AB9/EE_VKO.app/EE_VKO for reading.
[+] Reading header
[+] Detecting header type
[+] Executable is a plain MACH-O image
[+] Opening EE_VKO.decrypted for writing.
[+] Copying the not encrypted start of the file
[+] Dumping the decrypted data into the file
[+] Copying the not encrypted remainder of the file
[+] Setting the LC_ENCRYPTION_INFO->cryptid to 0 at offset c58
[+] Closing original file
[+] Closing dump file

参考资料:《ios应用逆向工程:分析与实战》

你可能感兴趣的:(iOS 10 使用 dumpdecrypted 砸壳)