Lucene search
K

Apache HTTPD mod_negotiation Scanner

🗓️ 21 Jan 2011 22:26:33Reported by diablohorn <[email protected]>Type 
metasploit
 metasploit
🔗 www.rapid7.com👁 47 Views

Apache HTTPD mod_negotiation Scanner module scans webserver for mod_negotiatio

Code
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Auxiliary
  include Msf::Exploit::Remote::HttpClient
  include Msf::Auxiliary::Scanner

  def initialize(info = {})
    super(update_info(info,
      'Name'   		=> 'Apache HTTPD mod_negotiation Scanner',
      'Description'	=> %q{
          This module scans the webserver of the given host(s) for the existence of mod_negotiate.
        If the webserver has mod_negotiation enabled, the IP address will be displayed.
      },
      'Author' 		=> [ 'diablohorn [at] gmail.com' ],
      'License'		=> MSF_LICENSE))

    register_options(
      [
        OptString.new('PATH', [ true,  "The path to detect mod_negotiation", '/']),
        OptString.new('FILENAME',[true, "Filename to use as a test",'index'])
      ])
  end

  def run_host(ip)
    ecode = nil
    emesg = nil

    tpath = datastore['PATH']
    tfile = datastore['FILENAME']

    if tpath[-1,1] != '/'
      tpath += '/'
    end

    vhost = datastore['VHOST'] || ip
    prot  = datastore['SSL'] ? 'https' : 'http'

    #
    # Send the request and parse the response headers for an alternates header
    #
    begin
      # Send the request the accept header is key here
      res = send_request_cgi({
        'uri'  		=>  tpath+tfile,
        'method'   	=> 'GET',
        'ctype'     => 'text/html',
        'headers'	=> {'Accept' => 'a/b'}
      }, 20)

      return if not res

      # Check for alternates header
      if(res.code == 406)
        print_status(ip.to_s)
      end

    rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
    rescue ::Timeout::Error, ::Errno::EPIPE
    end

  end
end

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

07 Jan 2024 20:02Current
7.3High risk
Vulners AI Score7.3
47