Path: blob/master/modules/auxiliary/scanner/ipmi/ipmi_cipher_zero.rb
19591 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Auxiliary::Report7include Msf::Auxiliary::UDPScanner89def initialize10super(11'Name' => 'IPMI 2.0 Cipher Zero Authentication Bypass Scanner',12'Description' => %q|13This module identifies IPMI 2.0-compatible systems that are vulnerable14to an authentication bypass vulnerability through the use of cipher15zero.16|,17'Author' => [ 'Dan Farmer <zen[at]fish2.com>', 'hdm' ],18'License' => MSF_LICENSE,19'References' => [20['CVE', '2013-4782'],21['URL', 'http://fish2.com/ipmi/cipherzero.html'],22['OSVDB', '93038'],23['OSVDB', '93039'],24['OSVDB', '93040'],2526],27'DisclosureDate' => 'Jun 20 2013'28)2930register_options(31[32Opt::RPORT(623)33]34)35end3637def scanner_prescan(batch)38print_status("Sending IPMI requests to #{batch[0]}->#{batch[-1]} (#{batch.length} hosts)")39@res = {}40end4142def scan_host(ip)43console_session_id = Rex::Text.rand_text(4)44scanner_send(45Rex::Proto::IPMI::Utils.create_ipmi_session_open_cipher_zero_request(console_session_id),46ip, datastore['RPORT']47)48end4950def scanner_process(data, shost, sport)51info = Rex::Proto::IPMI::Open_Session_Reply.new.read(data) # rescue nil52return unless info && info.session_payload_type == Rex::Proto::IPMI::PAYLOAD_RMCPPLUSOPEN_REP5354# Ignore duplicate replies55return if @res[shost]5657@res[shost] ||= info5859if info.error_code == 060print_good("#{shost}:#{sport} - IPMI - VULNERABLE: Accepted a session open request for cipher zero")61report_vuln(62:host => shost,63:port => datastore['RPORT'].to_i,64:proto => 'udp',65:sname => 'ipmi',66:name => 'IPMI 2.0 RAKP Cipher Zero Authentication Bypass',67:info => "Accepted a session open request for cipher zero",68:refs => self.references69)70else71vprint_status("#{shost}:#{sport} - IPMI - NOT VULNERABLE: Rejected cipher zero with error code #{info.error_code}")72end73end74end757677