## # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## class MetasploitModule < Msf::Auxiliary # Exploit mixins should be called first include Msf::Exploit::Remote::HttpClient include Msf::Auxiliary::WmapScanServer # Scanner mixin should be near last include Msf::Auxiliary::Scanner include Msf::Auxiliary::Report def initialize super( 'Name' => 'HTTP Options Detection', 'Description' => 'Display available HTTP options for each system', 'Author' => ['CG'], 'License' => MSF_LICENSE, 'References' => [ ['CVE', '2005-3398'], # HTTP Trace related ['CVE', '2005-3498'], # HTTP Trace related ['OSVDB', '877'], ['BID', '11604'], ['BID', '9506'], ['BID', '9561'], ['URL', 'https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/OPTIONS'] ] ) register_options( [ OptString.new('TARGETURI', [true, 'URI to test', '/']), ] ) end def run_host(target_host) res = send_request_cgi({ 'uri' => datastore['TARGETURI'], 'method' => 'OPTIONS' }) return unless res # Patch so that we can catch a Tomcat edge case. # Tomcat may respond to OPTIONS requests with the verbs in the # HTTP body, instead of the Allow header. # https://github.com/rapid7/metasploit-framework/issues/12557#issuecomment-552263162 # https://stackoverflow.com/questions/23886941/http-status-405-jsps-only-permit-get-post-or-head if res.body && res.body =~ %r{