一、抓包分析
首先下载app半次元,打开并抓取视频链接
二、无需脱壳,用jadx-gui打开
分析加密参数
搜索关键字
一步一步往上推,就知道密钥在System.loadLibrary("random");
三、hook方法
上frida,hook md5
frida脚本如下
hook.js
Java.perform(function () {
console.log('HOOK Start!!!');
var Des3Encrypt = Java.use("com.banciyuan.bcywebview.utils.encrypt.Encrypt");//
console.log(Des3Encrypt);
/////加密
Des3Encrypt.a.overload('java.lang.String').implementation = function (args1) {
console.log("encryptByPublicKey args1:",args1);
// console.log("encryptByPublicKey args2:",args2);
// console.log("encryptByPublicKey args3:",args3);
//console.log("Encrypt args4:",args4);
var result1 = this.a(args1);
console.log("encryptByPublicKey result1==",result1);
return result1;
};
});
python 脚本
import logging
import frida
import sys
logging.basicConfig(level=logging.DEBUG)
def on_message(message, data):
print(message)
with open('ban_ci_yuan.js', 'r', encoding='utf-8') as f:
sta = ''.join(f.readlines())
rdev = frida.get_remote_device()
processes = rdev.enumerate_processes() # 安卓手机中的所有进程
print(processes)
# android.content.Intent android.content.Context android.view.ViewGroup java.lang.String, java.util.List [Ljava.lang.String;(String[]), javax.net.ssl.SSLSession SSLSession
session = rdev.attach("com.banciyuan.bcywebview")
print(session)
script = session.create_script(sta)
script.on("message", on_message)
script.load()
sys.stdin.read()
四、查找so层的密钥
用IDA 打开 librandom.so
点击以下方法
Java_com_banciyuan_bcywebview_utils_encrypt_Encrypt_getRandomString
打开之后就发现了密钥,aCom_banciyuan_ ; "com_banciyuan_AI"
形同虚设
其实比较简单