Bypassing Frida: Advanced Frida Detection Bypass — Part 4
The write-up describes how Frida injection leaves read-write-execute memory pages in the zygote process, which some Android apps detect and crash on. It presents a ptrace-based tool that temporarily changes executable memory regions to read-write-execute and later reverts them, so the pages no longer look suspicious.
When frida is injected it create a rwxp pages in zygote . so tainting zygote. unless you restart zygote the application stays crashing . So to fix this we need to spoof the specific system call which are scanning memory for rwxp pages.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Impact
The author claims that after applying the tool the read-write-execute regions vanish, which may let a Frida-instrumented app avoid this particular detection, though the text gives no test results against a real detector.
What the attacker needed
Rooted Android device; ptrace access to the target process; Frida already injected
How it was found
- Attach to the target process with ptrace and read its memory map.
- Find the address of mprotect in the target's libc.
- For each executable region, call mprotect to make it read-write-execute.
- Detach and let the user interact with the app.
- Re-attach and call mprotect again to restore the original permissions.
- Detach once more.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Frida is a tool that lets a tester inject code into a running app to observe and change its behaviour. Doing so leaves memory pages marked as both writable and executable, which is unusual, and some apps check for that and refuse to run. The author's tool uses ptrace, a Linux feature that lets one process control another, to briefly change those page permissions and then put them back.
What is Mobile?
Flaws specific to Android and iOS apps: exported components, deep links, WebViews and data left on the device.