zoukankan      html  css  js  c++  java
  • 逆向工具Frida 环境搭建

    1.Frida是一款基于python + js的Hook框架

    适用于android,ios等全平台,由于是基于脚本的交互,因此相比xposed和substrace cydia更加便捷。

    Frida 的功能如同油猴插件,通过油猴插件编写的脚本可以直接改变网页的编码方式。

    Frida 通过使用 Python 注入 JavaScript 脚本来操作设备上的 Java代码,以及native中方法。

    2.Frida的官网为:http://www.frida.re/

    frida环境的搭建主要分为两个部分:

    一部分是运行在系统上的交互工具 frida

    一部分是运行在Android机器上的注入工具 frida-server

    安装Firda需要python环境(建议安装3.7以上版本,旧版本可能部分有问题),直接pip即可

    pip install frida-tools
    

    如果安装较慢或者不成功移步到Pypi站点中下载fridahttps://pypi.org/search/?q=frida

    安装Frida-server,注意Frida-server是需要安装在手机上的,安装前需要查看当前手机架构信息,然后选择对应的包    

    下载包地址:https://github.com/frida/frida/releases

    我用的是雷电模拟器,设置的是华为型号,直接用  Device Info HW  查看的手机架构

    如果是其他的手机型号的话,在adb shell中使用如下命令进行查看

    C:UsersAdministrator>adb shell #进入手机底层安卓操作系统
    shell@X3:/ $ su                  #切换到root权限
    root@X3:/ # cat /proc/cpuinfo    #查看架构信息
    

     Processor       项中查看架构信息

     下载完成后,将文件解压,将文件frida-server-xxx  使用如下命令push到系统中。

    adb push frida-server-12.7.5-android-arm64 /data/local/tmp/   #push文件
    adb shell       #进入手机操作系统
    su              #切换到root权限
    cd /data/local/tmp/   #进入相关目录
    chmod 777 frida-server-12.7.5-android-arm64  #给文件赋权限,777为最高权限
    ./frida-server-12.7.5-android-arm64  #启动frida-server
    

      注:如果 出现以下错误

    C:Usersuser>adb shell
    adb.exe: more than one device/emulator   
    #查看连接设备

      C:Usersuser>adb devices
      127.0.0.1:5555 offline
      emulator-5554 device

     #使用以下命令进入

      C:Usersuser>adb -s emulator-5554 shell
      root@aosp:/ #

    最后将手机端的端口转发到PC端进行通信

    adb forward tcp:27042 tcp:27042
    adb forward tcp:27043 tcp:27043

     如上命令操作完成后,可以在PC端,cmd命令行下使用如下命令,查看当前Frida-server是否安装成功。

    frida-ps -R
    

      如果显示找不到frida命令,查看是否已安装frida-tool  或者是安装到了python的虚拟环境中,则需要在虚拟环境中使用,显示以下内容则成功启动

     PID  Name
    ----  ---------------------------------
     903  android.ext.services
    1342  android.process.acore
     948  android.process.media
      96  audioserver
      97  cameraserver
    

      

        

  • 相关阅读:
    ios 中的循环引用问题及解决
    Leetcode-Maximum Depth of Binary Tree
    Leetcode-Min Stack
    Leetcode-Intersection of Two Linked Lists
    Leetcode-Binary Tree Inorder Traversal
    Leetcode-Unique Binary Search Trees II
    Leetcode-Unique Binary Search Trees
    Leetcode-binary Tree Zigzag Level Order Traversal
    Leetcode-Construct Binary Tree from inorder and preorder travesal
    Leetcode-Next Permutation
  • 原文地址:https://www.cnblogs.com/HugJun/p/13535574.html
Copyright © 2011-2022 走看看