Created
April 30, 2018 10:52
-
-
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.
This file contains 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('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