2013-06-30 07:35:37 +00:00
|
|
|
##
|
2013-10-15 18:50:46 +00:00
|
|
|
# This module requires Metasploit: http//metasploit.com/download
|
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2013-06-30 07:35:37 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
require 'rex/proto/ipmi'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Auxiliary
|
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
include Msf::Auxiliary::Report
|
|
|
|
include Msf::Auxiliary::UDPScanner
|
2013-06-30 07:35:37 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def initialize
|
|
|
|
super(
|
|
|
|
'Name' => 'IPMI 2.0 RAKP Cipher Zero Authentication Bypass Scanner',
|
|
|
|
'Description' => %q|
|
|
|
|
This module identifies IPMI 2.0 compatible systems that are vulnerable
|
|
|
|
to an authentication bypass vulnerability through the use of cipher
|
|
|
|
zero.
|
|
|
|
|,
|
|
|
|
'Author' => [ 'Dan Farmer <zen[at]fish2.com>', 'hdm' ],
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
['URL', 'http://fish2.com/ipmi/cipherzero.html'],
|
|
|
|
['OSVDB', '93038'],
|
|
|
|
['OSVDB', '93039'],
|
|
|
|
['OSVDB', '93040'],
|
2013-06-30 07:35:37 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
],
|
|
|
|
'DisclosureDate' => 'Jun 20 2013'
|
|
|
|
)
|
2013-06-30 07:35:37 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
Opt::RPORT(623)
|
|
|
|
], self.class)
|
2013-06-30 07:35:37 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
end
|
2013-06-30 07:35:37 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def scanner_prescan(batch)
|
|
|
|
print_status("Sending IPMI requests to #{batch[0]}->#{batch[-1]} (#{batch.length} hosts)")
|
|
|
|
@res = {}
|
|
|
|
end
|
2013-06-30 07:35:37 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def scan_host(ip)
|
|
|
|
console_session_id = Rex::Text.rand_text(4)
|
|
|
|
scanner_send(
|
|
|
|
Rex::Proto::IPMI::Utils.create_ipmi_session_open_cipher_zero_request(console_session_id),
|
|
|
|
ip, datastore['RPORT']
|
|
|
|
)
|
|
|
|
end
|
2013-06-30 07:35:37 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def scanner_process(data, shost, sport)
|
|
|
|
info = Rex::Proto::IPMI::Open_Session_Reply.new(data) rescue nil
|
|
|
|
return if not info
|
|
|
|
return if not info.session_payload_type == Rex::Proto::IPMI::PAYLOAD_RMCPPLUSOPEN_REP
|
2013-06-30 07:35:37 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
# Ignore duplicate replies
|
|
|
|
return if @res[shost]
|
2013-06-30 19:36:51 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
@res[shost] ||= info
|
2013-06-30 19:36:51 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
if info.error_code == 0
|
|
|
|
print_good("#{shost}:#{sport} - IPMI - VULNERABLE: Accepted a session open request for cipher zero")
|
|
|
|
report_vuln(
|
|
|
|
:host => shost,
|
|
|
|
:port => datastore['RPORT'].to_i,
|
|
|
|
:proto => 'udp',
|
|
|
|
:sname => 'ipmi',
|
|
|
|
:name => 'IPMI 2.0 RAKP Cipher Zero Authentication Bypass',
|
|
|
|
:info => "Accepted a session open request for cipher zero",
|
|
|
|
:refs => self.references
|
|
|
|
)
|
|
|
|
else
|
|
|
|
vprint_status("#{shost}:#{sport} - IPMI - NOT VULNERABLE: Rejected cipher zero with error code #{info.error_code}")
|
|
|
|
end
|
|
|
|
end
|
2013-06-30 07:35:37 +00:00
|
|
|
end
|