Add socket context option
Add the option for a socket context so pivoting will workbug/bundler_fix
parent
d15e202f19
commit
d9627151c0
|
@ -5,6 +5,7 @@ module Rex::SSLScan
|
||||||
|
|
||||||
class Scanner
|
class Scanner
|
||||||
|
|
||||||
|
attr_accessor :context
|
||||||
attr_accessor :host
|
attr_accessor :host
|
||||||
attr_accessor :port
|
attr_accessor :port
|
||||||
attr_accessor :timeout
|
attr_accessor :timeout
|
||||||
|
@ -16,10 +17,11 @@ class Scanner
|
||||||
# @param port [Fixnum] Port number to scan, default: 443
|
# @param port [Fixnum] Port number to scan, default: 443
|
||||||
# @param timeout [Fixnum] Timeout for connections, in seconds. default: 20
|
# @param timeout [Fixnum] Timeout for connections, in seconds. default: 20
|
||||||
# @raise [StandardError] Raised when the configuration is invalid
|
# @raise [StandardError] Raised when the configuration is invalid
|
||||||
def initialize(host,port = 443,timeout=20)
|
def initialize(host,port = 443,context = {},timeout=20)
|
||||||
@host = host
|
@host = host
|
||||||
@port = port
|
@port = port
|
||||||
@timeout = timeout
|
@timeout = timeout
|
||||||
|
@context = context
|
||||||
@supported_versions = [:SSLv2, :SSLv3, :TLSv1]
|
@supported_versions = [:SSLv2, :SSLv3, :TLSv1]
|
||||||
raise StandardError, "The scanner configuration is invalid" unless valid?
|
raise StandardError, "The scanner configuration is invalid" unless valid?
|
||||||
end
|
end
|
||||||
|
@ -63,6 +65,7 @@ class Scanner
|
||||||
validate_params(ssl_version,cipher)
|
validate_params(ssl_version,cipher)
|
||||||
begin
|
begin
|
||||||
scan_client = Rex::Socket::Tcp.create(
|
scan_client = Rex::Socket::Tcp.create(
|
||||||
|
'Context' => @context,
|
||||||
'PeerHost' => @host,
|
'PeerHost' => @host,
|
||||||
'PeerPort' => @port,
|
'PeerPort' => @port,
|
||||||
'SSL' => true,
|
'SSL' => true,
|
||||||
|
|
Loading…
Reference in New Issue