-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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