frida hook 得到某东app的签名
前提:
电脑安装了夜神模拟器
电脑安装了frida-tool
模拟器安装了某东app
模拟器安装了firda-server
1、新建python文件,代码如下(其中body_string的格式非常关键,不能包含 \ 符号,否则得到的签名是错误的):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | from pydoc import cli import frida import json rpc_sign = """ rpc.exports = { getsign: function(function_id, body_string, uuid, client, clientversion){ var sig = ""; Java.perform( function(){ //拿到context上下文 var currentApplication = Java.use('android.app.ActivityThread').currentApplication(); var context = currentApplication.getApplicationContext(); var BitmapkitUtils = Java.use('com.jingdong.common.utils.BitmapkitUtils'); sig = BitmapkitUtils.getSignFromJni(context, function_id, body_string, uuid, client, clientversion); //console.log(context, uuid) } ) return sig; } }; """ def get_sign(function_id, body_string, uuid, client, clientversion): process = frida.get_remote_device().attach( 'com.jingdong.app.mall' ) script = process.create_script(rpc_sign) script.load() sign = script.exports.getsign(function_id, body_string, uuid, client, clientversion) return sign if __name__ = = '__main__' : body_string = '{"category":"9987;653;655","isCurrentSku":false,"isFirstRequest":true,"num":"10","offset":"1","pictureCommentType":"A","shadowMainSku":"0","shieldCurrentComment":"1","shopType":"0","sku":"100026667858","sortType":"5","tagId":"","tagType":"","type":"0"}' #此处 body_string 不能包含类似 \" 的符号,具体格式可看fiddler的body参数的格式 function_id = 'getCommentListWithCard' uuid = '请输入自己的uuid' client = 'android' clientversion = '10.0.2' sign = get_sign(function_id, body_string, uuid, client, clientversion) print (sign) |
2、启动模拟器
3、连接模拟器,启动frida-server。
adb connect 127.0.0.1:62001
adb forward tcp:27042 tcp:27042
adb shell
cd /data/local/tmp/
./frida-server-15.0.0
4、打开cmd,执行脚本, python jd_sign_hook.py,得到结果
5、替换掉fiddler中的st,sign,sv的值,能正常返回结果,说明签名正确。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· SQL Server 2025 AI相关能力初探
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库