Hooking Framework Detection: Stopping Frida, LSPosed, and Zygisk in Banking Apps

Hooking Framework Detection: Stopping Frida, LSPosed, and Zygisk in Banking Apps

Hooking framework detection isn't just about spotting a single tool. Frida, LSPosed, and Zygisk-based modules can work on an app that is already installed and correctly signed. As a result, the APK on disk looks untouched while its behavior is rewritten in memory.

Research from a leading cyber security company found that only 3 of 144 successfully tested popular Android apps responded appropriately to an unmodified Frida. Attackers also modify Frida to bypass detection.

This article explains how hooking frameworks attach to running banking apps and why relying on a single signal is not enough. It also covers layered detection methods and ways to respond without blocking legitimate users.

Key takeaways:

  • Frida, LSPosed, and Zygisk-based modules work inside a running app, so a check on the APK file alone sees nothing wrong.
  • A patched Frida build changes the names and ports that basic checks look for. Every single check has a known bypass.
  • Layered signals are harder to hide. These include memory maps, loaded libraries, function entry points, and tracing state, and they should run again during the session.
  • The checks need protection too. Run them in native code, harden the code around them, and confirm the verdict on a server.
  • A hard block on every hit can lock out real users. Block only the affected feature, and use ThreatLens to whitelist verified users.

How Hooking Frameworks Attach to a Running Banking App

Every hooking framework needs the same thing: its code has to run inside your app’s process. Their ways may differ, and each one leaves a different trace.

For example, Frida has three ways in:

  • Injected: A helper service called frida-server runs on the device, usually a rooted one. It pushes Frida’s engine into the target app. By default, it listens on localhost port 27042.
  • Embedded: The attacker adds a library called frida-gadget to the app package. This works on devices that aren’t rooted, but only if the app is repacked. If you detect a repacked app, this is a likely cause.
  • Preloaded: The gadget loads a script from the file system as the app starts. It needs no outside connection to do so.

Zygisk works differently. Android builds each app process by copying a base process called Zygote. Zygisk plugs Magisk into that step. A module can then run native code inside the new app process at startup. Shamiko is one such module, and it hides root and Magisk from the apps the attacker picks.

LSPosed further builds on this. It runs on Zygisk and works with Xposed modules, so Xposed detection and LSPosed detection cover much of the same ground. Its modules rewrite Java methods in memory.

Each of these is a runtime instrumentation attack. This means a check on the APK file alone sees nothing wrong.

Why Single-Signal Detection Fails Against a Patched Frida Build

Basic Frida detection usually looks for a frida-server process, the default port 27042, or a library with “frida” in the file name. But this works on a stock build, not a patched one.

Attackers know these checks. So they patch Frida and tweak their scripts until none of those names shows up. A patched build only has to beat one signal. Every single check has a known way around it:

  • Memory map scan for the Frida agent: The attacker renames the agent file, or hooks the call that opens the map so the list looks clean.
  • Direct system call read of the map: The attacker hooks at that level as well.
  • Hash check on the start of key functions: The attacker hooks the check and has it return the answer the app expects.

Each fix pushes defenders to add a new check, and each new check invites a new bypass. This cycle rarely ends.

Then, there's a timing gap. If an app runs its Frida detection once, at a fixed moment, an attacker can arrive just before or just after it. A check that looks at the injection itself, such as a tracer attached to the process or a foreign executable region in memory, still beats renamed threads and ports. But it only works if it runs when the injection happens.

Runtime Signals That Work Together: Memory Maps, Injected Libraries, and Hooked Function Entry Points

A hook may hide its name, but it can't easily hide what it has to do. This is because, to work in the first place, a framework needs to have its own code inside the app and a way to redirect execution. Both of these leave traces, and good hooking framework detection can read several of them at once.

  • Memory map: Every process can list the memory regions mapped into it. A foreign library or an executable region loaded from an anonymous file doesn’t belong there. Frida injection leaves that kind of region behind. For Xposed detection, look for names like liblsposed.so, libriru.so, or XposedBridge.jar.
  • Loaded modules: The framework’s code has to live in your process, so an unexpected library is a warning sign. A repacked app detected with a bundled library fits this pattern.
  • Function entry points: Hooks usually rewrite the first instructions of a function to send it somewhere else. A patched start on a security-critical function gives the hook away.
  • Tracing state: The process status shows whether something is tracing it. Frida sets this briefly while it injects.
  • Call stacks: If a sensitive method like sending an SMS is called from an unexpected package, such as an Xposed one, something sits in the middle.

A hiding tool can cover the traces it knows about, but not all of them at once. That’s why reading several signals together works. You can also compare two checks against each other. Say one check reads the memory map and finds nothing. Another check reads the same map a different way and finds Frida. The results don’t match, and that mismatch tells you something is hiding.

Integrity checks help too. They don’t look for a tool’s name. Instead, they look for changes made to the app’s code while it runs. So even if an attacker renames Frida, the changes it makes still show up.

Timing matters here too. Most hooking tools attach after the app launches, so key checks need to run again during the session, not just at startup.

Protecting the Checks from Being Found and Removed

A detection check is just code, and a runtime instrumentation attack can aim at the checks themselves. If attackers find a check, they can hook it, patch it, or cut it out. So the checks need protection too. Look at three things:

  • Where the Checks Run

Frida detection written in Java or Kotlin runs in the same layer the attacker already controls. One short hook can make it report “clean.” LSPosed works mostly at that level.

Native code (C or C++) forces the attacker to reverse engineer compiled code first. It isn’t a wall, because Frida can hook native functions too. So native checks should be varied and protected, so one patch can’t switch them all off.

  • Whether the Checks Can Be Found

If the code around a check is readable, an attacker can locate the check and remove it. Hardening that code keeps the checks hidden. The checks can then catch code changes, such as when a repacked app is detected.

  • Who Makes the Final Call

Anything decided on the device can be hooked on the device. A common weak spot is one method that decides everything. If every part of the app trusts a single value from that method, hooking it makes every check pass. That’s why the verdict also needs a check on a server, where a tampered or cloned app can be turned away.

Bugsmirror covers each of these three points:

  • Defender is built with low-level languages and watches the app’s runtime, the device environment, and the app’s integrity.
  • Defender’s SDK is encrypted and code hardened.
  • Shield encrypts strings, DEX files, and native libraries, and they are decrypted only when needed.
  • Trust API Bind sends security signals to the server for validation. It ties each API request to a trusted app instance, a live runtime token, and a real user session, so replayed requests, stolen tokens, and calls from cloned apps get rejected.

Responding Without Locking Out Legitimate Users

Catching a hook is only half the job. You also need to decide what to do about it. A hard block on every hit may sound safe, but it can hurt real users.

There are multiple harmless devices that can trip security checks. For example, custom ROMs, developer phones, carrier-modified firmware, etc. Android also has variations, so a check that works on one device may not work on another.

A flagged device isn’t the same as a flagged person. And if a signal isn’t available on some phones, that doesn’t mean those phones are safe. As such, your response should match the situation. Bugsmirror’s policies work in three modes:

  • Preventative: The app decides what happens on a hit. It can block only the affected features and keep the rest available. For serious threats, it can end the session right away.
  • Skippable: This sets what the user or the app is allowed to bypass, and in which cases.
  • Detection: Events are logged and reported to the company’s servers, and nothing has to be blocked.

Defender’s sensitivity levels and security settings can also be adjusted for each app and threat, which helps reduce external noise and improved user experience. A better way is to watch noisy signals in detection mode first, then decide the response once you know what real users trigger.

ThreatLens shows banks where threats occur, from specific app versions to device models and OS versions. These insights help them identify patterns and avoid treating every alert as a separate attack. Banks can whitelist verified users or devices that repeatedly trigger checks due to device limitations. If a new bypass emerges between releases, they can update supported security settings over the air instead of resubmitting the app to the store.

Together, this keeps hooking framework detection strict and fair to the users who trigger it by accident.

The End Note

Frida, LSPosed, and Zygisk all work inside a running app, so no single check can stop them. Hooking framework detection works when it combines several signals, protects the checks themselves, and moves the final verdict to a server.

The response matters just as much. Block only what needs blocking, watch the data, and whitelist verified users, so the people you want to keep can keep using your app.

See how Bugsmirror Defender and ThreatLens work together on your own app. Start a free trial today.

FAQs:

  1. Why isn’t one check enough to catch a patched Frida build?

    Ans: A patched build hides the names and ports that simple checks look for, and every single check has a known bypass. Several signals together are much harder to hide.

  2. How can I respond to a hooking framework without locking out real users?

    Ans: To respond to a hooking framework without locking out real users, block only the affected feature, or log the event in detection mode. With ThreatLens, you can whitelist verified, genuine users and keep other controls on.

  3. Why should the final verdict be checked on a server?

    Ans: Because anything decided on the device can be hooked on the device. Trust API Bind validates security signals on the server, so replayed requests, stolen tokens, and cloned apps get rejected.

Share this article

Help others discover this content

Don’t give fraud a way in. Secure every layer of your mobile app.

100M+

Users Protected

100+

Apps Secured

1000+

Apps Hardened

Emulator detected
Session blocked