CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/auxiliary/admin/networking/cisco_config.rb
Views: 11655
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
7
class MetasploitModule < Msf::Auxiliary
8
include Msf::Auxiliary::Cisco
9
include Msf::Exploit::Deprecated
10
moved_from 'auxiliary/admin/cisco/cisco_config'
11
12
def initialize(info = {})
13
super(
14
update_info(
15
info,
16
'Name' => 'Cisco Configuration Importer',
17
'Description' => %q{
18
This module imports a Cisco IOS or NXOS device configuration.
19
},
20
'License' => MSF_LICENSE,
21
'Author' => ['h00die']
22
)
23
)
24
25
register_options(
26
[
27
OptPath.new('CONFIG', [true, 'Path to configuration to import']),
28
Opt::RHOST(),
29
Opt::RPORT(22)
30
]
31
)
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')
43
end
44
end
45
46