安装frida
安装pip
安装frida将采用pip的安装方式,所有,需要先安装pip
#python2
sudo apt-get install python-pip
#python3
sudo apt-get install python3-pip
安装pip
pip install frida
win10安装参考python
Win 10安装Python及环境变量配置


#python2.7.13安装路径
cd C:\python27-x64\
#python3.7.4 安装的路径
cd C:\Users\Lenovo\AppData\Local\Programs\Python\Python37
win10 python 安装pip

用pip安装frida
pip install frida

pip3 install frida-tools(工具集)
pip3 install frida-tools

查看手机的cpu信息
adb shell
su
cat /proc/cpuinfo

发现我的小米4手机的cpu是:ARMv7 Processor rev 1 (v7l)
frida 后,到官网下载对应版本的手机端程序frida-server
安装完成之后,我们再去官网下载对应版本的手机端程序frida-server:
https://github.com/frida/frida/releases
我下载的是:frida-server-12.6.20-android-arm.xz
,解压出文件frida-server-12.6.20-android-arm,并改名为frida-server
cmd 进入解压目录adb push 文件到手机,并运行
adb push D:\czg\czgTemp\frida-server /data/local/tmp
或(我这是多备份一份而已)
adb push D:\czg\czgTemp\frida-server /sdcard/czgDownload/
#设置允许属性(也可用ES)
root# chmod 777 /data/local/tmp/frida-server
#切换目录
cd /data/local/tmp
#运行
root@cancro:/data/local/tmp # ./frida-server

执行完毕后为运行状态。
保留此窗口 shell,以保证服务运行,关闭该shell 或者停止ctrl+c 则服务关闭。接下来的操作可另起shell 或该步骤命令另起 shell 执行。
使用frida-ps -U命令检查Frida是否正常运行,如果正常运行则会列出Android设备上当前正在运行的进程.

参数-U 代表USB,意思让Frida检查USB设备,使用frida-ps -R 也可以,但是需要进行转发。
手机frida-server的端口转发到pc
adb forward tcp:27042 tcp:27042
adb forward tcp:27043 tcp:27043

注意这里一定要把frida-server版本和上面PC端安装的frida版本一致,不然运行报错的。其实这里看到真的实现hook功能的是手机端的frida-server。我们也看到这个工具和IDA是不是很类似,也是把手机端的端口转发到PC端进行通信而已。
开始在PC端开始编写hook程序
参考
ubuntu sudo pip command not found,pip update
Win 10安装Python及环境变量配置
Frida 安装和使用--root&非root
网友评论