FortiGuard Labs discovered a Base64-encoded PHP web shell named EncystPHP deployed by exploiting FreePBX Endpoint Manager vulnerability CVE-2025-64328, enabling remote command execution, persistence, and telephony abuse. The campaign, attributed to INJ3CTOR3, delivered droppers from 45[.]234[.]176[.]202 (crm[.]razatelefonia[.]pro), created a root-level user and SSH backdoor, and maintained persistence via cron jobs and widespread web shell copies. #EncystPHP #FreePBX
Keypoints
- FortiGuard Labs identified a PHP web shell named EncystPHP that was deployed via exploitation of FreePBX Endpoint Manager CVE-2025-64328.
- Initial exploitation originated from infrastructure resolving to crm[.]razatelefonia[.]pro (45[.]234[.]176[.]202), which delivered droppers named c and k.php that decoded Base64 payloads.
- EncystPHP modifies file permissions, removes competing web shells and logs, deletes FreePBX users/modules, and forges timestamps to hinder detection.
- The actor established persistent control by creating a root-level account (newfpbx), injecting an SSH public key, resetting passwords, and installing multiple cron jobs and license/test scripts.
- The web shell masquerades as legitimate FreePBX files (e.g., ajax.php) and exposes an âAsk Masterâ interface enabling arbitrary command execution and PBX/Asterisk operations.
- Fortinet detections and protections (AV signatures, IPS, Web Filtering, IP reputation) are available for the IOCs and exploit CVE-2025-64328; impacted systems should be treated as fully compromised.
MITRE Techniques
- [T1190 ] Exploit Public-Facing Application â Exploitation of FreePBX Endpoint Manager via CVE-2025-64328 to execute post-authentication command injection (âExploitation of FreePBX Endpoint Manager via CVE-2025-64328 to execute post-authentication command injectionâ).
- [T1059.004 ] Command and Scripting Interpreter: Unix Shell â Execution of bash commands via injected payloads and downloaded shell scripts (âExecution of Bash commands via injected payloads and downloaded shell scriptsâ).
- [T1053.003 ] Scheduled Task/Job: Cron â Multiple crontab entries installed to repeatedly download and execute droppers to maintain persistence (âMultiple crontab entries installed to repeatedly download and execute droppersâ).
- [T1505.003 ] Server Software Component: Web Shell â Deployment of EncystPHP masquerading as legitimate FreePBX PHP files (ajax.php, config.php) to provide remote access (âDeployment of EncystPHP masquerading as legitimate FreePBX PHP files (ajax.php, config.php)â).
- [T1068 ] Exploitation for Privilege Escalation â Abuse of FreePBX administrative context to execute commands with elevated privileges (âAbuse of FreePBX administrative context to execute commands with elevated privilegesâ).
- [T1136.001 ] Create Account: Local Account â Creation of a root-level user account newfpbx with UID 0 to maintain access (âCreation of a root-level user account (newfpbx) with UID 0â).
- [T1003 ] OS Credential Dumping â Collection of database credentials from /etc/freepbx.conf to harvest sensitive credentials (âCollection of database credentials from /etc/freepbx.confâ).
- [T1070.004 ] Indicator Removal on Host: File Deletion â Deletion of logs, cron artifacts, and the FreePBX Endpoint Manager module to erase traces (âDeletion of logs, cron artifacts, and FreePBX Endpoint Manager moduleâ).
- [T1222.002 ] File and Directory Permissions Modification: Linux â Modification of file permissions to 000 on ajax.php and model.php to block inspection (âModification of file permissions to 000 to block access and disrupt inspectionâ).
- [T1036.005 ] Masquerading: Match Legitimate Name or Location â Web shell written to legitimate FreePBX paths with forged timestamps to blend in (âWeb shell written to legitimate FreePBX file paths with forged timestampsâ).
- [T1562.001 ] Impair Defenses: Disable or Modify Tools â Removal of competing web shells and disabling error reporting to hinder detection (âRemoval of competing web shells and disabling error reportingâ).
- [T1021.004 ] Remote Services: SSH â Injection of attacker-controlled SSH public key and ensuring port 22 remains open for remote access (âInjection of attacker-controlled SSH public key and forced exposure of port 22â).
- [T1105 ] Ingress Tool Transfer â Repeated download of droppers (c, k.php) from attacker-controlled infrastructure to transfer tools (âRepeated download of droppers (c, k.php) from attacker-controlled infrastructureâ).
- [T1071.001 ] Application Layer Protocol: Web Protocols â Use of HTTP for payload delivery and command execution to communicate with C2 infrastructure (âUse of HTTP for payload delivery and command executionâ).
- [T1496 ] Resource Hijacking â Abuse of PBX resources for unauthorized telephony operations and outbound call activity (âAbuse of PBX resources for unauthorized telephony operationsâ).
Indicators of Compromise
- [URLs ] download/dropper locations â hxxp://45[.]234[.]176[.]202/new/k.php, hxxp://45[.]234[.]176[.]202/new/ch
- [Hosts / IPs ] attacker infrastructure and observed sources â 45[.]234[.]176[.]202, 187[.]108[.]1[.]130
- [Domains ] C2 / dropper domain â crm[.]razatelefonia[.]pro (resolves to 45[.]234[.]176[.]202)
- [Files / filenames ] dropped web shells and scripts â c (dropper), k.php (dropper), ajax.php (deployed web shell), and test.sh, license.php
- [File hashes ] malware binaries/samples â 71d94479d58c32d56âŚb26b8c7 (long concatenated hash provided in report) and other sample hashes
- [Accounts ] created or modified system accounts â newfpbx (root-level account created), modified users such as ampuser and svc_freepbx