MySQL Anonymous and Default Credential Check
MySQL ships with an anonymous user account and a root account with no password in many default installations. On older distributions and appliances these accounts are never hardened before deployment. Confirming unauthenticated or default access is the first check before attempting any credential attack: if the database is already open, there is no need to brute-force anything. The privilege level of the anonymous or default account determines what is immediately exploitable.
Test Anonymous Access
Attempt a connection with no username or password:
Welcome to the MariaDB monitor. Server version: 8.0.32 MySQL Community Server
A successful connection without credentials is an immediate critical finding. Check what the anonymous account can access:
Test Root with No Password
Root with no password on a network-exposed instance is a critical misconfiguration. It gives full control over every database, user account, and server variable. If FILE privilege is also present this extends to arbitrary file read and write on the host filesystem.
Confirm with Nmap NSE
The mysql-empty-password script checks both root and anonymous accounts in a single run:
PORT STATE SERVICE 3306/tcp open mysql | mysql-empty-password: |_ root account has empty password
Test Common Default Credentials
Beyond root with no password, check vendor and application default credentials that are commonly deployed with MySQL:
Determine Privilege Level of the Account
Once any valid login is confirmed, check the effective privilege level before proceeding to exploitation:
Privilege indicators and what they enable:
GRANT ALL PRIVILEGES ON *.* ... WITH GRANT OPTIONconfirms full administrative accessFILEenables file read and write outside the databaseSUPERorSYSTEM_VARIABLES_ADMINenables server configuration changesCREATE ROUTINEenables UDF loading for OS command execution
References
-
Nmap NSE: mysql-empty-passwordTOOL: Nmap NSE: mysql-empty-password, nmap.org/nsedoc/scripts/mysql-empty-password.html (opens in new tab)
Checks root and anonymous accounts for empty password access
-
MySQL: Default privilegesDOCS: MySQL: Default privileges, dev.mysql.com/doc/refman/8.0/en/default-privileges.html (opens in new tab)
Default account configuration and post-install hardening reference