2022-12-27 14:07:25 +00:00
|
|
|
id: pgsql-detect
|
|
|
|
|
|
|
|
info:
|
|
|
|
name: Postgresql Detection
|
|
|
|
author: nybble04
|
|
|
|
severity: info
|
|
|
|
description: |
|
2022-12-27 17:09:21 +00:00
|
|
|
PostgreSQL, also known as Postgres, is a free and open-source relational database management system emphasizing extensibility and SQL compliance.
|
2022-12-29 15:01:56 +00:00
|
|
|
reference:
|
|
|
|
- https://www.postgresql.org/docs/current/errcodes-appendix.html
|
|
|
|
- https://www.postgresql.org/docs/current/client-authentication-problems.html
|
2023-01-04 07:25:04 +00:00
|
|
|
metadata:
|
|
|
|
verified: true
|
|
|
|
shodan-query: port:5432 product:"PostgreSQL"
|
2022-12-27 14:07:25 +00:00
|
|
|
tags: network,postgresql,db
|
|
|
|
|
|
|
|
network:
|
|
|
|
- inputs:
|
|
|
|
- data: "000000500003000075736572006e75636c6569006461746162617365006e75636c6569006170706c69636174696f6e5f6e616d65007073716c00636c69656e745f656e636f64696e6700555446380000"
|
|
|
|
type: hex
|
|
|
|
- data: "7000000036534352414d2d5348412d32353600000000206e2c2c6e3d2c723d000000000000000000000000000000000000000000000000"
|
|
|
|
type: hex
|
|
|
|
|
|
|
|
host:
|
|
|
|
- "{{Hostname}}"
|
|
|
|
- "{{Host}}:5432"
|
|
|
|
read-size: 2048
|
|
|
|
|
|
|
|
matchers:
|
|
|
|
- type: word
|
|
|
|
part: body
|
|
|
|
words:
|
2022-12-30 10:21:06 +00:00
|
|
|
- "28000" # Error code for invalid_authorization_specification
|
|
|
|
- "28P01" # Error code for invalid_password
|
|
|
|
- "SCRAM-SHA-256" # Authentication prompt
|
|
|
|
- "pg_hba.conf" # Client authentication config file
|
|
|
|
- "user \"nuclei\"" # The user nuclei (sent in request) doesn't exist
|
|
|
|
- "database \"nuclei\"" # The db nuclei (sent in request) doesn't exist"
|
2022-12-30 10:13:22 +00:00
|
|
|
condition: or
|