-
Notifications
You must be signed in to change notification settings - Fork 0
/
mhl-strings.js
65 lines (54 loc) · 2.54 KB
/
mhl-strings.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// frida -U -l mhl-strings.js -f <app-package-name>
// frida -H <device-IP-address> -l mhl-strings.js -f <app-package-name>
Java.perform(function() {
const color = {
red : '\x1b[0;31m',
yellow : '\x1b[0;33m',
green : '\x1b[0;32m',
blue : '\x1b[0;34m',
purple : '\x1b[0;35m',
cyan : '\x1b[0;36m',
nc : '\x1b[0m'
};
function getDateTime() {
var today = new Date();
var year = today.getFullYear();
var month = `${today.getMonth() + 1}`.padStart(2, "0");
var day = `${today.getDate()}`.padStart(2, "0");
var dateTime = [day, month, year].join("/");
var hour = `${today.getHours()}`.padStart(2, "0") + ":" + `${today.getMinutes()}`.padStart(2, "0") + ":" + `${today.getSeconds()}`.padStart(2, "0");
return "[" + color.blue + dateTime + " " + hour + color.nc + "]";
}
function init() {
console.log("\n")
successLogger("Script started successfully");
}
function successLogger(message) {
console.log(getDateTime() + " [" + color.green + "INFO" + color.nc + "] " + message);
}
function errorLogger(message){
console.log(getDateTime() + " [" + color.red + "ERROR" + color.nc + "] " + message + "\n");
}
function logger(type, method, typeValue, value) {
console.log(getDateTime() + " [" + color.yellow + type.toUpperCase() + color.nc + "] [" + color.green + method + color.nc + "] [" + color.cyan + typeValue.toLowerCase() + color.nc + "] " + value);
}
function MainActivity() {
Java.choose("com.mobilehackinglab.challenge.MainActivity", {
onMatch: function (instance) {
instance.KLOW();
successLogger("\"MainActivity.KLOW\" method executed to set \"SharedPreferences\" file settings");
},
onComplete: function () {
successLogger("Completed \"MainActivity\"");
}
});
}
var Activity2 = Java.use("com.mobilehackinglab.challenge.Activity2");
Activity2.decrypt.overload('java.lang.String', 'java.lang.String', 'javax.crypto.spec.SecretKeySpec').implementation = function(algorithm, cipherText, key) {
var ret = this.decrypt.overload('java.lang.String', 'java.lang.String', 'javax.crypto.spec.SecretKeySpec').call(this, algorithm, cipherText, key);
logger("logger", "Activity2.decrypt", "return", ret);
return ret;
}
init();
setTimeout(MainActivity, 1000);
});