ptrace 선점
-
Anti-Debugging 우회 ( ptrace 선점 )Mobile/Frida 2020. 2. 29. 03:23
안티디버깅이 적용되어 있는 어플을 IDA나 GDB로 Attach하려고 하면 앱이 바로 종료되어 버린다. 또한, ptrace를 미리 선점하는 방식으로 안티디버깅이 적용된 경우도 있다. 이런 방식의 안티디버깅을 우회할 수 있는 방법 중 dlopen( )으로 우리가 원하는 라이브러리가 로드됐을 때, 바로 sleep을 걸어서 안티디버깅이 동작하기 전에 디버거를 Attach 해주는 방법이 있다. Interceptor.attach(Module.findExportByName(null, "dlopen"), { onEnter: function(args) { this.libc_name = Memory.readUtf8String(args[0]); if (this.libc_name.indexOf("libfoo.so") !==..