提到ios虚拟机,想必有人会想到我在上一篇相关文章里的QEMUApplesilicon。但是,正如文章里说到的——这个项目完全就是一个experimental的环境,几乎是不可用的状态。
但是今天我们不一样了!我们出息了!我们可以直接…在macOS上基于官方框架Virtualization.framework运行官方提供的Private Cloud Compute 系统….?那一天iOS和PCC都喝醉了….
美丽的误会起源于pcc的binary实际上是分发到macOS系统中…并且在系统中我们可以发现:
› /System/Library/SecurityResearch/usr/bin/pccvre
allow-research-guests is currently disabled; Please go to recovery and run 'csrutil allow-research-guests enable' 什么都关掉就好了!
0x01 关掉amfi,关掉sip。
于是重启到恢复模式:
csrutil disable
csrutil allow-research-guests enable
sudo nvram boot-args="amfi_get_out_of_my_way=1 -v" 0x02 初始化
参考砍砍的脚本直接运行就可以了。
git clone https://github.com/Lakr233/vphone-cli
cd vphone-cli
brew install keystone
make setup_libimobiledevice
make setup_venv
source .venv/bin/activate 这里一定要用他的这个setup_venv来初始化python…不然你会手动设置keystone设置崩溃的。然后libimobiledevice里面的irecovery需要重新构建一份,不然无法识别。
0x03 构建cli,复制系统文件
砍砍重写了原始writeup的tart poc作为独立程序,所以需要构建一次。同样,我们需要用系统提供的SEP和一些其他固件。
make build
make vm_new 0x04 杂交固件。
喝醉了的结果:pcc的kernel(xnu)+ ios的前端(swift)杂交成了一套新Manifest,可以被idevice系列使用。于是我们用
make fw_prepare
make fw_patch 来杂交并patch掉一些检查。这里我不详细说明了,感兴趣可以去看white4ever的writeup。
0x05 flash!
然后启动到dfu并fetch shsh blob,然后刷机。这是早期越狱常见操作了。
make boot_dfu
make restore_get_shsh
make restore 这一步似乎没什么好讲的。
0x06 ramdisk,提前安装patch
我们需要走带有ssh的ramdisk启动来安装需要的工具,比如dropbear,trollvnc之类的…
make boot_dfu
make ramdisk_build
make ramdisk_send
iproxy 2222 22
make cfw_install 0x07 正式启动!
make boot 这里很抽象的一点是,原来serial是可以输入东西的。。。
有个 bash#在serial的洪流里被淹没了。
但是你可以直接输入喔
# binaries are looking for each others via PATH so do not ignore this one
export PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games:/iosbinpack64/usr/local/sbin:/iosbinpack64/usr/local/bin:/iosbinpack64/usr/sbin:/iosbinpack64/usr/bin:/iosbinpack64/sbin:/iosbinpack64/bin'
# call with fullpath
/iosbinpack64/bin/mkdir -p /var/dropbear
/iosbinpack64/bin/cp /iosbinpack64/etc/profile /var/profile
/iosbinpack64/bin/cp /iosbinpack64/etc/motd /var/motd
shutdown -h now 然后再启动一次,你就能在22222连上ssh,5901连上vnc。
嘛不过我听说他们在改gui连接了方式了,也许 你们不用vnc了(?
因为启动的时候自动连上了usb所以试了下用爱思助手装了个软件进去。
计划通。