Back to services
database3306/tcp

MySQL / MariaDB

MySQLMariaDBMySQUL

MySQL and MariaDB are popular open-source relational databases. Default credentials, weak root passwords, and unauthenticated access are common issues.

Ports

PortProtocolDescription
3306tcpMySQL/MariaDB

Fingerprints

Banner / ProbeExpected Response
nmap -sV -p <port> <target>Service banner and version info
nc -nv <target> <port>Raw banner grab

Key Files

PathDescription
/etc/mysql/mysql.cnfMySQL client configuration
/var/lib/mysql/mysql/user.MYDMySQL user table data
postgresql.confPostgreSQL configuration file
pg_hba.confPostgreSQL client authentication rules
mongod.confMongoDB daemon configuration

Default Credentials

UsernamePasswordContext
root(empty)Local MySQL root
rootrootCommon default root

Known CVEs

IdentifierTypeDescription
AuthWeak root password / default root creds

Exploitation Primitives

TechniqueTool / CommandResult
MySQL Rootmysql -h <target> -u root -pConnect to MySQL
Hash Dumpmysql -h <target> -u root -e "SELECT user, authentication_string FROM mysql.user"Dump user hashes

Notes

MySQL defaults to `root` with no password on many internal setups.

Use `--local-infile` to read server-side files with `LOAD DATA LOCAL INFILE`.

Tools: `mysql` client, `sqlmap`, `nmap mysql-*` NSE scripts.

Seen on

ShodanCensysFOFAZoomEye

References