MySQL
Sometimes, you may have Nmap results as shown below:
3306/tcp open mysql syn-ack ttl 61 MySQL (unauthorized)This means that we cannot log in to MySQL remotely.
Check if SQL is running or present
There are two ways to determine this: one is by using the Nmap results, and the other is by checking the process list after gaining initial access to the system.
# In linux:
ps auxf
# In windows:
tasklist # CMD
Get-Process # PS
Checking for default credentials:
In Linux, we can run the below command to check:
if command -v mysqladmin &>/dev/null; then echo "MySQL version: $(mysql --version)"; for creds in "root:root" "root:toor" "root:"; do user="${creds%%:*}"; pass="${creds#*:}"; if mysqladmin -u"$user" -p"$pass" version &>/dev/null; then echo " ✓ Default credential works: $creds"; else echo " ✗ No success with: $creds"; fi; done; else echo "MySQL is not installed or not in PATH"; fi
Basic command for MySQL:
HELP:
Last updated
