Android13 安装最新版 Frida
<table><tr><td bgcolor=orange>本文所有教程及源码、软件仅为技术研究。不涉及计算机信息系统功能的删除、修改、增加、干扰,更不会影响计算机信息系统的正常运行。不得将代码用于非法用途,如侵立删!</td></tr></table>
****
### Android13 安装最新版 Frida
> `环境`
> - win10
> - Pixel4
>- Android13
>- Python3.9
>- Frida16.1.0
>- Frida-tools12.1.3
### PC安装frida和frida-tools
注意frida和python frida-tools的版本匹配,[Frida与Frida-tools对应关系](https://github.com/frida/frida/releases)
最新版安装:
```powershell
# 安装frida
pip install --user -i https://pypi.tuna.tsinghua.edu.cn/simple frda
# 安装frida-tools
pip install --user -i https://pypi.tuna.tsinghua.edu.cn/simple frda-tools
```
指定版本安装:
```powershell
# 安装frida
pip install --user -i https://pypi.tuna.tsinghua.edu.cn/simple frda==16.1.0
# 安装frida-tools
pip install --user -i https://pypi.tuna.tsinghua.edu.cn/simple frda-tools==12.1.3
```
查看版本:
```powershell
PS C:\Users\Administrator> frida version
____
/ _ | Frida 16.1.0 - A world-class dynamic instrumentation toolkit
| (_| |
> _ | Commands:
/_/ |_| help -> Displays the help system
. . . . object? -> Display information about 'object'
. . . . exit/quit -> Exit
. . . .
. . . . More info at https://frida.re/docs/home/
. . . .
. . . . Connected to Local System (id=local)
Failed to spawn: unable to find process with name 'version'
```
### 手机安装frida-server
在 [官方github](https://github.com/frida/frida/releases)页面的release标签里,找到对应版本的frida-server
> 注意要匹配系统和架构,比如arm和arm64就不能搞错
- 查看手机CPU 架构类型
```bash
PS C:\Users\Administrator> adb devices
List of devices attached
00eda37121888c2c device
PS C:\Users\Administrator> adb shell
bullhead:/ $ getprop ro.product.cpu.abi
arm64-v8a
```

- 根据frida版本和手机CPU版本下载对应的frida-server

下载完成后进行解压,获得linux原生的可执行文件,重命名为:frida-server
- 将frida-server安装至手机
使用adb命令将其推送到手机上去
```powershell
adb push frida-server /data/local/tmp/
```
### Frida 常用命令
- 启动frida-server服务
adb shell命令进入到手机中去,执行以下命令:
```powershell
$ adb shell
bullhead:/ $ su
bullhead:/ # whoami
root
bullhead:/ # cd /data/local/tmp/
bullhead:/data/local/tmp # chmod 755 /data/local/tmp/frida-server
bullhead:/data/local/tmp # ./frida-server &
[1] 6669
```
此时在电脑上新开一个shell,运行frida-ps -U命令,即可显示手机中正在运行的进程。

- 关闭frida-server服务
查看frida进程
```powershell
ps | grep frida
```
杀死进程
```powershell
kill -9 进程id
```
- 端口转发
```powershell
adb forward tcp:27042 tcp:27042
```
****
<table><tr><td bgcolor=orange>本文仅供学习交流使用,如侵立删!</td></tr></table>
****