3.应用解密/砸壳

3.应用解密/砸壳

应用上传至App Store后,苹果会对应用进行加密,当应用运行时才会动态解密。 这样我们是无法直接对从App Store上下载的应用进行分析的。所以在分析应用之前,要先进行解密,俗称——砸壳。然后才能把应用和解密后的可执行文件导出到计算机中

1. dumpdecrypted

失败 未成功

2.Clutch

2.1 下载并编译

从仓库中拉取项目github.com/KJCracks/Cl… 到本地

用xcode打开项目。使用Debug编译所有架构(Build Active Architecture Only - No),运行目标选择真机,然后点击编译。

编译后会生成一个可以运行在移动设备上的命令行工具,内部脚本会把它的可执行文件复制出来,单独签名后放到build文件夹下。

然后使用scpClutch文件复制到移动设备的/usr/bin目录下。

scp /Users/zsq/Downloads/Clutch-master/build/Clutch  [email protected]:/usr/bin/
复制代码

然后远程链接到移动设备,赋予Clutch可执行权限。

chmod +x /usr/bin/Clutch
复制代码

2.2 使用

命令参考

Clutch [OPTIONS]
-b --binary-dump     Only dump binary files from specified bundleID
-d --dump            Dump specified bundleID into .ipa file
-i --print-installed Print installed application
--clean              Clean /var/tmp/clutch directory
--version            Display version and exit
-? --help            Display this help and exit
复制代码

查看安装的的应用和BundleId

Clutch -i
复制代码

解密目标应用

Clutch -b target.bundle.id
复制代码
2022-03-11 11:45:00.325 Clutch[3690:399947] command: Only dump binary files from specified bundleID
Zipping xxx.app
Dumping <xxx> (arm64)
Patched cryptid (64bit segment)
Writing new checksum
2022-03-11 11:45:00.660 clutch[3692:399967] command: Only dump binary files from specified bundleID
2022-03-11 11:45:00.661 clutch[3693:399969] command: Only dump binary files from specified bundleID
2022-03-11 11:45:00.661 clutch[3695:399973] command: Only dump binary files from specified bundleID
2022-03-11 11:45:00.662 clutch[3696:399975] command: Only dump binary files from specified bundleID
2022-03-11 11:45:00.664 clutch[3698:399979] command: Only dump binary files from specified bundleID
2022-03-11 11:45:00.665 clutch[3694:399971] command: Only dump binary files from specified bundleID
2022-03-11 11:45:00.668 clutch[3697:399977] command: Only dump binary files from specified bundleID
Dumping <SwiftSocket> arm64
Successfully dumped framework SwiftSocket!
Dumping <Antlr4> arm64
2022-03-11 11:45:00.699 clutch[3699:399981] command: Only dump binary files from specified bundleID
Dumping <PDFReader> arm64
Dumping <SecurityDetector> arm64
Successfully dumped framework PDFReader!
Successfully dumped framework SecurityDetector!
Dumping <Charts> arm64
Dumping <DTIActivityIndicator> arm64
Successfully dumped framework DTIActivityIndicator!
Successfully dumped framework Antlr4!
Dumping <FilesProvider> arm64
Dumping <UXMPDFKit> arm64
Successfully dumped framework Charts!
Successfully dumped framework UXMPDFKit!
Successfully dumped framework FilesProvider!
Zipping FilesProvider.framework
Zipping SwiftSocket.framework
Zipping UXMPDFKit.framework
Zipping Charts.framework
Zipping SecurityDetector.framework
Zipping PDFReader.framework
Zipping DTIActivityIndicator.framework
Zipping Antlr4.framework
DONE: /private/var/mobile/Documents/Dumped/xxx.ipa
Finished dumping com.neo.elf in 1.8 seconds
复制代码

解密成功之后,会打印出解密后的ipa文件路径。可以将其导出到Mac中,进行后续的分析了。

3. frida-ios-dump

frida-ios-dump是国内大神写的砸壳工具,推荐使用。 地址:github.com/AloneMonkey…

3.1 安装frida

frida-ios-dump的使用需要借助fridafrida官网 frida 需要python3的支持。系统默认安装了python2.7,我们不去管它。下面借助homebrew安装python3.

安装python3

brew搜索python

brew search python
复制代码

然后选择安装的版本

brew install [email protected]
复制代码

python3表示我们使用的python3.x的版本,python表示使用系统默认的python2.7版本。这一点需要注意

安装pip3

frida最方便的安装方式是借助pippip 是 Python 包管理工具,该工具提供了对Python 包的查找、下载、安装、卸载的功能。 可以使用如下命令判断是否已安装:

pip --version     # Python2.x 版本命令
pip3 --version    # Python3.x 版本命令
复制代码

如果还未安装,则可以使用以下命令来安装:

$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py   # 下载安装脚本
$ sudo python3 get-pip.py    # 运行安装脚本
复制代码

注意: 这里使用python3来安装,以后使用时也是使用pip3

安装frida

下面正式安装frida

sudo pip3 install frida
sudo pip3 install frida-tools
复制代码

手机安装frida

Cydia中添加源 https://build.frida.re/。 然后搜索frida 并安装。

SSH连接手机

在mac的终端执行:

frida-ps -U
复制代码

会列举出手机系统当前正在执行的进程。 到此,frida的安装工作就完成。下面进入frida-ios-dump的安装。

3.2 frida-ios-dump安装

frida-ios-dump下载到本地,然后进入执行如下命令,安装需要的依赖包。

sudo pip install -r requirements.txt --upgrade
复制代码

执行

3.3 frida-ios-dump砸壳

选择前面执行frida-ps -U指令后列举出的应用,进行砸壳。 在frida-ios-dump文件夹下执行:

python3 ./dump.py 应用名或bundleid
复制代码

砸壳后的应用就直接拷贝到frida-ios-dump的文件夹下了。非常的方便

猜你喜欢

转载自juejin.im/post/7078597944512872455
今日推荐