-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
documentation/modules/auxiliary/admin/brocade/brocade_config.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
## General Notes | ||
|
||
This module imports a Brocade configuration file into the database. | ||
This is similar to `post/brocade/gather/enum_brocade` only access isn't required, | ||
and assumes you already have the file. | ||
|
||
Example files for import can be found on git, like [this](https://raw.githubusercontent.com/h00die/MSF-Testing-Scripts/master/brocade_08.0.30hT311_ic_icx6430.conf). | ||
|
||
## Verification Steps | ||
|
||
1. Have a Brocade configuration file | ||
2. Start `msfconsole` | ||
3. `use auxiliary/admin/brocade/brocade_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 | ||
|
||
``` | ||
msf5 > wget https://raw.githubusercontent.com/h00die/MSF-Testing-Scripts/master/brocade_08.0.30hT311_ic_icx6430.conf -o /dev/null -O /tmp/brocade.conf | ||
msf5 > use auxiliary/admin/brocade/brocade_config | ||
msf5 auxiliary(admin/brocade/brocade_config) > set rhosts 127.0.0.1 | ||
rhosts => 127.0.0.1 | ||
msf5 auxiliary(admin/brocade/brocade_config) > set config /tmp/brocade.conf | ||
config => /tmp/brocade.conf | ||
msf5 auxiliary(admin/brocade/brocade_config) > run | ||
[*] Running module against 127.0.0.1 | ||
[*] Importing config | ||
[+] password-display is enabled, hashes will be displayed in config | ||
[+] enable password hash $1$QP3H93Wm$uxYAs2HmAK0lQiP3ig5tm. | ||
[+] User brocade of type 8 found with password hash $1$f/uxhovU$dST5lNskZCPQe/5QijULi0. | ||
[+] ENCRYPTED SNMP community $MlVzZCFAbg== with permissions ro | ||
[+] ENCRYPTED SNMP community $U2kyXj1k with permissions rw | ||
[+] Config import successful | ||
[*] Auxiliary module execution completed | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
## | ||
# This module requires Metasploit: https://metasploit.com/download | ||
# Current source: https://github.com/rapid7/metasploit-framework | ||
## | ||
|
||
require 'msf/core/auxiliary/brocade' | ||
|
||
class MetasploitModule < Msf::Auxiliary | ||
include Msf::Auxiliary::Brocade | ||
def initialize(info={}) | ||
super( update_info( info, | ||
'Name' => 'Brocade Configuration Importer', | ||
'Description' => %q{ | ||
This module imports a Brocade device configuration. | ||
}, | ||
'License' => MSF_LICENSE, | ||
'Author' => [ 'h00die'], | ||
)) | ||
|
||
register_options( | ||
[ | ||
OptPath.new('CONFIG', [true, 'Path to configuration to import']), | ||
Opt::RHOST(), | ||
Opt::RPORT(22) | ||
]) | ||
|
||
end | ||
|
||
def run | ||
unless ::File.exist?(datastore['CONFIG']) | ||
fail_with Failure::BadConfig, "Brocade config file #{datastore['CONFIG']} does not exists!" | ||
end | ||
brocade_config = ::File.open(datastore['CONFIG'], "rb") | ||
print_status('Importing config') | ||
brocade_config_eater(datastore['RHOSTS'],datastore['RPORT'],brocade_config.read) | ||
print_good('Config import successful') | ||
end | ||
end | ||
|
||
|