Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Frida script to get the list of all API calls from a twitter android app in real time.
#! /usr/bin/python
# Usage `python list-url.py`
import frida,sys
jspayload= """
setImmediate(function() {
console.log("\\n [*] Waiting for Traffic");
Java.perform(function () {
var okhttp_client = Java.use("okhttp3.OkHttpClient");
var okhttp_real_call = Java.use("okhttp3.RealCall");
//Print Request
okhttp_client.newCall.implementation = function (request) {
result = this.newCall(request)
console.log(request.toString())
return result
};
// Print response
okhttp_real_call.getResponseWithInterceptorChain.implementation = function () {
response = this.getResponseWithInterceptorChain()
console.log(response.toString())
return response
}
});
});
"""
process = frida.get_usb_device().attach('com.twitter.android')
script = process.create_script(jspayload)
script.load()
sys.stdin.read()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment