Frida Tutorial 2
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://11x256.github.io/Frida-hooking-android-part-2/ (Parts 2, 3 & 4) APKs and Source code: https://github.com/11x256/frida-android-examples
The part 1 is so easy.
Some parts of the original code doesn't work and have been modified here.
Part 2
Here you can see an example of how to hook 2 functions with the same name but different parameters. Also, you are going to learn how to call a function with your own parameters. And finally, there is an example of how to find an instance of a class and make it call a function.
You can see that to create a String first is has referenced the class java.lang.String and then it has created a $new object of that class with a String as content. This is the correct way to create a new object of a class. But, in this case, you could just pass to this.fun() any String like: this.fun("hey there!")
Python
Part 3
Python
Now you are going to see how to send commands to the hooked app via Python to call function:
The command "1" will exit, the command "2" will find and instance of the class and call the private function secret() and command "3" will hook the function secret() so it return a different string.
The, if you call "2" you will get the real secret, but if you call "3" and then "2" you will get the fake secret.
JS
Part 4
Here you will see how to make Python and JS interact using JSONs objects. JS use the send() function to send data to the python cliente, and Python uses post() functions to send data to ths JS script. The JS will block the execution until is receives s response from Python.
Python
JS
There is a part 5 that I am not going to explain because there isn't anything new. But if you want to read it is here: https://11x256.github.io/Frida-hooking-android-part-5/

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)
Last updated