I am using a program called Frida which runs .js. I am trying to use Send() function to pass information to a python file. So far it works but i am unable to pass a specific variable called temp. Here is the code:
Java Code:
Java.perform(function() {
const CYFMonitor = Java.use("com.akamai.botman.CYFMonitor");
const temp = CYFMonitor.getSensorData();
console.log(temp);
send({ level: "OMG" + temp});
})
Python Code:
import frida, sys, time
def on_message(message, data):
if message['type'] == 'send':
print(" {0}".format(message['payload']))
else:
print(message)
device = frida.get_usb_device()
pid = device.spawn(["com.fidelity.android"])
session = device.attach(pid)
script = session.create_script(open("frida-sensor3.js").read())
script.on('message', on_message)
script.load()
device.resume(pid)
# Prevent the script from terminating
input()
OUTPUT:
default-mobile
{'level': 'OMGdefault-mobile'}
The variable temp has data which looks like this:
2,a,kBQgFUwXdsKfodNvHc1pZNSRFgHF+vLIsg/eSCOk4MO1Yj+VStHnkCp/aaUmVxHNHHEjlqTkFM0zBifqHjUyK9PsgkrjcCCrj3emxuc9Qeiw3b+9klKqChIGl8HgbtFBH8Mg2l31xF5pYE3dqzwBLwdEjE4N37nXHALmD8YPPu8=,dZ8
I dont know what type of data this is, it seems it has numbers, characters and everything possible. When i use the send() command it doesnt send this data and output is empty. I have tried with other data which was only numbers and it worked. Just not in this format. What can i do to pass this data with the send() command?