">
Lucene search
K

HTTP Strict Transport Security (HSTS) Detection

🗓️ 30 Nov 2012 14:30:11Reported by Matt "hostess" Andreko <[email protected]>Type 
metasploit
 metasploit
🔗 www.rapid7.com👁 14 Views

HTTP Strict Transport Security (HSTS) Detection module to display HSTS information about each syste

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'            => 'HTTP Strict Transport Security (HSTS) Detection',
      'Description'     => %q{
        Display HTTP Strict Transport Security (HSTS) information about each system.
      },
      'Author'          => 'Matt "hostess" Andreko <mandreko[at]accuvant.com>',
      'License'         => MSF_LICENSE,
      'DefaultOptions'  => { 'SSL' => true }
    ))

    register_options([
        Opt::RPORT(443)
      ])
  end

  def run_host(ip)
    begin
      res = send_request_cgi({
        'uri'    => '/',
        'method' => 'GET',
        }, 25)

      if res
        hsts = res.headers['Strict-Transport-Security']

        if hsts
          print_good("#{ip}:#{rport} - Strict-Transport-Security:#{hsts}")
          report_note({
            :data => hsts,
            :type => "hsts.data",
            :host => ip,
            :port => rport
          })
        else
          print_error("#{ip}:#{rport} No HSTS found.")
        end
      else
        print_error("#{ip}:#{rport} No headers were returned.")
      end

    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

24 Jul 2017 13:26Current
7.1High risk
Vulners AI Score7.1
14