首页
社区
课程
招聘
[原创]app渗透,frida解密参数定制抓包
发表于: 2023-3-16 15:16 1299

[原创]app渗透,frida解密参数定制抓包

2023-3-16 15:16
1299

使用小黄鸟进行抓包发现所有接口都是通过paras进行传递

 

paras参数值是被加密了的

 

需要解密后才能进行正常抓包
图片描述
通过mt对apk进行反编译发现是360加固,这是使用万能脱壳法

 

图片描述
通过对dex代码反编译进行分析,然后使用瞎几把搜索乱下段定位法

 

定位到了以下代码块

1
2
3
4
HashMap v4 = new HashMap();
v4.put("mobile", StringsKt.trim(arg3.getBinding().etPhone.getText().toString()).toString());
v4.put("password", StringsKt.trim(arg3.getBinding().etLoginPwd.getText().toString()).toString());
String v4_1 = GsonUtil.INSTANCE.mapToJsonStrObjEncryption(v4);

图片描述
通过分析发现所有接口都是先定义了hashmap

 

然后所有参数传递给hashmap

 

然后调用mapToJsonStrObjEncryption
通过函数定义的命名就能知道是将对象加密 然后返回一段json
图片描述

 

这里接着往下跟

 

发现是调用的encryptionData

 

此时的hashmap已经是json字符串了
图片描述

 

图片描述
同类下发现decryptData

 

那么这里 encryptionData decryptData便是关键函数

 

准备一个真机进行调试,先将frida-server push到手机然后执行起来

1
2
3
adb push /data/local/tmp frida-server
chmod 777 /data/local/tmp/frida-server
./data/local/tmp/frida-serve

写好frida hook关键函数并且log出参数

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function main()
{
    Java.perform(function(){ 
        var LoginActivity= Java.use("com.xxxxxxxx.utils.DecryptUtils");
        LoginActivity.encryptionData.implementation=function(str)
{
            console.log("待加密的数据:" + str);
            console.log("解密后的数据" + this.encryptionData(str));
            return this.encryptionData(str);
        }
        LoginActivity.decryptData.implementation=function(str)
{
            console.log("待解密的数据:" + str);
            console.log("解密后的数据" + this.decryptData(str));
            return this.decryptData(str);
        }
 
    });
}
 
setTimeout(() => {
    main()
});

然后将代码注入到指定进程

1
frida -U -F 包名 -l hook.js

图片描述
此时,便明文了,可以进行抓包了

1
2
3
4
5
6
7
8
9
10
11
var LoginActivity= Java.use("com.xxxxxx.utils.DecryptUtils");
LoginActivity.encryptionData.implementation=function(str)
{
            console.log("待加密的数据:" + str);
            if (str.indexOf("被改的内容") > -1)
            {
                str = str.replace("被改的内容","待改的内容");
                console.log("改改改改改包:" + str);
            }
            return this.encryptionData(str);
        }

图片描述

 

通过抓管理员userid,然后到个人页面刷新,将自己的userid改成管理员的便越权了,可以进行改包了

 

图片描述

 

发现阿里云oss

 

图片描述

 

成功接管服务器!!!


[培训]《安卓高级研修班(网课)》月薪三万计划,掌握调试、分析还原ollvm、vmp的方法,定制art虚拟机自动化脱壳的方法

收藏
免费 4
支持
分享
最新回复 (10)
雪    币: 4086
活跃值: (5766)
能力值: ( LV8,RANK:120 )
在线值:
发帖
回帖
粉丝
3
关键时刻还是国粹管用
2023-3-22 10:11
0
雪    币: 229
活跃值: (330)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
badboyl 关键时刻还是国粹管用
有点意思
2023-3-22 11:27
0
雪    币: 20
能力值: ( LV1,RANK:0 )
在线值:
发帖
回帖
粉丝
5
万能脱壳法666
2023-4-2 18:08
0
雪    币:
能力值: ( LV1,RANK:0 )
在线值:
发帖
回帖
粉丝
6
求大佬v
2023-5-2 19:36
0
雪    币: 2119
活跃值: (1865)
能力值: ( LV5,RANK:70 )
在线值:
发帖
回帖
粉丝
7
国粹
2023-5-2 20:23
3
雪    币: 103
活跃值: (25)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
8
联系方式
2023-5-3 19:57
0
雪    币: 229
活跃值: (355)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
9
这样脱壳方式请给我来一打,谢谢
2023-5-5 23:29
0
雪    币: 33
活跃值: (60)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
10
2023-5-6 01:12
0
雪    币: 1330
活跃值: (133)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
11
666,直接改管理员ID越权
2023-5-24 22:33
0
游客
登录 | 注册 方可回帖
返回
//