Port 5432 – PostgreSQL

Service:

postgres

Protocol:

TCP

Port:

5432

Used for:

PostgreSQL database access

Why It’s Open

Popular SQL database for modern web stacks, analytics tools, and custom apps.

Common Risks

  • Exposed Without Auth
  • Brute Force or Credential Stuffing
  • Command Execution via Extensions (if unprotected)

Want to save time on reporting?

Let PentestPad generate, track, and export your reports - automatically.

logo-cta

Enumeration & Testing

Check if open

Terminal window
nmap -p 5432 -sV

Testing

Terminal window
psql -h -U -c "\l"
psql -h -U -c "\dt"
psql -h -U -c "SELECT * FROM pg_user;"

What to Look For

CheckpointWhat it means
Remote access allowedShould be internal-only
Passwords stored in plain configMajor risk

Known Exploits

  1. CVE-2018-1058 PostgreSQL before 10.3 allows remote attackers to execute arbitrary SQL commands via a crafted request.

🔗 NVD Entry

  1. CVE-2017-7546 PostgreSQL before 9.6.4 allows remote attackers to execute arbitrary SQL commands via a crafted request.

🔗 NVD Entry

Mitigation

  • Use pg_hba.conf to limit access.
  • Set strong passwords.
  • Use SSL for remote connections.
  • Monitor login attempts.

TL;DR

  • Service: PostgreSQL (Relational database)
  • Default Port: 5432
  • Risks: SQL injection, unauthorized access
  • Mitigation: Enforce strong authentication, restrict access, keep software updated