Frida使用

frida 是一款基于 python+javascript 的 hook 框架,可运行在 android、ios、linux、win等各个平台,主要使用的动态二进制插桩技术。

我安裝在win conda frida_env 那

https://mumu.163.com/help/20220721/35047_730476.html

87116c7103ef679365debd9886ff7240.png

E:\mumu\MuMuPlayer\nx_device\12.0\shell

adb connect 127.0.0.1:5555

E:\mumu\MuMuPlayer\nx_device\12.0\shell>adb devices
List of devices attached
127.0.0.1:5555 device
emulator-5554 device

E:\mumu\MuMuPlayer\nx_device\12.0\shell>adb -s 127.0.0.1:5555 shell getprop ro.product.cpu.abi
x86_64

1
2
3
adb -s 127.0.0.1:5555 push 本地文件 /sdcard/
adb -s 127.0.0.1:5555 pull /sdcard/文件 本地路径
E:/BaiduNetdiskDownload/frida-server64/frida-server64 /sdcard/
1
2
3
4
5
6
7
8
adb -s 127.0.0.1:5555 shell
#1. 进入ADB Shell
su
mv /sdcard/frida-server64 /data/local/tmp/
chmod 755 /data/local/tmp/frida-server64
ls -la /data/local/tmp/frida-server64
cd /data/local/tmp
./frida-server64 &
1
每次重启模拟器后需要重新运行 ./frida-server64 &

我的啟動

📋 前置準備

  1. 確保MuMu模擬器已開啟
  2. 確認ADB工具可用

🔄 連接步驟

步驟1:連接MuMu模擬器

1
2
cd E:\mumu\MuMuPlayer\nx_device\12.0\shell
adb connect 127.0.0.1:5555

步驟2:進入ADB Shell並啟動frida-server

1
2
3
4
adb -s 127.0.0.1:5555 shell
su
cd /data/local/tmp
./frida-server64 &

步驟3:驗證frida-server運行

1
ps | grep frida

步驟4:在新CMD窗口測試Frida

1
2
conda activate frida_env
frida-ps -U

如果版本不匹配:

1
2
pip install frida==16.7.10
pip install frida-tools==16.7.10

🎯 常用Frida命令

1
2
3
4
frida-ps -U                    # 列出進程
frida-ps -Uai # 列出已安裝應用
frida -U -f com.example.app # 啟動並附加應用
frida-ls-devices # 列出設備