Sha256: b52de4904978ccd882f61090416a504bfdd7d3ee114d4a41c823b31431ef7ec7

Contents?: true

Size: 786 Bytes

Versions: 21

Compression:

Stored size: 786 Bytes

Contents

require 'sinatra/base'
require 'webrick'
require 'webrick/https'
require 'openssl'

options = {
    Port:            ARGV[1].to_i,
    Host:            ARGV.last,
    SSLEnable:       true,
    SSLVerifyClient: OpenSSL::SSL::VERIFY_NONE,
    SSLCertName:     [["CN", WEBrick::Utils::getservername]],
}

class BrowserHTTPSServer < Sinatra::Base

    get '/' do
        headers 'Strict-Transport-Security' => 'max-age=9999'

        <<-HTML
            <a href='/vulnerable'>Vulnerable</a>
            <a href='/safe'>Safe</a>
        HTML
    end

    get '/vulnerable' do
    end

    get '/safe' do
        headers 'Strict-Transport-Security' => 'max-age=9999'
    end

end

server = ::Rack::Handler::WEBrick
trap( :INT ) { server.shutdown }

server.run( BrowserHTTPSServer, options )

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
arachni-1.6.1.3 spec/support/servers/checks/passive/grep/hsts_https.rb
arachni-1.6.1.2 spec/support/servers/checks/passive/grep/hsts_https.rb
arachni-1.6.1.1 spec/support/servers/checks/passive/grep/hsts_https.rb
arachni-1.6.1 spec/support/servers/checks/passive/grep/hsts_https.rb
arachni-1.6.0 spec/support/servers/checks/passive/grep/hsts_https.rb
arachni-1.5.1 spec/support/servers/checks/passive/grep/hsts_https.rb
arachni-1.5 spec/support/servers/checks/passive/grep/hsts_https.rb
arachni-1.4 spec/support/servers/checks/passive/grep/hsts_https.rb
arachni-1.3.2 spec/support/servers/checks/passive/grep/hsts_https.rb
arachni-1.3.1 spec/support/servers/checks/passive/grep/hsts_https.rb
arachni-1.3 spec/support/servers/checks/passive/grep/hsts_https.rb
arachni-1.2.1 spec/support/servers/checks/passive/grep/hsts_https.rb
arachni-1.2 spec/support/servers/checks/passive/grep/hsts_https.rb
arachni-1.1 spec/support/servers/checks/passive/grep/hsts_https.rb
arachni-1.0.6 spec/support/servers/checks/passive/grep/hsts_https.rb
arachni-1.0.5 spec/support/servers/checks/passive/grep/hsts_https.rb
arachni-1.0.4 spec/support/servers/checks/passive/grep/hsts_https.rb
arachni-1.0.3 spec/support/servers/checks/passive/grep/hsts_https.rb
arachni-1.0.2 spec/support/servers/checks/passive/grep/hsts_https.rb
arachni-1.0.1 spec/support/servers/checks/passive/grep/hsts_https.rb