Cisco Configuration Importer - Metasploit


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

Module Overview


Name: Cisco Configuration Importer
Module: auxiliary/admin/networking/cisco_config
Source code: modules/auxiliary/admin/networking/cisco_config.rb
Disclosure date: -
Last modification time: 2020-09-22 02:56:51 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: -
Target network port(s): 22
List of CVEs: -

This module imports a Cisco IOS or NXOS device configuration.

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

Required Options


  • CONFIG: Path to configuration to import

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

Knowledge Base


Vulnerable Application


General Notes

This module imports a Cisco configuration file into the database. This is similar to post/networking/gather/enum_cisco only access isn't required, and assumes you already have the file.

Example files for import can be found on git, like this or from Cisco.

Verification Steps


  1. Have a Cisco configuration file
  2. Start msfconsole
  3. use auxiliary/admin/networking/cisco_config
  4. set RHOST x.x.x.x
  5. set CONFIG /tmp/file.config
  6. run

Options


RHOST

Needed for setting services and items to. This is relatively arbitrary.

CONFIG

File path to the configuration file.

Scenarios


root@metasploit-dev:~/metasploit-framework# wget https://raw.githubusercontent.com/GaetanLongree/MASI-ProjetAvanceReseau/3cf1d9a93828d5f44ee1bc4e4c01411e416892c5/Los%20Angeles/LA_EDGE_D.txt -O /tmp/LA_EDGE_D.txt -o /dev/null

root@metasploit-dev:~/metasploit-framework# ./msfconsole 

[*] Starting persistent handler(s)...
msf5 > use auxiliary/admin/networking/cisco_config 
msf5 auxiliary(admin/networking/cisco_config) > set config /tmp/LA_EDGE_D.txt
config => /tmp/LA_EDGE_D.txt
msf5 auxiliary(admin/networking/cisco_config) > set rhost 127.0.0.1
rhost => 127.0.0.1
msf5 auxiliary(admin/networking/cisco_config) > run
[*] Running module against 127.0.0.1

[*] Importing config
[+] 127.0.0.1:22 MD5 Encrypted Enable Password: $1$mERr$DWwx4W/5HXD2oail62IeB1
[+] 127.0.0.1:22 Username 'Waldo' with MD5 Encrypted Password: $1$mERr$DWwx4W/5HXD2oail62IeB1
[+] Config import successful
[*] Auxiliary module execution completed

Go back to menu.

Msfconsole Usage


Here is how the admin/networking/cisco_config auxiliary module looks in the msfconsole:

msf6 > use auxiliary/admin/networking/cisco_config

msf6 auxiliary(admin/networking/cisco_config) > show info

       Name: Cisco Configuration Importer
     Module: auxiliary/admin/networking/cisco_config
    License: Metasploit Framework License (BSD)
       Rank: Normal

Provided by:
  h00die

Check supported:
  No

Basic options:
  Name    Current Setting  Required  Description
  ----    ---------------  --------  -----------
  CONFIG                   yes       Path to configuration to import
  RHOSTS                   yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
  RPORT   22               yes       The target port

Description:
  This module imports a Cisco IOS or NXOS device configuration.

Module Options


This is a complete list of options available in the admin/networking/cisco_config auxiliary module:

msf6 auxiliary(admin/networking/cisco_config) > show options

Module options (auxiliary/admin/networking/cisco_config):

   Name    Current Setting  Required  Description
   ----    ---------------  --------  -----------
   CONFIG                   yes       Path to configuration to import
   RHOSTS                   yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
   RPORT   22               yes       The target port

Advanced Options


Here is a complete list of advanced options supported by the admin/networking/cisco_config auxiliary module:

msf6 auxiliary(admin/networking/cisco_config) > show advanced

Module advanced options (auxiliary/admin/networking/cisco_config):

   Name       Current Setting  Required  Description
   ----       ---------------  --------  -----------
   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 admin/networking/cisco_config module can do:

msf6 auxiliary(admin/networking/cisco_config) > show actions

Auxiliary actions:

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

Evasion Options


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

msf6 auxiliary(admin/networking/cisco_config) > show evasion

Module evasion options:

   Name  Current Setting  Required  Description
   ----  ---------------  --------  -----------

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 config file <CONFIG> does not exist!


Here is a relevant code snippet related to the "Cisco config file <CONFIG> does not exist!" error message:

32:	
33:	  end
34:	
35:	  def run
36:	    unless ::File.exist?(datastore['CONFIG'])
37:	      fail_with Failure::BadConfig, "Cisco config file #{datastore['CONFIG']} does not exist!"
38:	    end
39:	    cisco_config = ::File.open(datastore['CONFIG'], 'rb')
40:	    print_status('Importing config')
41:	    cisco_ios_config_eater(datastore['RHOSTS'], datastore['RPORT'], cisco_config.read)
42:	    print_good('Config import successful')

Go back to menu.


Go back to menu.

See Also


Check also the following modules related to this module:

Authors


  • h00die

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.