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:
Grants showing GRANT ALL PRIVILEGES ON *.* ... WITH GRANT OPTION confirm full administrative access. The presence of FILE in the grant list enables file read and write outside the database. The presence of SUPER or SYSTEM_VARIABLES_ADMIN enables server configuration changes. Each of these maps to a specific exploitation path.
References
-
Nmap NSE — mysql-empty-passwordnmap.org/nsedoc/scripts/mysql-empty-password.html (opens in new tab)
Checks root and anonymous accounts for empty password access
-
MySQL — Default privilegesdev.mysql.com/doc/refman/8.0/en/default-privileges.html (opens in new tab)
Default account configuration and post-install hardening reference
Was this helpful?
Your feedback helps improve this page.