PostgreSQL Weak and Default Credential Check
PostgreSQL installations frequently ship with the default postgres superuser account and a weak or empty password. Application deployments often use predictable credentials for their database accounts. Checking these before running a full brute-force is faster and quieter. A single valid credential against the superuser account gives full database access and typically leads directly to OS command execution through COPY FROM PROGRAM.
Test Default postgres Credentials
Test the most common default credential pairs manually before automating:
postgres:postgres: VALID
Confirm Privilege Level After a Hit
Once valid credentials are found, confirm the role attributes before proceeding to exploitation:
A superuser account proceeds directly to COPY FROM PROGRAM exploitation. A non-superuser account with CREATEROLE may be escalatable. See the privilege detection page for the full picture before choosing an exploitation path.
References
-
PostgreSQL — Password authenticationwww.postgresql.org/docs/current/auth-password.html (opens in new tab)
Password authentication methods and PGPASSWORD environment variable reference
-
NetExec documentationwww.netexec.wiki (opens in new tab)
PostgreSQL protocol usage and Pwn3d superuser detection reference
Was this helpful?
Your feedback helps improve this page.