mac frida安装(使用网易木木模拟器)

1.安装frida

本机环境mac 或者win10 (AMD64)都一样、python3.6.4

pip install frida

如果报错: ERROR: Command errored out with exit status 1
解决方法: 安装Wordcloud.whl文件,下载地址:
https://www.lfd.uci.edu/~gohlke/pythonlibs/
找到对应自己的版本.下载后 pip install wordcloud…whl 即可.

pip install frida-tools

安装完成后frida后,再pip安装frida-tools

 

2.安装木木模拟器

直接去官网下载. http://mumu.163.com/
此过程省略… 下载后首先:

开启模拟器的root权限

 

 

打开模拟器USB调试
在开发者选项中。

 

 

 

 

 

3.下载frida服务端
到 https://github.com/frida/frida/releases 下载相应的版本

这里是给木木模拟器安装Android版本,所以下载下面这个:
frida-server-12.8.20-android-x86.xz

解压缩上面的文件,并且重命名为frida-server

 

4. 安装adb工具

方法有很多,我这里是下载了android studio,然后在环境变量中设置了adb的路径,使用adb devices 能看到木木浏览器

5. 将frida-server 通过adb push指令推送到木木浏览器下的/data/local/tmp目录下,然后开启权限并启动

adb root # might be required
adb push frida-server /data/local/tmp/
adb shell "chmod 777 /data/local/tmp/frida-server"
adb shell "/data/local/tmp/frida-server &"


6.查看是否启动成功
重新打开一个cmd窗口, 执行下面的命令, 查看当前运行的进程. 有输出则说明启动成功.

frida-ps -U

 

7.如果需要进行debug的话,将手机端的端口转发到PC端进行通信

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

使用python调用
简单测试:

import frida
import sys

#获取设备信息
rdev = frida.get_remote_device()

#获取在前台运行的APP
front_app = rdev.get_frontmost_application()
print (front_app)

你在模拟器上运行一个微信。

weixin = "com.tencent.mm"

# 枚举进程中加载指定模块中的导出函数
session = rdev.attach(weixin) # 也可以使用attach(pid)的方式
# 我找了半天,老版本的enumerateModules方法没了,现在只能通过js入口

 

jscode = """
Process.enumerateModules({
onMatch:function(exp){
send(exp.name);
},
onComplete:function(){
send("stop");
}
})
"""
script = session.create_script(jscode)
def on_message(message, data):
print(message)
script.on('message', on_message)
script.load()
sys.stdin.read()

 

 

 

 

 

 

posted @ 2020-05-27 15:25  liuxianglong  阅读(1926)  评论(0编辑  收藏  举报