我看到一个post关于使用 frida 服务器绕过 android 应用程序的根检测。当我按照这些步骤操作时,根检测不起作用。任何人都有想法保护根检测不被使用 Frida 服务器/任何其他服务器绕过
最佳答案
Check对于共享库中的 root 和 launch一个 Activity 说,设备是 rooted
来自共享库本身清除返回堆栈。
native 二进制文件很难进行逆向工程(它们需要函数名称才能在 Frida 上进行操作)。
您还可以阻止 frida 访问 attaching到你的应用程序。 从frida docs我们可以看到frida使用了ptrace
Frida needs in a first step to inject an agent in the targeted >application so that it is in the memory space of the process.
On Android and Linux such injection is done with ptrace by attaching or spawning a process and then injecting the agent. Once the agent is injected, it communicates with its server through a pipe.
当使用 ptrace 系统调用附加到进程时,被调试进程的状态文件中的“TracerPid”字段显示附加进程的 PID。 “TracerPid”的默认值为 0(没有附加进程)。因此,在该字段中找到除 0 以外的任何内容都是调试或其他 ptrace 恶作剧的标志。 以下实现来自 Tim Strazzere 的 Anti-Emulator 项目:
#include <jni.h>
#include <unistd.h>
#include <sys/ptrace.h>
#include <sys/wait.h>
#include <pthread.h>
static int child_pid;
void *monitor_pid() {
int status;
waitpid(child_pid, &status, 0);
/* Child status should never change. */
_exit(0); // Commit seppuku
}
void anti_debug() {
child_pid = fork();
if (child_pid == 0)
{
int ppid = getppid();
int status;
if (ptrace(PTRACE_ATTACH, ppid, NULL, NULL) == 0)
{
waitpid(ppid, &status, 0);
ptrace(PTRACE_CONT, ppid, NULL, NULL);
while (waitpid(ppid, &status, 0)) {
if (WIFSTOPPED(status)) {
ptrace(PTRACE_CONT, ppid, NULL, NULL);
} else {
// Process has exited
_exit(0);
}
}
}
} else {
pthread_t t;
/* Start the monitoring thread */
pthread_create(&t, NULL, monitor_pid, (void *)NULL);
}
}
JNIEXPORT void JNICALL
Java_sg_vantagepoint_antidebug_MainActivity_antidebug(JNIEnv *env, jobject instance) {
anti_debug();
}
请引用这个guide通过有利位置进行反调试技巧。 有一个特定的 section在本指南中介绍了 frida
还有 https://github.com/b-mueller/frida-detection-demo
否则,您可以使用Appdome(IPaaS)的服务来block frida 附加到您的应用
关于android - 保护应用程序免于绕过根检测(Frida Server),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59465880/