前言砸壳网站 https://decrypt.day/ 广告太多,而且砸完的 APP 经常不能用。本文介绍如何使用flexdecrypt工具对iOS应用进行砸壳(解密),获取可用于逆向分析的IPA文件。
注意Clutch 已经不能用了,现在一般使用 flexdecrypt 来砸壳。
开始工具下载1. FlexdecryptGitHub仓库: https://github.com/JohnCoates/flexdecrypt直接下载:
# 下载预编译版本
wget https://github.com/JohnCoates/flexdecrypt/releases/download/1.1/flexdecrypt.deb
# 或下载二进制文件
wget https://github.com/JohnCoates/flexdecrypt/releases/download/1.1/flexdecrypt2. Flexdump辅助脚本Gist地址: https://gist.github.com/defparam/71d67ee738341559c35c684d659d40ac下载命令:
curl -o flexdump https://gist.githubusercontent.com/defparam/71d67ee738341559c35c684d659d40ac/raw/flexdump3. 其他可选工具frida-ios-dump: https://github.com/AloneMonkey/frida-ios-dumpCrackerXI+: Cydia/Sileo商店安装安装步骤方法一:使用自动化脚本创建flexdecrypt_install.sh脚本:
#!/bin/bash
# 配置
IPHONE_IP="192.168.50.57" # 修改为你的iPhone IP
IPHONE_USER="root"
IPHONE_PASS="alpine" # 修改为你的root密码
# 下载flexdecrypt
if [ ! -f flexdecrypt ]; then
echo "Downloading flexdecrypt..."
curl -L -o flexdecrypt https://github.com/JohnCoates/flexdecrypt/releases/download/1.1/flexdecrypt
fi
# 下载flexdump
if [ ! -f flexdump ]; then
echo "Downloading flexdump..."
curl -o flexdump https://gist.githubusercontent.com/defparam/71d67ee738341559c35c684d659d40ac/raw/flexdump
fi
# 传输到iPhone
echo "Transferring files to iPhone..."
sshpass -p "$IPHONE_PASS" scp flexdecrypt root@$IPHONE_IP:/var/jb/usr/bin/
sshpass -p "$IPHONE_PASS" scp flexdump root@$IPHONE_IP:/var/jb/usr/bin/
# 设置权限
echo "Setting permissions..."
sshpass -p "$IPHONE_PASS" ssh root@$IPHONE_IP "chmod +x /var/jb/usr/bin/flexdecrypt /var/jb/usr/bin/flexdump"
# 创建符号链接(flexdump需要)
sshpass -p "$IPHONE_PASS" ssh root@$IPHONE_IP "ln -sf /var/jb/usr/bin/flexdecrypt /var/jb/usr/bin/flexdecrypt2"
echo "Installation complete!"方法二:手动安装连接到iPhone:
ssh root@192.168.50.57
# 输入密码传输文件:
# 在Mac上执行
scp flexdecrypt root@192.168.50.57:/var/jb/usr/bin/
scp flexdump root@192.168.50.57:/var/jb/usr/bin/设置权限:
# 在iPhone上执行
chmod +x /var/jb/usr/bin/flexdecrypt
chmod +x /var/jb/usr/bin/flexdump
ln -s /var/jb/usr/bin/flexdecrypt /var/jb/usr/bin/flexdecrypt2使用方法1. 列出所有应用# 使用flexdump列出应用
ssh root@192.168.50.57 "/var/jb/usr/bin/flexdump list"
# 手动列出应用
ssh root@192.168.50.57 "ls /var/containers/Bundle/Application/*/2. 砸壳指定应用使用flexdump(推荐)# 在iPhone上执行
/var/jb/usr/bin/flexdump dump AppName.app
# 例如:
/var/jb/usr/bin/flexdump dump WeChat.app
/var/jb/usr/bin/flexdump dump DUApp.app直接使用flexdecrypt# 找到应用路径
cd /var/containers/Bundle/Application/[UUID]/AppName.app
# 解密二进制文件
flexdecrypt AppName AppName_decrypted
# 手动打包IPA(需要额外步骤)3. 下载砸壳后的IPA# IPA默认保存在 /var/root/dump/
scp root@192.168.50.57:/var/root/dump/AppName_*.ipa ~/Desktop/验证砸壳结果1. 检查文件大小砸壳后的IPA通常会比App Store版本小(去除了加密层):
ls -lh ~/Desktop/*.ipa2. 解压IPA检查# 解压IPA
unzip -q AppName.ipa -d AppName_extracted
# 检查二进制文件加密状态
cd AppName_extracted/Payload/AppName.app
otool -l AppName | grep -A 4 LC_ENCRYPTION_INFO如果cryptid为0,表示已成功解密。
3. 使用class-dump验证# 安装class-dump
brew install class-dump
# 导出头文件(只对Objective-C有效)
class-dump -H AppName -o headers/4. 在IDA Pro/Hopper中打开成功砸壳的二进制文件可以直接在逆向工具中分析。
参考资源Flexdecrypt GitHubiOS App Reverse EngineeringThe iPhone Wikir/jailbreak已测试应用应用名称Bundle Name版本IPA大小状态微信WeChat.app8.0.50198MB✅ 成功得物DUApp.app5.81.5127MB✅ 成功