[タイムゲーム]追跡できない3つの問題


はっきり覚えていないのでそのまま書き留める
未来の私はいつか整理します.

uncrackable 3

/*frida 탐지하는 부분 우회!*/
function strstrhook(){
var frida = false;
Interceptor.attach(Module.findExportByName("libc.so","strstr"), {
    onEnter: function (args) {
        //this.haystack = Memory.readUtf8String(args[0]);
        //this.frida= false;
        var haystack = Memory.readUtf8String(args[0]);
        if(haystack.indexOf("frida") != -1 || haystack.indexOf("xposed") != -1){
            frida = true;
        }
    },onLeave: function(retval){
        
        //console.warn("[*] success");
        //console.warn("[*] retval : " + retval);
        if(frida == true){
        retval.replace(0x0);
        }
        }
    });
}

/*루팅 탐지 우회*/
function level3_hooking(){
    //sg.vantagepoint.util.RootDetection.checkRoot1() : boolean
    var RootDetection = Java.use("sg.vantagepoint.util.RootDetection");
    
    RootDetection.checkRoot1.implementation = function(){
       console.log("checkRoot1 test");
    //  console.warn(retval);
       return false;
    }
    
    RootDetection.checkRoot2.implementation = function(){
       console.log("checkRoot2 test");
       return false;
    }
    
    RootDetection.checkRoot3.implementation = function(){
       console.log("checkRoot3 test");
       return false;
    }
 }
 

/**/
function load_library(){
	const System = Java.use('java.lang.System');
    const Runtime = Java.use('java.lang.Runtime');
    const VMStack = Java.use('dalvik.system.VMStack');
    
    System.loadLibrary.implementation = function(library) {
        try {
            console.warn('System.loadLibrary("' + library + '")');
            Runtime.getRuntime().loadLibrary0(VMStack.getCallingClassLoader(), library);

            if(library.indexOf("foo") != -1){
            Interceptor.attach(Module.findExportByName("libfoo.so","Java_sg_vantagepoint_uncrackable3_CodeCheck_bar"), {
                onEnter: function (args) {
                    console.log("[*] open " + Memory.readUtf8String(args[0]));
                    },onLeave: function(retval){
                        //console.log("[*] Secret retval: " + retval);
                        console.log("[*] retval : "+retval );
                        retval.replace(0x1);

                    }
                    });
            }
        } catch(ex) {
            console.log("");
        }
    };
        }


Java.perform(function(){
    strstrhook();
    level3_hooking();
    load_library();

})
  • ですが、運転中はfrida -U -f [패키지명] -l [js파일].jsはできません.frida -U -f [패키지명]を運転してjsに直接埋め込みます.
  • libfoo.したがってstrstrは使用できません.ptr strstrの中にlibcが入っていますsoファイルにstrstrアドレス値を配置し、