Frida Tutorial
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Learn & practice GCP Hacking:
HackTricks Training GCP Red Team Expert (GRTE)
![](https://book.hacktricks.xyz/~gitbook/image?url=https%3A%2F%2F129538173-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-L_2uGJGU7AVNRcqRvEi%252Fuploads%252FxPgCk5aqprlPiuVKTjpW%252Fi3.png%3Falt%3Dmedia%26token%3D367baaa6-abad-4395-ab1e-9791e708ccb6&width=768&dpr=4&quality=100&sign=51f01c35&sv=1)
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!
Installation
Install frida tools:
Download and install in the android the frida server (Download the latest release). One-liner to restart adb in root mode, connect to it, upload frida-server, give exec permissions and run it in backgroud:
Check if it is working:
Tutorials
From: 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
Follow the link to read it.
From: https://11x256.github.io/Frida-hooking-android-part-2/ (Parts 2, 3 & 4) APKs and Source code: https://github.com/11x256/frida-android-examples
Follow the link to read it.
From: https://joshspicer.com/android-frida-1 APK: https://github.com/OWASP/owasp-mstg/blob/master/Crackmes/Android/Level_01/UnCrackable-Level1.apk
Follow the link to read it.
You can find more Awesome Frida scripts here: https://codeshare.frida.re/
Quick Examples
Calling Frida from command line
Basic Python Script
Hooking functions without parameters
Hook the function a()
of the class sg.vantagepoint.a.c
Hook java exit()
Hook MainActivity .onStart()
& .onCreate()
Hook android .onCreate()
Hooking functions with parameters and retrieving the value
Hooking a decryption function. Print the input, call the original function decrypt the input and finally, print the plain data:
Hooking functions and calling them with our input
Hook a function that receives a string and call it with other string (from here)
Getting an already created object of a class
If you want to extract some attribute of a created object you can use this.
In this example you are going to see how to get the object of the class my_activity and how to call the function .secret() that will print a private attribute of the object:
Other Frida tutorials
![](https://book.hacktricks.xyz/~gitbook/image?url=https%3A%2F%2F129538173-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-L_2uGJGU7AVNRcqRvEi%252Fuploads%252FxPgCk5aqprlPiuVKTjpW%252Fi3.png%3Falt%3Dmedia%26token%3D367baaa6-abad-4395-ab1e-9791e708ccb6&width=768&dpr=4&quality=100&sign=51f01c35&sv=1)
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