Frida Tutorial 1
Last updated
Last updated
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE) Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
Bug bounty tip: sign up for Intigriti, a premium bug bounty platform created by hackers, for hackers! Join us at https://go.intigriti.com/hacktricks today, and start earning bounties up to $100,000!
This is a summary of the post: https://medium.com/infosec-adventures/introduction-to-frida-5a3f51595ca1 APK: https://github.com/t0thkr1s/frida-demo/releases Source Code: https://github.com/t0thkr1s/frida-demo
Frida allows you to insert JavaScript code inside functions of a running application. But you can use python to call the hooks and even to interact with the hooks.
This is a easy python script that you can use with all the proposed examples in this tutorial:
Call the script:
It is useful to know how to use python with frida, but for this examples you could also call directly Frida using command line frida tools:
Here you can see how to hook a boolean method (checkPin) from the class: infosecadventures.fridademo.utils.PinUtil
Mirar: La funcion recibe como parametro un String, no hace falta overload?
If you want to call a non-static function of a class, you first need a instance of that class. Then, you can use that instance to call the function. To do so, you could find and existing instance and use it:
In this case this is not working as there isn't any instance and the function is Static
If the function is static, you could just call it:
You could hook a function and make it print the value of the passed arguments and the value of the return value:
In this tutorial you have hooked methods using the name of the mathod and .implementation. But if there were more than one method with the same name, you will need to specify the method that you want to hook indicating the type of the arguments.
You can see that in the next tutorial.
Bug bounty tip: sign up for Intigriti, a premium bug bounty platform created by hackers, for hackers! Join us at https://go.intigriti.com/hacktricks today, and start earning bounties up to $100,000!
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE) Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)