Skip to content

Instantly share code, notes, and snippets.

@avicoder
Created April 30, 2018 10:52
Show Gist options
  • Save avicoder/0c694e80e27474a3ab04866deda70241 to your computer and use it in GitHub Desktop.
Save avicoder/0c694e80e27474a3ab04866deda70241 to your computer and use it in GitHub Desktop.
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