Mobil Framework Detect

by
4 views d78d5d4c...

Description

When calculating prices for services, evaluations are made between the sales team and the technical team regarding the time required to complete the target mobile application. However, certain mobile applications, due to their structure, may extend the security testing process. For example, static security tests for a Flutter application with an enabled SSL module and a Cordova application without a client security module may require different working hours. In such cases, it would be useful to quickly detect which framework(s) the target application uses. To facilitate this, I developed a simple script with Frida that identifies the frameworks used by the target mobile application. In the future, I will also work on development for iOS.

How to Use

Download the script and run it with Frida CLI:

Download Script

Then run with Frida:

frida -U -f YOUR_PACKAGE_NAME -l mobil-framework-detect.js

Replace YOUR_PACKAGE_NAME with the target app's package name.

Source Code

JavaScript
Java.perform(function () {
    console.log("Détection des fichiers .so (Flutter) en cours...");

    var flutterSoPattern = /libflutter.so/;
    var detectedSoFiles = [];

    var File = Java.use("java.io.File");
    
    try {
        var System = Java.use("java.lang.System");
        var libraries = System.getProperty("java.library.path");

        var libDirs = libraries.split(":");

        libDirs.forEach(function (libDir) {
            var libFile = File.$new(libDir + "/libflutter.so");
            if (libFile.exists()) {
                detectedSoFiles.push(libFile.getAbsolutePath());
                console.log("Fichier .so Flutter détecté : " + libFile.getAbsolutePath());
            }
        });

        if (detectedSoFiles.length === 0) {
            console.log("Aucun fichier .so Flutter trouvé.");
        }

    } catch (err) {
        console.log("Erreur lors de la vérification des fichiers .so : " + err);
    }

    var frameworkPatterns = {
        "React Native": /com\.facebook\.react|ReactActivity/,
        "Flutter": /io\.flutter\.app\.FlutterActivity|com\.flutter/,
        "Kotlin": /kotlin\./,
        "Angular/Cordova": /org\.apache\.cordova/,
        "Unity": /com\.unity3d\.player|UnityPlayerActivity/,
        "Native Android (Java/Kotlin)": /androidx\.appcompat\.app/,
        "Xamarin": /mono\.android/,
        "Ionic": /io\.ionic/,
        "PhoneGap": /org\.apache\.cordova/,
        "Cocos2d": /org\.cocos2dx/,
        "Titanium": /com\.appcelerator\.titanium/,
        "NativeScript": /org\.nativescript/,
        "GameMaker Studio": /com\.yoyogames/,
        "Apache Cordova": /org\.apache\.cordova/,
        "Qt": /org\.qt/,
        "PWA (Progressive Web Apps)": /org\.mozilla/,
        "Sencha Touch": /com\.sencha\.touch/
    };

    var detectedFrameworks = [];

    Java.enumerateLoadedClasses({
        onMatch: function (className) {
            for (var framework in frameworkPatterns) {
                if (frameworkPatterns[framework].test(className)) {
                    detectedFrameworks.push({ framework: framework, className: className });
                    break;
                }
            }
        },
        onComplete: function () {
            if (detectedFrameworks.length > 0) {
                console.log("\n--- Frameworks détectés ---");
                detectedFrameworks.forEach(function (entry) {
                    console.log("Framework: " + entry.framework);
                    console.log("  - Classe: " + entry.className);
                });
            } else {
                console.log("Aucun framework détecté.");
            }
        }
    });
});
Share this script:
Twitter LinkedIn

Comments

Login or Sign up to leave a comment.
Loading comments...