Dumpsdecrypted

Dumps decrypted mach-o files from encrypted iPhone applications from memory to disk. This tool is necessary for security researchers to be able to look under the hood of encryption.git

源代碼只有一個文件 dumpdecrypted.c,文件只有一個函數 dumptofile,程序沒有解密邏輯,當它執行時候,加載器已經完成了目標 mach-o 文件的裝載,對應的解密已經完成。該函數的工做是從 LC_ENCRYPTION_INFO 遍歷全部的 load command,將對應的解密數據從內存中 dump 出來,複寫到 mach-o 文件中。github

步驟

  • 安裝 OpenSSH, Cycript
  • 下載 dumpdecrypted 源代碼
  • 在源代碼目錄下執行 make 指令,生成一個 dumpdecrypted.dylib
  • ssh root@ip_address,默認密碼是 alpine
  • ps -e,找到應用的進程號,以及進程路徑
  • cycript -p 進程號,輸入下面代碼
  • [[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask][0]
  • 從上個指令獲取 app document 目錄路徑
  • ctrl + d,退出 cycript 操做
  • 將 dumpdecrypted.dylib 文件拷貝到 app document 目錄下, scp src_path root@ip_address:des_path
  • DYLD_INSERT_LIBRARIES=xxx.dylib_path app進程路徑,開始砸殼,完成後會獲得一個 .decrypted文件
  • 使用 scp 命令將砸殼後的文件複製到電腦上, scp root@ip_address:src_path des_path
  • 使用 class-dump 獲取頭文件,class-dump -H WeChat.decrypted -o des_path


遇到錯誤

dyld: could not load inserted library 'dumpdecrypted.dylib' because no suitable image found. Did find:
dumpdecrypted.dylib: required code signature missing for 'dumpdecrypted.dylib'app

解決方案:

## 列出可簽名證書
security find-identity -v -p codesigning
## 爲dumpecrypted.dylib簽名
codesign --force --verify --verbose --sign "iPhone Developer: xxx xxxx (xxxxxxxxxx)" dumpdecrypted.dylib

涉及軟件

iOS - 10.3.3
OpenSSH - 6.7p1-13
Script - 0.9.595
Fileza File Manager - 3.5.2-1
測試應用:WeChat, AlipayWalletssh

2018-5-25-23ide

相關文章
相關標籤/搜索
本站公眾號
   歡迎關注本站公眾號,獲取更多信息