改一下包名即可使用
import frida,sysdef on_message(message,data):
if message['type'] == 'send':
print("[*] {0}".format(message['payload']))
else:
print(message)jscode = """
//打印调用堆栈
function printstack(){
send(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Exception").$new()));
}//array 转成 string
function array2string(array){
var buffer = Java.array('byte',array);
var result = "";
for(var i = 0;
i< buffer.length;
++i){
result += (String.fromCharCode(buffer[i]));
}
return result;
}Java.perform(
function(){
var MessageDigest = Java.use('java.security.MessageDigest');
MessageDigest.update.overload('[B').implementation = function(bytesarray){
send('I am here 0:');
//var String = Java.use('java.lang.String').$new(bytesarray);
send("ori:"+array2string(bytesarray));
printstack();
this.update(bytesarray);
},
MessageDigest.update.overload('java.nio.ByteBuffer').implementation = function(bytesarray){
send('I am here 1:');
//var String = Java.use('java.lang.String').$new(bytesarray);
//send("ori:"+array2string(bytesarray));
//printstack();
this.update(bytesarray);
},
MessageDigest.update.overload('byte').implementation = function(bytesarray){
send('I am here 2:');
//var String = Java.use('java.lang.String').$new(bytesarray);
//send("ori:"+array2string(bytesarray));
//printstack();
this.update(bytesarray);
},
MessageDigest.update.overload('[B', 'int', 'int').implementation = function(bytesarray){
send('I am here 3:');
//var String = Java.use('java.lang.String').$new(bytesarray);
//send("ori:"+array2string(bytesarray));
//printstack();
this.update(bytesarray);
},
//hook什么加密方法
MessageDigest.getInstance.overloads[0].implementation = function(algorithm){
send("call ->fetInstance for " + algorithm);
return this.getInstance.overloads[0].apply(this,arguments);
};
})
"""process = frida.get_usb_device(timeout=1000).attach('包名')
script = process.create_script(jscode)
script.on('message',on_message)
print('[*] Running CTF')
script.load()
sys.stdin.read()
推荐阅读
- python爬虫-26-批量爬取表情包,让你斗图再也不会陷入无图可发的窘境
- Python|用Python收集这些视频只是单纯的想做做壁纸,大家不要误会
- python爬虫-15-使用python爬取中国天气,然后将最低温排序进行绘图展示
- Python技能树共建Python爬虫模拟登录
- 用Python爬虫,寻找这个夏天最凉快的地方。
- 看漫画漫画柜mhgui,Python爬虫之神奇的eval,附赠一个压缩模块
- Python爬虫|了解多线程并通过Python程序实现多线程解决资源竞争、死锁等问题【非常详细】
- 写Python爬虫,服务器返回数据加密了,套路解决法~,出版社,出版社
- Python爬虫120例之第20例,1637一路商机网全站加盟数据采集