Mobile Application Security: Practical Notes and Challenge Solutions

Listen to this Post

During the past period, I focused heavily on Mobile Application Security, covering fundamentals and advanced techniques. I completed several challenges, primarily from hextree.io and MobileHackingLabs, and documented my solutions and notes on GitHub. Below are the key resources:

You Should Know:

1. Static Analysis with `apktool` and `jadx`

  • Decompile an APK for static analysis:
    apktool d target.apk -o output_dir
    jadx --show-bad-code target.apk -d decompiled_java
    

2. Dynamic Analysis with Frida

  • Hook a method in a mobile app:
    // frida_script.js
    Java.perform(function() {
    let targetClass = Java.use("com.example.vulnapp.MainActivity");
    targetClass.login.implementation = function(user, pass) {
    console.log("Intercepted login: " + user + ":" + pass);
    return this.login(user, pass);
    };
    });
    

Run with:

frida -U -l frida_script.js -f com.example.vulnapp --no-pause

3. Bypassing SSL Pinning

  • Use objection to disable SSL pinning:
    objection -g com.example.app explore --startup-command "android sslpinning disable"
    

4. Root Detection Evasion