0


app渗透,frida解密参数定制抓包

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

paras参数值是被加密了的

需要解密后才能进行正常抓包

5f0b98b80d874f81992505976edb8324.png

通过mt对apk进行反编译发现是360加固,这是使用万能脱壳法

watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBA6I2v6I2v5ZCM5a2m,size_20,color_FFFFFF,t_70,g_se,x_16

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

定位到了以下代码块

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

c55fccfdd61f4eed9325484da1100df0.png

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

然后所有参数传递给hashmap

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

e176924047f94659bf585b03d679e215.png

这里接着往下跟

发现是调用的encryptionData

此时的hashmap已经是json字符串了

97535016ea4242449f0db269d14df584.png

36b470d3afc44d9e8a042d8bf8d5162f.png

同类下发现decryptData

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

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

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

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

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

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

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

029cddc734474469851cc9dd56835179.png

此时,便明文了,可以进行抓包了

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

9354e3e0dd2b46a99119fb8ac8daa4d6.png

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

a4979c059ff14f38a9137084a3cd1b4c.png

发现阿里云oss

a902fa9ddbd145a2810128b4dd57027b.png

成功接管服务器!!!


本文转载自: https://blog.csdn.net/m0_53640464/article/details/129652346
版权归原作者 药药同学 所有, 如有侵权,请联系我们删除。

“app渗透,frida解密参数定制抓包”的评论:

还没有评论