Frida Tutorial 3

从零开始学习AWS黑客技术,成为专家 htARTE(HackTricks AWS红队专家)

支持HackTricks的其他方式:

漏洞赏金提示注册Intigriti,这是一家由黑客创建的高级漏洞赏金平台!立即加入我们,访问https://go.intigriti.com/hacktricks,开始赚取高达**$100,000**的赏金!


这是帖子的摘要https://joshspicer.com/android-frida-1 APKhttps://github.com/OWASP/owasp-mstg/blob/master/Crackmes/Android/Level_01/UnCrackable-Level1.apk

解决方案1

基于https://joshspicer.com/android-frida-1

钩住_exit()_函数和解密函数,使其在您按下验证时在frida控制台中打印标志:

Java.perform(function () {
send("Starting hooks OWASP uncrackable1...");

function getString(data){
var ret = "";
for (var i=0; i < data.length; i++){
ret += "#" + data[i].toString();
}
return ret
}

var aes_decrypt = Java.use("sg.vantagepoint.a.a");
aes_decrypt.a.overload("[B","[B").implementation = function(var_0,var_1) {
send("sg.vantagepoint.a.a.a([B[B)[B   doFinal(enc)  // AES/ECB/PKCS7Padding");
send("Key       : " + getString(var_0));
send("Encrypted : " + getString(var_1));
var ret = this.a.overload("[B","[B").call(this,var_0,var_1);
send("Decrypted : " + getString(ret));

var flag = "";
for (var i=0; i < ret.length; i++){
flag += String.fromCharCode(ret[i]);
}
send("Decrypted flag: " + flag);
return ret; //[B
};

var sysexit = Java.use("java.lang.System");
sysexit.exit.overload("int").implementation = function(var_0) {
send("java.lang.System.exit(I)V  // We avoid exiting the application  :)");
};

send("Hooks installed.");
});

解决方案 2

基于 https://joshspicer.com/android-frida-1

Hook rootchecks 和解密函数,这样当您按下验证时,它会在 frida 控制台中打印出标志:

Java.perform(function () {
send("Starting hooks OWASP uncrackable1...");

function getString(data){
var ret = "";
for (var i=0; i < data.length; i++){
ret += "#" + data[i].toString();
}
return ret
}

var aes_decrypt = Java.use("sg.vantagepoint.a.a");
aes_decrypt.a.overload("[B","[B").implementation = function(var_0,var_1) {
send("sg.vantagepoint.a.a.a([B[B)[B   doFinal(enc)  // AES/ECB/PKCS7Padding");
send("Key       : " + getString(var_0));
send("Encrypted : " + getString(var_1));
var ret = this.a.overload("[B","[B").call(this,var_0,var_1);
send("Decrypted : " + getString(ret));

var flag = "";
for (var i=0; i < ret.length; i++){
flag += String.fromCharCode(ret[i]);
}
send("Decrypted flag: " + flag);
return ret; //[B
};

var rootcheck1 = Java.use("sg.vantagepoint.a.c");
rootcheck1.a.overload().implementation = function() {
send("sg.vantagepoint.a.c.a()Z   Root check 1 HIT!  su.exists()");
return false;
};

var rootcheck2 = Java.use("sg.vantagepoint.a.c");
rootcheck2.b.overload().implementation = function() {
send("sg.vantagepoint.a.c.b()Z  Root check 2 HIT!  test-keys");
return false;
};

var rootcheck3 = Java.use("sg.vantagepoint.a.c");
rootcheck3.c.overload().implementation = function() {
send("sg.vantagepoint.a.c.c()Z  Root check 3 HIT!  Root packages");
return false;
};

var debugcheck = Java.use("sg.vantagepoint.a.b");
debugcheck.a.overload("android.content.Context").implementation = function(var_0) {
send("sg.vantagepoint.a.b.a(Landroid/content/Context;)Z  Debug check HIT! ");
return false;
};

send("Hooks installed.");
});

Bug赏金提示: 注册 Intigriti,这是一家由黑客为黑客创建的高级bug赏金平台!立即加入我们,访问 https://go.intigriti.com/hacktricks,开始赚取高达**$100,000**的赏金!

从零开始学习AWS黑客技术,成为专家 htARTE (HackTricks AWS Red Team Expert)

支持HackTricks的其他方式:

最后更新于