🚀Missile Diversion
Location - Space Island: Zenith SGS
Objective
Reaim the missile so that it flies into the Sun.
Solution
SQL Injection
The first thing we need to do is similar to Camera Access: Turn on the missile app. After we do this, we can see that there is a debug action that we can use. With some testing on the action (we see that it returns the MariaDB version), we find that we can inject SQL into the application by ending the previous query with a ";" and then adding our own.
We can check our permissions for various tables by submitting the query "; show grants" within the debug action.

So, we know that there are the following target tables: pointing_mode, pointing_mode_to_str, and satellite_query. We can further enumerate the database tables by using the SQL injection vulnerability. A goal of changing the pointing mode to 1 in the pointing_mode table is identified by referencing it with the pointing_mode_to_str table. When we select * from satellite_query, we see what appears to be a serialized Java object and the source code for this File Folder Utility.
Coffee & Cereal (Java Serialized Objects)
From the source code, we can see that this utility uses a serialized Java object that contains a string, and two Boolean properties. Reading through the code, and thinking about our context, we can identify a goal of trying to reach the conditional statement that allows us to update values in the database. Our objective here is to point the missile at the Sun instead of Earth. So, we can plan to update the value for id=1 in the pointing_mode table to 1.
In order to do this, we need to understand what input this utility expects. We need a serialized object that contains our UPDATE SQL query, and two Boolean value properties that equal true. I am not as familiar with Java, so I used ChatGPT to assist in code generation for this payload. I used the query: "how can I create a serialized java object that as input for the following code will trigger the isUpdate conditional to update MySQL database?" I received the following code, which upon review appeared to make sense for this situation. HOWEVER, the original code ChatGPT gave me had isQuery set to false. This is incorrect; we need to set both the boolean values to true.
First, we need to compile the SatelliteQueryFileFolderUtility class. I needed to grab the gson library to do so. Then, compile the SerializeObject code provided by ChatGPT. This produces a serialized Java object named "serializedObject.ser". To send our payload to the application, we convert it to hex and remove new lines.
Once we have our payload, we can construct the necessary SQL statement to get it into the DB for deserialization. Our user has insert ability into the satellite_query table, which is useful for this:

And that's it! Yay, you saved Earth!
Last updated