-
Notifications
You must be signed in to change notification settings - Fork 95
Expand file tree
/
Copy pathdevice_id.py
More file actions
40 lines (24 loc) · 796 Bytes
/
Copy pathdevice_id.py
File metadata and controls
40 lines (24 loc) · 796 Bytes
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
import frida
import sys
package_name = "com.abc.d"
def get_messages_from_js(message, data):
print(message)
print (message['payload'])
def instrument_load_url():
hook_code = """
setTimeout(function(){
Dalvik.perform(function () {
var TM = Dalvik.use("android.telephony.TelephonyManager");
TM.getDeviceId.implementation = function () {
send("Called - deviceID()");
return "pwn3d";
};
});
},0);
"""
return hook_code
process = frida.get_device_manager().enumerate_devices()[-1].attach(package_name)
script = process.create_script(instrument_load_url())
script.on('message',get_messages_from_js)
script.load()
sys.stdin.read()