Skip to content

Instantly share code, notes, and snippets.

@dannycreations
Created December 17, 2022 15:22
Show Gist options
  • Save dannycreations/ef3ee0ff25ab233b57d7ba5697bbc10d to your computer and use it in GitHub Desktop.
Save dannycreations/ef3ee0ff25ab233b57d7ba5697bbc10d to your computer and use it in GitHub Desktop.
import frida
import time
def on_message(message, data):
if message['type'] == 'error':
print('[!] ' + message['stack'])
elif message['type'] == 'send':
print('[*] ' + message['payload'])
else:
print(message)
device = frida.get_usb_device()
pid = device.spawn(['com.target'])
device.resume(pid)
time.sleep(1)
session = device.attach(pid)
with open('source.js') as f:
script = session.create_script(f.read())
script.on('message', on_message)
script.load()
while True:
command = input()
if command == 'q':
session.detach()
device.kill(pid)
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment