MySQL / MariaDB
MySQLMariaDBMySQUL
MySQL and MariaDB are popular open-source relational databases. Default credentials, weak root passwords, and unauthenticated access are common issues.
Ports
| Port | Protocol | Description |
|---|---|---|
| 3306 | tcp | MySQL/MariaDB |
Fingerprints
| Banner / Probe | Expected Response |
|---|---|
nmap -sV -p <port> <target> | Service banner and version info |
nc -nv <target> <port> | Raw banner grab |
Key Files
| Path | Description |
|---|---|
/etc/mysql/mysql.cnf | MySQL client configuration |
/var/lib/mysql/mysql/user.MYD | MySQL user table data |
postgresql.conf | PostgreSQL configuration file |
pg_hba.conf | PostgreSQL client authentication rules |
mongod.conf | MongoDB daemon configuration |
Default Credentials
| Username | Password | Context |
|---|---|---|
root | (empty) | Local MySQL root |
root | root | Common default root |
Known CVEs
| Identifier | Type | Description |
|---|---|---|
— | Auth | Weak root password / default root creds |
Exploitation Primitives
| Technique | Tool / Command | Result |
|---|---|---|
| MySQL Root | mysql -h <target> -u root -p | Connect to MySQL |
| Hash Dump | mysql -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