Sha256: 2e94bc592c30a1492c35636a75a634429d62010c816c5c2eced61c008a9f8683

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

require 'socket'
require 'openssl'
require 'msf/aggregator/forwarder'
require 'msf/aggregator/http/request'
require 'msf/aggregator/http/ssl_responder'
require 'msf/aggregator/logger'
require 'msf/aggregator/router'

module Msf
  module Aggregator

    class HttpsForwarder < Forwarder

      def initialize
        super
      end

      def forward(connection)
        #forward input requests
        request_obj = Msf::Aggregator::Http::SslResponder.get_data(connection, false)
        uri = Msf::Aggregator::Http::Request.parse_uri(request_obj)
        @forwarder_mutex.synchronize do
          unless uri.nil?
            unless @response_queues[uri]
              uri_responder = Msf::Aggregator::Http::SslResponder.new(uri)
              uri_responder.log_messages = @log_messages
              @response_queues[uri] = uri_responder
            end
            @response_queues[uri].queue << request_obj
            @response_queues[uri].time = Time.now
          else
            connection.sync_close = true
            connection.close
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
metasploit-aggregator-0.1.0 lib/msf/aggregator/https_forwarder.rb