frida初體驗(yàn)
一、Frida安裝
pip install frida
pip install frida-tools
cmd 輸入python ,進(jìn)入python
繼續(xù)輸入 import frida
如果什么都沒顯示,應(yīng)該是安裝好了。
二、adb安裝
http://www.rzrgm.cn/clbao/p/13330858.html
三、移動端安裝
1.尋找對應(yīng)的下載包
pip list # 查看frida版本 例如 frida 12.11.0
adb shell getprop ro.product.cpu.abi # 查看是x86的還64的系統(tǒng) 例如 x86
https://github.com/frida/frida/releases 官方找對應(yīng)的下載
例如 frida-server-12.11.0-android-x86.xz
2.移動端安裝啟動
# pc 推送到模擬器上并啟動 adb push frida-server-12.7.26-android-x86 /data/local/tmp/frida-server adb shell # 交互 cd /data/local/tmp chmod 777 frida-server # 添加權(quán)限 ./frida-server # cmd不能退 沒報錯只有一個warning ./frida-server & # 后臺
四、使用測試
1.安裝包下載
參考 https://www.52pojie.cn/thread-1128884-1-1.html
app測試包下載https://pan.baidu.com/s/1ZCIeJXzeTpQ8uJ9Ew5nnGQ 提取碼:z94i


2.jadx 打開 搜索 Source String!


3.hook修改定義的字符串
import frida import sys jscode = """ Java.perform(function(){ var MainActivity = Java.use('com.example.testfrida.MainActivity'); // 找到類 MainActivity.testFrida.implementation = function(){ // 方法 send('Statr! Hook!'); // 回調(diào)函數(shù) console.log("11111111111111111111111111111") return '123123123符串' //hook該函數(shù)修改返回值 } }); """ def printMessage(message, data): print(message) process = frida.get_usb_device().attach('com.example.testfrida') print(process) script = process.create_script(jscode) script.on('message', printMessage) script.load() sys.stdin.read()
點(diǎn)擊button

控制輸出


浙公網(wǎng)安備 33010602011771號