CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/lib/metasploit/framework/login_scanner/rex_socket.rb
Views: 1904
1
require 'metasploit/framework/login_scanner'
2
3
module Metasploit
4
module Framework
5
module LoginScanner
6
7
# This module provides the common mixin behaviour for
8
# LoginScanner objects that rely on Rex Sockets for their
9
# underlying communication.
10
module RexSocket
11
extend ActiveSupport::Concern
12
13
included do
14
15
# @!attribute ssl
16
# @return [Boolean] Whether the socket should use ssl
17
attr_accessor :ssl
18
# @!attribute ssl_version
19
# @return [String] The version of SSL to implement
20
attr_accessor :ssl_version
21
# @!attribute ssl_verify_mode
22
# @return [String] the SSL certification verification mechanism
23
attr_accessor :ssl_verify_mode
24
# @!attribute ssl_cipher
25
# @return [String] The SSL cipher to use for the context
26
attr_accessor :ssl_cipher
27
28
private
29
30
def rhost
31
host
32
end
33
34
def rport
35
port
36
end
37
38
def chost
39
local_host || '0.0.0.0'
40
end
41
42
def cport
43
local_port || 0
44
end
45
end
46
end
47
end
48
end
49
end
50
51