mirror of
https://github.com/projectdiscovery/nuclei-templates.git
synced 2026-02-02 16:53:25 +08:00
50 lines
1.3 KiB
YAML
50 lines
1.3 KiB
YAML
id: pgsql-list-users
|
|
|
|
info:
|
|
name: PostgreSQL List Users
|
|
author: pussycat0x
|
|
severity: high
|
|
description: |
|
|
List users from Postgresql Database.
|
|
reference:
|
|
- https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/SQL%20Injection/PostgreSQL%20Injection.md#postgresql-list-users
|
|
metadata:
|
|
verified: true
|
|
max-request: 8
|
|
shodan-query: "product:\"PostgreSQL\""
|
|
tags: js,network,postgresql,enum,authenticated
|
|
javascript:
|
|
- pre-condition: |
|
|
isPortOpen(Host,Port);
|
|
code: |
|
|
const postgres = require('nuclei/postgres');
|
|
const client = new postgres.PGClient;
|
|
connected = client.ExecuteQuery(Host, Port, User, Pass, Db, "SELECT usename FROM pg_user");
|
|
Export(connected);
|
|
|
|
args:
|
|
Host: "{{Host}}"
|
|
Port: 5432
|
|
User: "{{usernames}}"
|
|
Pass: "{{password}}"
|
|
Db: "{{database}}"
|
|
|
|
payloads:
|
|
usernames:
|
|
- postgres
|
|
- admin
|
|
password:
|
|
- postgres
|
|
-
|
|
- 123
|
|
- amber
|
|
database:
|
|
- postgres
|
|
|
|
attack: clusterbomb
|
|
|
|
extractors:
|
|
- type: json
|
|
json:
|
|
- '.Rows[].usename'
|
|
# digest: 4a0a00473045022100a8a1a1f5529ad1b42ab00530cb1d0adc6de017d59645fe8ab37518e01bb9b776022005e588a866bb55abc01e3b65d64b9b9063e0a601ad6e0bf152d920c4ccd33d09:922c64590222798bb761d5b6d8e72950 |