Path: blob/master/modules/auxiliary/admin/networking/vyos_config.rb
19567 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Auxiliary::VYOS78def initialize(info = {})9super(10update_info(11info,12'Name' => 'VyOS Configuration Importer',13'Description' => %q{14This module imports a VyOS device configuration.15},16'License' => MSF_LICENSE,17'Author' => [ 'h00die' ],18'Notes' => {19'Stability' => [CRASH_SAFE],20'SideEffects' => [],21'Reliability' => []22}23)24)2526register_options(27[28OptPath.new('CONFIG', [true, 'Path to configuration to import']),29Opt::RHOST(),30Opt::RPORT(22)31]32)33end3435def run36unless ::File.exist?(datastore['CONFIG'])37fail_with Failure::BadConfig, "VyOS config file #{datastore['CONFIG']} does not exist!"38end39vyos_config = ::File.open(datastore['CONFIG'], 'rb')40print_status('Importing config')41vyos_config_eater(datastore['RHOSTS'], datastore['RPORT'], vyos_config.read)42print_good('Config import successful')43end44end454647