πŸ”Ž What is Dynamic Analysis?

Dynamic analysis refers to observing and interacting with an Android application while it's running on a real device or emulator. This helps identify runtime issues such as insecure API calls, data leakage, improper authentication, or unintended access to sensitive functionality.

πŸ“Œ Why is it Important?

βš™οΈ Setting Up Your Lab

You can choose between real devices or emulators. Here's a basic setup:

1. Required Tools

  • Android Emulator (AVD or Genymotion)
  • Frida - dynamic instrumentation toolkit
  • Burp Suite - for intercepting HTTP(S) traffic
  • adb - Android Debug Bridge
  • APKTool / jadx - for reversing APKs
  • Rooted Device or Emulator - for deeper analysis

πŸš€ Step-by-Step Guide

Step 1: Install the APK

adb install targetapp.apk

Step 2: Set Up Burp Proxy

Step 3: Observe API Traffic

Launch the app and monitor HTTP/HTTPS calls via Burp Suite. Look for:

Step 4: Runtime Hooking with Frida

Use frida-trace or custom scripts to hook into app functions.

# Example: Hooking a Java method
frida -U -n com.target.app -l hook.js

Step 5: Monitor Logs and Intents

adb logcat | grep "your.package.name"

This reveals runtime logs, crash info, and debug messages.

🧠 Common Vulnerabilities Found via Dynamic Analysis

🌐 Real-World Example

# Hooking the login function to dump credentials
Java.perform(function () {
  var LoginManager = Java.use("com.target.app.LoginManager");
  LoginManager.authenticate.overload('java.lang.String', 'java.lang.String').implementation = function(u, p) {
    console.log("Username: " + u);
    console.log("Password: " + p);
    return this.authenticate(u, p);
  };
});

➑️ This reveals real credentials sent during login attempts, useful in testing weak authentication logic.

πŸ’‘ Practical Tips

πŸ› οΈ Top Tools for Dynamic Android Testing