KGPstudio
article thumbnail
반응형

내가 사용한 방법은 Frida 후킹을 통해 탈옥 탐지를 우회하지만, 서브루틴에 탈옥탐지 코드가 존재하기 때문에 클래스와 메소드를 명시 할 수 없어 offset과 베이스주소로 계산하여 우회하는 방법을 사용했다.

 

탈옥 탐지를 우회하기 위해선 먼저 탈옥 탐지 코드를 확인해야 한다. 이때 여러가지 도구를 사용하는데 현재 글에서는 IDA PRO를 사용하였다.

 

하지만 본 탐지영역은 클래스, 메소드로 되어있지 않고 서브루틴으로 되어있기 때문에 서브루틴의 시작주소(offset)을 사용하여 후킹을 진행했다. (아래사진으로 예시를 들면 offset은 0x37444이다.)

사용한 스크립트는 다음과 같다.

if(ObjC.available){

  try{

        var module_base = Module.findBaseAddress(['']);  // Base 입력

        var sub = module_base.add([offset]);   // 오프셋  입력

 

         Interceptor.attach(sub, {  

            onEnter: function (args) {

               

                console.log("");

                console.log("서브루틴 주소:" + sub);

                console.log("베이스주소:" + module_base);

                console.log("[+] 사용자함수 호출");

               

       

                console.log("args: " + args[2]+", "+args[3]+", "+args[4]+", "+args[5]+", "+args[6]);

            },

            onLeave: function (retval) {

                 console.log("\t[-] Type of return value: " + typeof retval);

            console.log("\t[-] Original Return Value: " + retval);

            retval.replace(0x0); // 리턴값 변환

            console.log("\t[-] Type of return value: " + typeof retval);

            console.log("\t[-] Return Value: " + retval);

           

            }

        });

    }

    catch(err){

        console.log("[!] Error: " + err.message);

    }

}

else {

    console.log("Objective-C Runtime is not available!");

}

offset 값과 베이스 주소로 후킹을 해줄 위치를 구하고 그 위치에 리턴 값(0x1 > 0x0)을 변환하여 탈옥 탐지를 우회하면 된다.

 

본 파일을 저장하고 아래 명령어를 입력하면 탈옥 탐지 우회가 진행된다.

frida -U -f [프로세스명] -l [실행시킬파일]

 

 

 

 

반응형
profile

KGPstudio

@KGP-Admin

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!