TryHackMe - using enumeration to discover usernames/passwords in a MySQL database
Date: 6/14/2024
Default info:
- Name: polomysql
- IP: 10.10.37.41
- credentials: “root:password”
mysqlis using port 3306/tcp
- tested known credentials: success
- performed a search for mysql modules, needed to find
mysql_sql
- loaded module and listed options
setnecessary options thenrun- discovery
- version =
5.7.29-0ubuntu0.18.04.1
- version =
setsql to “show databases” instead of “select version()”, thenrun- discovery
- there are 4 databases
- searched for “mysql_schemadump” to print out a list of tables and checked options
- after setting options (same as version discovery module), then
run - A bunch of table names print out, along with column information
usenew module for dumping hashes (possibly for passwords?), and go throughoptions
setoptions, same as for other modules
- successful hash dump
- discovery
- another user: Carl
echotheusername:hashinto a text file and check the file to validate- could also open
nanoand paste hash, then exit and save as txt file
exitMetasploit and run John the Ripper against the txt file- discovery
- password = doggie
- let’s try the user and pass on ssh
sshonto the target IP using Carl username and password- read MySQL.txt in default folder to find the flag