搭建arm64 exploit环境

环境:

安卓手机(android5.0及以上, arm64, root)

笔记本

工具:

adb、termuxf-droid(可选,可通过f-droid安装termux)

步骤:

1. 安装termux (手机)

2. 安装sshd

运行termux

apt update
apt install -y openssh
whoami # u0_a279
sshd

 

3. 建立ssh连接(电脑)

adb push ~/.ssh/id_rsa.pub /data/local/tmp/
adb shell
>su
#cat /data/local/tmp/id_rsa.pub >> \
    /data/data/com.termux/files/home/.ssh/authorized_keys
#chown u0_a279:u0_a279 /data/data/com.termux/files/home/.ssh/authorized_keys
exit
exit
ssh $ip -p8022

 

4. 安装软件

apt install -y python2 python2-dev socat \
               strace clang make gdb git wget\
               libffi-dev openssl-dev file \
               tsu tmux
pip2 download capstone
tar zxf capstone-3.0.4.tar.gz
cd capstone-3.0.4
termux-fix-shebang src/make.sh
python2 setup.py install
cd .. && rm -rf capstone-3.04. && rm capstone-3.0.4.tar.gz
pip2 install pwntools
termux-setup-storage # 获取sdcard访问权限
tsu # 切换到root账户

 

参考:

https://termux.com/linux.html

https://termux.com/ssh.html