Objection Tutorial
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!
Introduction
objection - Runtime Mobile Exploration
Objection is a runtime mobile exploration toolkit, powered by Frida. It was built with the aim of helping assess mobile applications and their security posture without the need for a jailbroken or rooted mobile device.
Note: This is not some form of jailbreak / root bypass. By using objection
, you are still limited by all of the restrictions imposed by the applicable sandbox you are facing.
Resume
The goal of objection is let the user call the main actions that offers Frida. Otherwise, the user will need to create a single script for every application that he wants to test.
Tutorial
For this tutorial I am going to use the APK that you can download here:
Or from its original repository (download app-release.apk)
Installation
Connection
Make a regular ADB conection and start the frida server in the device (and check that frida is working in both the client and the server).
If you are using a rooted device it is needed to select the application that you want to test inside the --gadget option. in this case:
Basic Actions
Not all possible commands of objections are going to be listed in this tutorial, only the ones that I have found more useful.
Environment
Some interesting information (like passwords or paths) could be find inside the environment.
Frida Information
Upload/Download
Import frida script
SSLPinning
Root detection
Exec Command
Screenshots
Static analysis made Dynamic
In a real application we should know all of the information discovered in this part before using objection thanks to static analysis. Anyway, this way maybe you can see something new as here you will only have a complete list of classes, methods and exported objects.
This is also usefull if somehow you are unable to get some readable source code of the app.
List activities, receivers and services
Frida will launch an error if none is found
Getting current activity
Search Classes
Lets start looking for classes inside our application
Search Methods of a class
Now lets extract the methods inside the class MainActivity:
List declared Methods of a class with their parameters
Lets figure out wich parameters does the methods of the class need:
List classes
You could also list all the classes that were loaded inside the current applicatoin:
This is very useful if you want to hook the method of a class and you only know the name of the class. You coul use this function to search which module owns the class and then hook its method.
Hooking being easy
Hooking (watching) a method
From the source code of the application we know that the function sum() from MainActivity is being run every second. Lets try to dump all possible information each time the function is called (arguments, return value and backtrace):
Hooking (watching) an entire class
Actually I find all the methods of the class MainActivity really interesting, lets hook them all. Be careful, this could crash an application.
If you play with the application while the class is hooked you will see when each function is being called, its arguments and the return value.
Changing boolean return value of a function
From the source code you can see that the function checkPin gets a String as argument and returns a boolean. Lets make the function always return true:
Now, If you write anything in the text box for the PIN code you will see tat anything is valid:
Class instances
Search for and print live instances of a specific Java class, specified by a fully qualified class name. Out is the result of an attempt at getting a string value for a discovered objection which would typically contain property values for the object.
Keystore/Intents
You can play with the keystore and intents using:
Memory
Dump
List
At the bottom os the list you can see frida:
Lets checks what is frida exporting:
Search/Write
You can alse search and write inside memory with objection:
SQLite
You cals can use the command sqlite
to interact with sqlite databases.
Exit
What I miss in Objection
The hooking methods sometimes crashes the application (this is also because of Frida).
You can't use the instaces of the classes to call functions of the instance. And you can't create new instances of classes and use them to call functions.
There isn't a shortcut (like the one for sslpinnin) to hook all the common crypto methods being used by the application to see cyphered text, plain text, keys, IVs and algorithms used.
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