
This repository includes two PoC scripts for CVE-2025-57819 in FreePBX: one to create a new admin user (poc_admin.py), and another to extract credentials using sqlmap (poc_auto_get_username_pass.py). For educational and authorized use only.
This repository contains two Python Proof-of-Concept (PoC) scripts targeting CVE-2025-57819, a critical unauthenticated SQL injection vulnerability in FreePBX.
CVE-2025-57819 affects multiple versions of FreePBX and allows unauthenticated remote attackers to execute arbitrary SQL queries via a vulnerable parameter in admin/ajax.php.
The flaw exists due to insufficient input sanitization in the module=FreePBX\modules\endpoint\ajax endpoint, which allows direct SQL injection into backend queries.
| File | Description |
|---|---|
poc_admin.py | Creates a new admin user via raw SQL injection |
poc_auto_get_username_pass.py | Automates mass extraction of credentials using sqlmap on multiple targets |
poc_admin.py – Add Admin UserThis script sends a specially crafted SQL query to create a new FreePBX admin user.
requests module (pip install requests)python3 poc_admin.py http://target/
[+] Creating admin user: orange0Mint_k9l3zq / X9sfL30wlKp1
[+] Done. Try logging in at: http://target/admin/config.php
[+] Credentials -> Username: orange0Mint_k9l3zq | Password: X9sfL30wlKp1
poc_auto_get_username_pass.py – Dump Credentials via SQLMapThis script uses sqlmap to extract usernames and password hashes from the vulnerable ampusers table across multiple targets.
sqlmap cloned locally as sqlmap-master/Each line in the file should be a base URL:
http://192.168.1.100/
http://pbx.example.com:8080/
python3 poc_auto_get_username_pass.py targets.txt
log/target.txtstop.txt file--batch and --ignore-code=404 flags in SQLMapAll results from sqlmap will be saved inside the log/ directory, named by the target host:
log/
├── 192.168.1.100.txt
├── pbx.example.com_8080.txt
/admin/ interfaceajax.phpThis PoC is provided for educational and authorized penetration testing purposes only.
Do not use this code against systems you do not own or have explicit permission to test.
The author is not responsible for misuse or damages caused by this script.
orange0Mint
GitHub: https://github.com/orange0Mint
| Version |
|---|
| Status |
|---|
| ≤ 15.0.65 | Vulnerable |
| ≤ 16.0.88 | Vulnerable |
| ≤ 17.0.2 | Vulnerable |
| ≥ 15.0.66 | Patched |
| ≥ 16.0.89 | Patched |
| ≥ 17.0.3 | Patched |