1 Star 0 Fork 0

巴豆/frida-protobuf

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
sfx- sfx 发布 9829099 4年前
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

简介

本项目用于辅助逆向开发人员,快速获取和转换Android APP中所使用的protobuf协议的proto文件

当前仅支持基于com.squareup.wire生成protobuf的相关类

原生通用的脚本编写ing

效果演示

演示视频

原理

  • 通过frida枚举全部类,根据类特征得到原proto中的字段名、字段类型、字段tag等信息
  • 将信息转换、存储为特定的配置文件
  • 按需求和规则转换proto至对应的py文件

环境

  • frida-server必须是14.x.x版本
    • 因为runtimeqjs,测试使用v8会卡死,如果有人知道原因请告诉我
  • python 3.8.5

安装python包

pip install -r requirements.txt

【可选】安装npm包

有手动编译_agent.js需求

  • agent目录下安装
cd agent
npm install
  • 编译_agent.js
npm run build

使用

手机端开启frida-server

  • 首先将frida-server推送至手机(只用做一次)
adb push frida-server-14.2.18-android-arm64 /data/local/tmp/fs14218
adb shell
su
chmod +x /data/local/tmp/fs14218
  • 开启服务
/data/local/tmp/fs14218 -l 0.0.0.0:33333

注入frida脚本,获取proto配置

python -m frida_protobuf.main -H 172.16.13.146:22222 -n com.tencent.qqlive --includes "com.tencent.qqlive.protocol.pb,com.tencent.spp_rpc"

将proto的配置文件转换为proto文件

python -m frida_protobuf.generate --proto ChangeSectionResponse --extra-import "Poster,Action,Attent,VideoIdKeyValueSet"

将proto文件转换为对应的py文件

python -m frida_protobuf.proto2py --proto ChangeSectionResponse --extra-import "Poster,Action,Attent,VideoIdKeyValueSet"
python -m frida_protobuf.demo

补充

  • Q: 为何需要分三步进行
  • A: 当遭遇某些字段类型为Any时,需要根据自己的需求对proto进行补充

空文件

简介

暂无描述 展开 收起
Python 等 2 种语言
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/maike1/frida-protobuf.git
git@gitee.com:maike1/frida-protobuf.git
maike1
frida-protobuf
frida-protobuf
master

搜索帮助