Arista Configuration Importer - Metasploit


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

Module Overview


Name: Arista Configuration Importer
Module: auxiliary/admin/networking/arista_config
Source code: modules/auxiliary/admin/networking/arista_config.rb
Disclosure date: -
Last modification time: 2021-02-16 13:56:50 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: -
Target network port(s): 22
List of CVEs: -

This module imports an Arista 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/arista_config
msf auxiliary(arista_config) > show targets
    ... a list of targets ...
msf auxiliary(arista_config) > set TARGET target-id
msf auxiliary(arista_config) > show options
    ... show and set options ...
msf auxiliary(arista_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 an Arista configuration file into the database. This is similar to post/networking/gather/enum_arista only access isn't required, and assumes you already have the file.

Arista vEOS is available to download for GNS3

Example config file:

! Command: show running-config
! device: aristaveos (vEOS, EOS-4.19.10M)
!
! boot system flash:vEOS-lab.swi
!
transceiver qsfp default-mode 4x10G
!
hostname aristaveos
!
snmp-server community read ro
snmp-server community write rw
!
spanning-tree mode mstp
!
enable secret sha512 $6$jemN09cUdoLRim6i$Mvl2Fog/VZ7ktxyLSVDR1KnTTTPSMHU3WD.G/kxwgODdsc3d7S1aSNJX/DJmQI3nyrYnEw4lsmoKPGClFJ9hH1
aaa root secret sha512 $6$Rnanb2dQsVy2H3QL$DEYDZMy6j6KK4XK62Uh.3U3WXxK5XJvn8Zd5sm36T7BVKHS5EmIcQV.EN1X1P1ZO099S0lkxpvEGzA9yK5PQF.
!
username admin privilege 15 role network-admin secret sha512 $6$Ei2bjrcTCGPOjSkk$7S.XSTZqdRVXILbUUDcRPCxzyfqEFYzg6HfL0BHXvriETX330MT.KObHLkGx7n9XZRVWBr68ZsKfvzvxYCvj61
!
interface Ethernet1
!
interface Ethernet2
!
interface Ethernet3
!
interface Ethernet4
!
interface Ethernet5
!
interface Ethernet6
!
interface Ethernet7
!
interface Ethernet8
!
interface Ethernet9
!
interface Ethernet10
!
interface Ethernet11
!
interface Ethernet12
!
interface Management1
   ip address dhcp
!
no ip routing
!
end

Verification Steps


  1. Have a Arista configuration file
  2. Start msfconsole
  3. use auxiliary/admin/networking/arista_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


resource (arista_config.rb)> use auxiliary/admin/networking/arista_config
resource (arista_config.rb)> set rhost 1.1.1.1
rhost => 1.1.1.1
resource (arista_config.rb)> set config /tmp/veos.config
config => /tmp/veos.config
resource (arista_config.rb)> set verbose true
verbose => true
resource (arista_config.rb)> run
[*] Running module against 1.1.1.1
[*] Importing config
[+] 1.1.1.1:22 Hostname: aristaveos, Device: vEOS, OS: EOS, Version: 4.19.10M
[+] 1.1.1.1:22 Hostname: aristaveos
[+] 1.1.1.1:22 SNMP Community (ro): read
[+] 1.1.1.1:22 SNMP Community (rw): write
[+] 1.1.1.1:22 Enable hash: $6$jemN09cUdoLRim6i$Mvl2Fog/VZ7ktxyLSVDR1KnTTTPSMHU3WD.G/kxwgODdsc3d7S1aSNJX/DJmQI3nyrYnEw4lsmoKPGClFJ9hH1
[+] 1.1.1.1:22 AAA Username 'root' with Hash: $6$Rnanb2dQsVy2H3QL$DEYDZMy6j6KK4XK62Uh.3U3WXxK5XJvn8Zd5sm36T7BVKHS5EmIcQV.EN1X1P1ZO099S0lkxpvEGzA9yK5PQF.
[+] 1.1.1.1:22 Username 'admin' with privilege 15, Role network-admin, and Hash: $6$Ei2bjrcTCGPOjSkk$7S.XSTZqdRVXILbUUDcRPCxzyfqEFYzg6HfL0BHXvriETX330MT.KObHLkGx7n9XZRVWBr68ZsKfvzvxYCvj61
[+] Config import successful
[*] Auxiliary module execution completed

Go back to menu.

Msfconsole Usage


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

msf6 > use auxiliary/admin/networking/arista_config

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

       Name: Arista Configuration Importer
     Module: auxiliary/admin/networking/arista_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 an Arista device configuration.

Module Options


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

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

Module options (auxiliary/admin/networking/arista_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/arista_config auxiliary module:

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

Module advanced options (auxiliary/admin/networking/arista_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/arista_config module can do:

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

Auxiliary actions:

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

Evasion Options


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

msf6 auxiliary(admin/networking/arista_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.

Arista config file <CONFIG> does not exist!


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

28:	    )
29:	  end
30:	
31:	  def run
32:	    unless ::File.exist?(datastore['CONFIG'])
33:	      fail_with Failure::BadConfig, "Arista config file #{datastore['CONFIG']} does not exist!"
34:	    end
35:	    arista_config = ::File.open(datastore['CONFIG'], 'rb')
36:	    print_status('Importing config')
37:	    arista_eos_config_eater(datastore['RHOSTS'], datastore['RPORT'], arista_config.read)
38:	    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.