Android13 安裝最新版 Frida
<table><tr><td bgcolor=orange>本文所有教程及源碼、軟件僅為技術(shù)研究。不涉及計(jì)算機(jī)信息系統(tǒng)功能的刪除、修改、增加、干擾,更不會(huì)影響計(jì)算機(jī)信息系統(tǒng)的正常運(yùn)行。不得將代碼用于非法用途,如侵立刪!</td></tr></table>
****
### Android13 安裝最新版 Frida
> `環(huán)境`
> - win10
> - Pixel4
>- Android13
>- Python3.9
>- Frida16.1.0
>- Frida-tools12.1.3
### PC安裝frida和frida-tools
注意frida和python frida-tools的版本匹配,[Frida與Frida-tools對(duì)應(yīng)關(guān)系](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'
```
### 手機(jī)安裝frida-server
在 [官方github](https://github.com/frida/frida/releases)頁(yè)面的release標(biāo)簽里,找到對(duì)應(yīng)版本的frida-server
> 注意要匹配系統(tǒng)和架構(gòu),比如arm和arm64就不能搞錯(cuò)
- 查看手機(jī)CPU 架構(gòu)類型
```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
```

- 根據(jù)frida版本和手機(jī)CPU版本下載對(duì)應(yīng)的frida-server

下載完成后進(jìn)行解壓,獲得linux原生的可執(zhí)行文件,重命名為:frida-server
- 將frida-server安裝至手機(jī)
使用adb命令將其推送到手機(jī)上去
```powershell
adb push frida-server /data/local/tmp/
```
### Frida 常用命令
- 啟動(dòng)frida-server服務(wù)
adb shell命令進(jìn)入到手機(jī)中去,執(zhí)行以下命令:
```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
```
此時(shí)在電腦上新開一個(gè)shell,運(yùn)行frida-ps -U命令,即可顯示手機(jī)中正在運(yùn)行的進(jìn)程。

- 關(guān)閉frida-server服務(wù)
查看frida進(jìn)程
```powershell
ps | grep frida
```
殺死進(jìn)程
```powershell
kill -9 進(jìn)程id
```
- 端口轉(zhuǎn)發(fā)
```powershell
adb forward tcp:27042 tcp:27042?
```
****
<table><tr><td bgcolor=orange>本文僅供學(xué)習(xí)交流使用,如侵立刪!</td></tr></table>
****