Privileges
We first need to find out about our user privilege within the database.
DB User
Use following queries to find out about the current DB user:
injection payload should look like this:
Or
User Privilege
Now that we know our user, we can start looking for what privilege we have.
To test for super admin privilege:
Injection payload should look like this:
To see privilege for certain user:
We can also dump other privilege we have directly from the schema as such:
Again, we can search for specific user as such:
If we see FILE
privilege listed for our user, we can proceed with attempting to read files.
LOAD_FILE
LOAD_FILE()
function can be used in MariaDB/MySQL to read data from files.
It works as such:
We can use it in UNION
injection like below: