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/f5_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
class MetasploitModule < Msf::Auxiliary
7
include Msf::Auxiliary::F5
8
9
def initialize(info = {})
10
super(
11
update_info(
12
info,
13
'Name' => 'F5 Configuration Importer',
14
'Description' => %q{
15
This module imports an F5 device configuration.
16
},
17
'License' => MSF_LICENSE,
18
'Author' => ['h00die'],
19
'Notes' => {
20
'Stability' => [],
21
'SideEffects' => [],
22
'Reliability' => []
23
}
24
)
25
)
26
27
register_options(
28
[
29
OptPath.new('CONFIG', [true, 'Path to configuration to import']),
30
Opt::RHOST(),
31
Opt::RPORT(22)
32
]
33
)
34
end
35
36
def run
37
unless ::File.exist?(datastore['CONFIG'])
38
fail_with Failure::BadConfig, "F5 config file #{datastore['CONFIG']} does not exist!"
39
end
40
f5_config = ::File.open(datastore['CONFIG'], 'rb')
41
print_status('Importing config')
42
f5_config_eater(datastore['RHOSTS'], datastore['RPORT'], f5_config.read)
43
print_good('Config import successful')
44
end
45
end
46
47