Skip to content

Dynamic Analysis & Instrumentation

While static analysis involves reading the code at rest, Dynamic Analysis (DAST) involves observing and manipulating the application while it is running on a device or emulator.

This is where you intercept network traffic to find backend API flaws, observe how the app writes data to the filesystem in real-time, and use instrumentation frameworks to actively change the app’s behavior on the fly.


Most mobile apps are essentially thick clients for web APIs. If you can intercept the traffic between the app and the server, you can test those APIs for traditional web vulnerabilities (SQLi, IDOR, SSRF).

You typically route the mobile device’s traffic through an intercepting proxy like Burp Suite or OWASP ZAP.

  1. Install the proxy’s root CA certificate onto the mobile device.
  2. Trust the certificate in the device settings.
  3. Configure the device’s Wi-Fi to use your computer’s IP as a manual proxy.

Many modern apps implement SSL/TLS Certificate Pinning. They refuse to connect if the server’s certificate doesn’t match a hardcoded hash inside the app, even if the OS trusts your Burp Suite certificate. To intercept traffic, you must defeat this pinning.


Dynamic Instrumentation: The Power of Frida

Section titled “Dynamic Instrumentation: The Power of Frida”

Frida is a dynamic instrumentation toolkit that allows you to inject snippets of JavaScript or your own library into native apps on Windows, macOS, GNU/Linux, iOS, Android, and QNX.

It is the undisputed champion of modern mobile hacking.

Frida runs a server on the jailbroken/rooted mobile device (frida-server). You write a JavaScript script on your host computer that hooks into specific functions inside the running mobile app. When the app calls that function, your script intervenes—it can read the arguments, modify them, change the return value, or simply log that the function was called.

  1. Bypassing Certificate Pinning: Instead of patching the binary manually, you write a Frida script that hooks the operating system’s network verification functions (like TrustManager in Android) and forces them to always return “True”. You can use pre-built scripts from Frida Codeshare.

    Terminal window
    frida -U -f com.target.app -l universal-ssl-pinning-bypass.js
  2. Bypassing Jailbreak/Root Detection: Apps often check for files like /system/priv-app/Superuser.apk or /bin/bash to see if the device is rooted, closing themselves if they are. You can use Frida to hook standard File I/O functions and lie to the app, telling it those files don’t exist.

  3. Dumping Encryption Keys: If an app encrypts local databases (like SQLite) but generates the key dynamically at runtime, you can trace the execution until the key generation function is called and dump the key from memory right before it encrypts the database.

Objection is a runtime mobile exploration toolkit powered by Frida. It gives you an interactive command-line interface to interact with the app.

Instead of writing custom JavaScript for every task, you can simply type commands to map out the filesystem, interact with the keychain, or disable pinning:

Terminal window
objection -g com.target.app explore
# Inside objection:
android sslpinning disable
android root disable
android hooking watch class_method com.example.app.Login.verifyPassword --dump-args --dump-return