Skip to content

Instantly share code, notes, and snippets.

@11philip22
Forked from avicoder/list-url.py
Created July 4, 2022 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 11philip22/51633e1efb52a270cb1136658ef7643a to your computer and use it in GitHub Desktop.
Save 11philip22/51633e1efb52a270cb1136658ef7643a 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('Twitter')
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