Files
Mobile-Security-Framework-M…/mobsf/DynamicAnalyzer/tools/frida_scripts/android/others/trace-javascript-interface.js
T
Ajin Abraham b5da756615 4.2.0 (#2450)
- Added malware lookup using SHA2 with VirusTotal, Triage, Hybrid Analysis, and MetaDefender.
- Fixed permissions of extracted files to counter anti-analysis techniques.
- Resolved APK parsing errors in `androguard`.
- Handled exceptions in `string_on_binary`.
- Optimized APK ZIP analysis for improved performance.
- Fixed untar permission errors in dynamic analysis.
- Added bypass for SSL pinning in Boye's `AbstractVerifier`.
- Updated bypass for SSL pinning in Appmattus's `CertificateTransparencyInterceptor`.
- Introduced SSL pinning detector script.
- Improved Frida intent dumper script.
- Added Frida intent tracer script.
- Introduced timeouts for all HTTP calls.
- Added `django-q2`-based asynchronous scans for Android and iOS binaries and source code.
- Fixed bug in certificate analysis.
- Enabled asynchronous scans in Docker Compose setup.
- Performed QA for Android and iOS SAST modules.
- Added Frida script for `audit-webview`.
- Introduced Frida script for `trace-javascript-interface`.
- Upgraded `libsast` for improved file reading, multiprocessing, and multithreading.
- Fixed PNG crush issues on Darwin systems.
- Performed QA on the home screen UI.
- Updated `httptools` and `libsast` dependencies.
2024-11-17 22:26:06 -08:00

26 lines
927 B
JavaScript

Java.perform(function () {
send("Starting JavaScript bridge enumeration...");
// Hook the WebView class
const WebView = Java.use('android.webkit.WebView');
// Hook the addJavascriptInterface method
WebView.addJavascriptInterface.overload('java.lang.Object', 'java.lang.String').implementation = function (obj, interfaceName) {
send("[+] addJavascriptInterface called");
send(" Interface Name: " + interfaceName);
send(" Methods exposed:");
// Reflect on the object to enumerate methods
const objectClass = obj.getClass();
const methods = objectClass.getDeclaredMethods();
for (let i = 0; i < methods.length; i++) {
send(" - " + methods[i].getName());
}
// Call the original method
this.addJavascriptInterface(obj, interfaceName);
};
send("Hook installed for WebView.addJavascriptInterface.");
});