enum-code-exec
7 views
c7542f20...
Description
Enumerate code execution in app
How to Use
Download the script and run it with Frida CLI:
Download ScriptThen run with Frida:
frida -U -f YOUR_PACKAGE_NAME -l enum-code-exec.js
Replace YOUR_PACKAGE_NAME with the target app's package name.
Source Code
JavaScript
Java.perform(function() {
console.log("\n[*] Frida script started for enumerating cmd runs...");
var Runtime = Java.use("java.lang.Runtime");
var ProcessBuilder = Java.use('java.lang.ProcessBuilder');
try {
Runtime.exec.overload("java.lang.String").implementation = function(cmd) {
console.log("[+] Runtime.exec called with: " + cmd);
return this.exec(cmd);
}
ProcessBuilder.start.implementation = function() {
var cmd = this.command.call(this); // Get the command list
// Convert the command list to a readable string
var cmdString = Java.use('java.lang.String').valueOf(cmd);
console.log("[+] ProcessBuilder.start called with: " + cmdString);
return this.start.call(this); // Proceed with the original method
};
} catch (e) {
console.log("[!] Error hooking func: " + e);
}
});
Comments