2012-06-29 00:18:28 -05:00
|
|
|
# -*- coding: binary -*-
|
2011-05-12 20:03:55 +00:00
|
|
|
require 'rex/io/stream_abstraction'
|
|
|
|
|
require 'rex/sync/ref'
|
2010-04-03 05:37:40 +00:00
|
|
|
|
|
|
|
|
module Msf
|
|
|
|
|
module Handler
|
|
|
|
|
|
|
|
|
|
###
|
|
|
|
|
#
|
|
|
|
|
# This handler implements the HTTP SSL tunneling interface.
|
|
|
|
|
#
|
|
|
|
|
###
|
|
|
|
|
module ReverseHttps
|
|
|
|
|
|
2015-10-07 09:59:12 -05:00
|
|
|
include Msf::Handler::Reverse::SSL
|
2013-08-30 16:28:33 -05:00
|
|
|
include Msf::Handler::ReverseHttp
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Returns the string representation of the handler type
|
|
|
|
|
#
|
|
|
|
|
def self.handler_type
|
|
|
|
|
return "reverse_https"
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Returns the connection-described general handler type, in this case
|
|
|
|
|
# 'tunnel'.
|
|
|
|
|
#
|
|
|
|
|
def self.general_handler_type
|
|
|
|
|
"tunnel"
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Initializes the HTTP SSL tunneling handler.
|
|
|
|
|
#
|
|
|
|
|
def initialize(info = {})
|
|
|
|
|
super
|
|
|
|
|
|
|
|
|
|
register_options(
|
|
|
|
|
[
|
2014-11-22 14:23:56 -06:00
|
|
|
OptPort.new('LPORT', [ true, "The local listener port", 8443 ]),
|
|
|
|
|
], Msf::Handler::ReverseHttps)
|
|
|
|
|
|
|
|
|
|
register_advanced_options(
|
|
|
|
|
[
|
2015-03-17 14:41:00 +10:00
|
|
|
OptBool.new('StagerVerifySSLCert', [false, "Whether to verify the SSL certificate in Meterpreter"])
|
2013-08-30 16:28:33 -05:00
|
|
|
], Msf::Handler::ReverseHttps)
|
|
|
|
|
|
|
|
|
|
end
|
2010-04-03 05:37:40 +00:00
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|