pentesting, updated

Database service checks

Check exposed MySQL, MSSQL and PostgreSQL services for default credentials and unauthenticated access.

Goal

Determine whether a database service is reachable from outside its intended network boundary, and whether it accepts default or weak credentials.

How to test

mysql -h 10.10.10.5 -u root                           # try blank/default root password
nmap --script mysql-info,mysql-empty-password -p3306 10.10.10.5
impacket-mssqlclient administrator:Password1@10.10.10.5 -windows-auth  # MSSQL
psql -h 10.10.10.5 -U postgres                          # try default postgres account
hydra -l sa -P rockyou.txt mssql://10.10.10.5             # credential brute force: see [Hydra](/docs/pentest-cheatsheets/tools/exploitation/hydra)

What to look for

Any database reachable with default/blank credentials, or with xp_cmdshell enabled on MSSQL — that is direct OS command execution from a SQL login.

Notes

A database should almost never be directly internet-facing — flag the exposure itself even if credentials turn out to be strong.

References

§ home
~/knubertus/home/
1,1 Top