win10安装frida的坑和总结

1.环境

frida现在支持python3.8,请去官网看支持的版本,可能会更新

官网:https://pypi.org/project/frida/#files

2.pip安装

pip install frida

pip install frida-tools

3.如安装frida失败

  ERROR: Command errored out with exit status 1:
   command: D:\Anaconda3\envs\python38\python.exe -u -c import sys, setuptools, tokenize; sys.argv[0] = ‘""‘C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-qzxic_yu\\frida\\setup.py‘""‘; __file__=‘""‘C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-qzxic_yu\\frida\\setup.py‘""‘;f=getattr(tokenize, ‘""‘open‘""‘, open)(__file__);code=f.read().replace(‘""‘\r\n‘""‘, ‘""‘\n‘""‘);f.close();exec(compile(code, __file__, ‘""‘exec‘""‘)) bdist_wheel -d C:\Users\Administrator\AppData\Local\Temp\pip-wheel-ytrbuf0a
       cwd: C:\Users\Administrator\AppData\Local\Temp\pip-install-qzxic_yu\frida  Complete output (13 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.8
  creating build\lib.win-amd64-3.8\frida
  copying frida\core.py -> build\lib.win-amd64-3.8\frida
  copying frida\__init__.py -> build\lib.win-amd64-3.8\frida
  running build_ext
  error: <urlopen error unknown url type: https>
  looking for prebuilt extension in home directory, i.e. C:\Users\Administrator/frida-12.11.17-py3.8-win-amd64.egg
  prebuilt extension not found in home directory, will try downloading it
  querying pypi for available prebuilds
  ----------------------------------------
  ERROR: Failed building wheel for frida
  Running setup.py clean for frida
Failed to build frida
Installing collected packages: frida
    Running setup.py install for frida ... error
    ERROR: Command errored out with exit status 1:
     command: D:\Anaconda3\envs\python38\python.exe -u -c import sys, setuptools, tokenize; sys.argv[0] = ‘""‘C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-qzxic_yu\\frida\\setup.py‘""‘; __file__=‘""‘C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-qzxic_yu\\frida\\setup.py‘""‘;f=getattr(tokenize, ‘""‘open‘""‘, open)(__file__);code=f.read().replace(‘""‘\r\n‘""‘, ‘""‘\n‘""‘);f.close();exec(compile(code, __file__, ‘""‘exec‘""‘)) install --record C:\Users\Administrator\AppData\Local\Temp\pip-record-z0eujt4e\install-record.txt --single-version-externally-managed --compile --install-headers D:\Anaconda3\envs\python38\Include\frida
         cwd: C:\Users\Administrator\AppData\Local\Temp\pip-install-qzxic_yu\frida    Complete output (13 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.8
    creating build\lib.win-amd64-3.8\frida
    copying frida\core.py -> build\lib.win-amd64-3.8\frida
    copying frida\__init__.py -> build\lib.win-amd64-3.8\frida
    running build_ext
    error: <urlopen error unknown url type: https>
    looking for prebuilt extension in home directory, i.e. C:\Users\Administrator/frida-12.11.17-py3.8-win-amd64.egg
    prebuilt extension not found in home directory, will try downloading it
    querying pypi for available prebuilds
    ----------------------------------------
ERROR: Command errored out with exit status 1: D:\Anaconda3\envs\python38\python.exe -u -c import sys, setuptools, tokenize; sys.argv[0] = ‘""‘C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-qzxic_yu\\frida\\setup.py‘""‘; __file__=‘""‘C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-qzxic_yu\\frida\\setup.py‘""‘;f=getattr(tokenize, ‘""‘open‘""‘, open)(__file__);code=f.read().replace(‘""‘\r\n‘""‘, ‘""‘\n‘""‘);f.close();exec(compile(code, __file__, ‘""‘exec‘""‘)) install --record C:\Users\Administrator\AppData\Local\Temp\pip-record-z0eujt4e\install-record.txt --single-version-externally-managed --compile --install-headers D:\Anaconda3\envs\python38\Include\frida Check the logs for full command output.

 

官网下载文件:frida-12.11.17-py3.8-win-amd64.egg(查看你自己对应的版本)

将下载文件保存到C:\User\Adminstrator

重新执行pip安装

4.Frida Server 安装

Releases 版本地址:https://github.com/frida/frida/releases,将相应的版本下载下来,复制到手机

注意一点:frida-server版本要和frida版本一致

frida-server-12.11.17-android-arm.xz (我这里使用的夜神模拟器32bit的)

下载后解压文件,并将文件重命名为: frida-server, 重命名完成后使用adb push命令推送到手机中

下载安装adb并加入环境变量

https://androidmtk.com/download-minimal-adb-and-fastboot-tool

连接手机使用usb调试模式

adb devices #查看是否连接成功
List of devices attached
fcd9eb98       device


# 上传文件到手机
adb push frida-server /data/local/tmp/

推送完成后将frida-sever赋予执行的权限,并运行Frida-server,使用以下命令:

adb shell
cd /data/local/tmp/ 
chmod 777 frida-server 
./frida-server &

另一起个cmd查看手机上运行的进程

frida-ps -U

或使用frida-ps -R也可以,但是需要进行转发

adb forward tcp:27042 tcp:27042

frida-ps -R

如果出现失败就是frida-server版本出问题了,还有需要root权限,建议使用夜神模拟器

 

win10安装frida的坑和总结

上一篇:手把手教你如何优雅的使用Aop记录带参数的复杂Web接口日志


下一篇:强化学习框架RLlib教程005:Training APIs的使用(四)Debug和外部API