Land #6014, support TCP advanced options for loginscanner mods
commit
a2c9e2549d
|
@ -30,6 +30,12 @@ module Metasploit
|
||||||
# @!attribute port
|
# @!attribute port
|
||||||
# @return [Fixnum] The port to connect to
|
# @return [Fixnum] The port to connect to
|
||||||
attr_accessor :port
|
attr_accessor :port
|
||||||
|
# @!attribute host
|
||||||
|
# @return [String] The local host for outgoing connections
|
||||||
|
attr_accessor :local_host
|
||||||
|
# @!attribute port
|
||||||
|
# @return [Fixnum] The local port for outgoing connections
|
||||||
|
attr_accessor :local_port
|
||||||
# @!attribute proxies
|
# @!attribute proxies
|
||||||
# @return [String] The proxy directive to use for the socket
|
# @return [String] The proxy directive to use for the socket
|
||||||
attr_accessor :proxies
|
attr_accessor :proxies
|
||||||
|
|
|
@ -18,17 +18,15 @@ module Metasploit
|
||||||
# @!attribute ssl_version
|
# @!attribute ssl_version
|
||||||
# @return [String] The version of SSL to implement
|
# @return [String] The version of SSL to implement
|
||||||
attr_accessor :ssl_version
|
attr_accessor :ssl_version
|
||||||
|
# @!attribute ssl_verify_mode
|
||||||
|
# @return [String] the SSL certification verification mechanism
|
||||||
|
attr_accessor :ssl_verify_mode
|
||||||
|
# @!attribute ssl_cipher
|
||||||
|
# @return [String] The SSL cipher to use for the context
|
||||||
|
attr_accessor :ssl_cipher
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def chost
|
|
||||||
'0.0.0.0'
|
|
||||||
end
|
|
||||||
|
|
||||||
def cport
|
|
||||||
0
|
|
||||||
end
|
|
||||||
|
|
||||||
def rhost
|
def rhost
|
||||||
host
|
host
|
||||||
end
|
end
|
||||||
|
@ -36,6 +34,14 @@ module Metasploit
|
||||||
def rport
|
def rport
|
||||||
port
|
port
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def chost
|
||||||
|
local_host || '0.0.0.0'
|
||||||
|
end
|
||||||
|
|
||||||
|
def cport
|
||||||
|
local_port || 0
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -82,15 +82,17 @@ module Metasploit
|
||||||
end
|
end
|
||||||
|
|
||||||
nsock = Rex::Socket::Tcp.create(
|
nsock = Rex::Socket::Tcp.create(
|
||||||
'PeerHost' => opts['RHOST'] || rhost,
|
'PeerHost' => opts['RHOST'] || rhost,
|
||||||
'PeerPort' => (opts['RPORT'] || rport).to_i,
|
'PeerPort' => (opts['RPORT'] || rport).to_i,
|
||||||
'LocalHost' => opts['CHOST'] || chost || "0.0.0.0",
|
'LocalHost' => opts['CHOST'] || chost || "0.0.0.0",
|
||||||
'LocalPort' => (opts['CPORT'] || cport || 0).to_i,
|
'LocalPort' => (opts['CPORT'] || cport || 0).to_i,
|
||||||
'SSL' => dossl,
|
'SSL' => dossl,
|
||||||
'SSLVersion' => opts['SSLVersion'] || ssl_version,
|
'SSLVersion' => opts['SSLVersion'] || ssl_version,
|
||||||
'Proxies' => proxies,
|
'SSLVerifyMode' => opts['SSLVerifyMode'] || ssl_verify_mode,
|
||||||
'Timeout' => (opts['ConnectTimeout'] || connection_timeout || 10).to_i,
|
'SSLCipher' => opts['SSLCipher'] || ssl_cipher,
|
||||||
'Context' => { 'Msf' => framework, 'MsfExploit' => framework_module }
|
'Proxies' => proxies,
|
||||||
|
'Timeout' => (opts['ConnectTimeout'] || connection_timeout || 10).to_i,
|
||||||
|
'Context' => { 'Msf' => framework, 'MsfExploit' => framework_module }
|
||||||
)
|
)
|
||||||
# enable evasions on this socket
|
# enable evasions on this socket
|
||||||
set_tcp_evasions(nsock)
|
set_tcp_evasions(nsock)
|
||||||
|
|
|
@ -74,6 +74,12 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
send_delay: datastore['TCP::send_delay'],
|
send_delay: datastore['TCP::send_delay'],
|
||||||
framework: framework,
|
framework: framework,
|
||||||
framework_module: self,
|
framework_module: self,
|
||||||
|
ssl: datastore['SSL'],
|
||||||
|
ssl_version: datastore['SSLVersion'],
|
||||||
|
ssl_verify_mode: datastore['SSLVerifyMode'],
|
||||||
|
ssl_cipher: datastore['SSLCipher'],
|
||||||
|
local_port: datastore['CPORT'],
|
||||||
|
local_host: datastore['CHOST']
|
||||||
)
|
)
|
||||||
|
|
||||||
scanner.scan! do |result|
|
scanner.scan! do |result|
|
||||||
|
|
|
@ -69,6 +69,12 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
send_delay: datastore['TCP::send_delay'],
|
send_delay: datastore['TCP::send_delay'],
|
||||||
framework: framework,
|
framework: framework,
|
||||||
framework_module: self,
|
framework_module: self,
|
||||||
|
ssl: datastore['SSL'],
|
||||||
|
ssl_version: datastore['SSLVersion'],
|
||||||
|
ssl_verify_mode: datastore['SSLVerifyMode'],
|
||||||
|
ssl_cipher: datastore['SSLCipher'],
|
||||||
|
local_port: datastore['CPORT'],
|
||||||
|
local_host: datastore['CHOST']
|
||||||
)
|
)
|
||||||
|
|
||||||
scanner.scan! do |result|
|
scanner.scan! do |result|
|
||||||
|
|
|
@ -67,6 +67,12 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
send_delay: datastore['TCP::send_delay'],
|
send_delay: datastore['TCP::send_delay'],
|
||||||
framework: framework,
|
framework: framework,
|
||||||
framework_module: self,
|
framework_module: self,
|
||||||
|
ssl: datastore['SSL'],
|
||||||
|
ssl_version: datastore['SSLVersion'],
|
||||||
|
ssl_verify_mode: datastore['SSLVerifyMode'],
|
||||||
|
ssl_cipher: datastore['SSLCipher'],
|
||||||
|
local_port: datastore['CPORT'],
|
||||||
|
local_host: datastore['CHOST']
|
||||||
)
|
)
|
||||||
|
|
||||||
scanner.scan! do |result|
|
scanner.scan! do |result|
|
||||||
|
|
|
@ -81,6 +81,12 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
connection_timeout: 30,
|
connection_timeout: 30,
|
||||||
framework: framework,
|
framework: framework,
|
||||||
framework_module: self,
|
framework_module: self,
|
||||||
|
ssl: datastore['SSL'],
|
||||||
|
ssl_version: datastore['SSLVersion'],
|
||||||
|
ssl_verify_mode: datastore['SSLVerifyMode'],
|
||||||
|
ssl_cipher: datastore['SSLCipher'],
|
||||||
|
local_port: datastore['CPORT'],
|
||||||
|
local_host: datastore['CHOST']
|
||||||
)
|
)
|
||||||
|
|
||||||
scanner.scan! do |result|
|
scanner.scan! do |result|
|
||||||
|
|
|
@ -58,6 +58,12 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
windows_authentication: datastore['USE_WINDOWS_AUTHENT'],
|
windows_authentication: datastore['USE_WINDOWS_AUTHENT'],
|
||||||
framework: framework,
|
framework: framework,
|
||||||
framework_module: self,
|
framework_module: self,
|
||||||
|
ssl: datastore['SSL'],
|
||||||
|
ssl_version: datastore['SSLVersion'],
|
||||||
|
ssl_verify_mode: datastore['SSLVerifyMode'],
|
||||||
|
ssl_cipher: datastore['SSLCipher'],
|
||||||
|
local_port: datastore['CPORT'],
|
||||||
|
local_host: datastore['CHOST']
|
||||||
)
|
)
|
||||||
|
|
||||||
scanner.scan! do |result|
|
scanner.scan! do |result|
|
||||||
|
|
|
@ -66,6 +66,12 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
send_delay: datastore['TCP::send_delay'],
|
send_delay: datastore['TCP::send_delay'],
|
||||||
framework: framework,
|
framework: framework,
|
||||||
framework_module: self,
|
framework_module: self,
|
||||||
|
ssl: datastore['SSL'],
|
||||||
|
ssl_version: datastore['SSLVersion'],
|
||||||
|
ssl_verify_mode: datastore['SSLVerifyMode'],
|
||||||
|
ssl_cipher: datastore['SSLCipher'],
|
||||||
|
local_port: datastore['CPORT'],
|
||||||
|
local_host: datastore['CHOST']
|
||||||
)
|
)
|
||||||
|
|
||||||
scanner.scan! do |result|
|
scanner.scan! do |result|
|
||||||
|
|
|
@ -75,6 +75,12 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
send_delay: datastore['TCP::send_delay'],
|
send_delay: datastore['TCP::send_delay'],
|
||||||
framework: framework,
|
framework: framework,
|
||||||
framework_module: self,
|
framework_module: self,
|
||||||
|
ssl: datastore['SSL'],
|
||||||
|
ssl_version: datastore['SSLVersion'],
|
||||||
|
ssl_verify_mode: datastore['SSLVerifyMode'],
|
||||||
|
ssl_cipher: datastore['SSLCipher'],
|
||||||
|
local_port: datastore['CPORT'],
|
||||||
|
local_host: datastore['CHOST']
|
||||||
)
|
)
|
||||||
|
|
||||||
scanner.scan! do |result|
|
scanner.scan! do |result|
|
||||||
|
|
|
@ -116,6 +116,12 @@ class Metasploit4 < Msf::Auxiliary
|
||||||
pre_login: lambda { |s| raw_send("enable\r\n", s.sock) },
|
pre_login: lambda { |s| raw_send("enable\r\n", s.sock) },
|
||||||
framework: framework,
|
framework: framework,
|
||||||
framework_module: self,
|
framework_module: self,
|
||||||
|
ssl: datastore['SSL'],
|
||||||
|
ssl_version: datastore['SSLVersion'],
|
||||||
|
ssl_verify_mode: datastore['SSLVerifyMode'],
|
||||||
|
ssl_cipher: datastore['SSLCipher'],
|
||||||
|
local_port: datastore['CPORT'],
|
||||||
|
local_host: datastore['CHOST']
|
||||||
)
|
)
|
||||||
|
|
||||||
scanner.scan! do |result|
|
scanner.scan! do |result|
|
||||||
|
|
|
@ -72,6 +72,12 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
telnet_timeout: datastore['TelnetTimeout'],
|
telnet_timeout: datastore['TelnetTimeout'],
|
||||||
framework: framework,
|
framework: framework,
|
||||||
framework_module: self,
|
framework_module: self,
|
||||||
|
ssl: datastore['SSL'],
|
||||||
|
ssl_version: datastore['SSLVersion'],
|
||||||
|
ssl_verify_mode: datastore['SSLVerifyMode'],
|
||||||
|
ssl_cipher: datastore['SSLCipher'],
|
||||||
|
local_port: datastore['CPORT'],
|
||||||
|
local_host: datastore['CHOST']
|
||||||
)
|
)
|
||||||
|
|
||||||
scanner.scan! do |result|
|
scanner.scan! do |result|
|
||||||
|
|
|
@ -78,6 +78,12 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
send_delay: datastore['TCP::send_delay'],
|
send_delay: datastore['TCP::send_delay'],
|
||||||
framework: framework,
|
framework: framework,
|
||||||
framework_module: self,
|
framework_module: self,
|
||||||
|
ssl: datastore['SSL'],
|
||||||
|
ssl_version: datastore['SSLVersion'],
|
||||||
|
ssl_verify_mode: datastore['SSLVerifyMode'],
|
||||||
|
ssl_cipher: datastore['SSLCipher'],
|
||||||
|
local_port: datastore['CPORT'],
|
||||||
|
local_host: datastore['CHOST']
|
||||||
)
|
)
|
||||||
|
|
||||||
scanner.scan! do |result|
|
scanner.scan! do |result|
|
||||||
|
|
|
@ -83,6 +83,12 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
send_delay: datastore['TCP::send_delay'],
|
send_delay: datastore['TCP::send_delay'],
|
||||||
framework: framework,
|
framework: framework,
|
||||||
framework_module: self,
|
framework_module: self,
|
||||||
|
ssl: datastore['SSL'],
|
||||||
|
ssl_version: datastore['SSLVersion'],
|
||||||
|
ssl_verify_mode: datastore['SSLVerifyMode'],
|
||||||
|
ssl_cipher: datastore['SSLCipher'],
|
||||||
|
local_port: datastore['CPORT'],
|
||||||
|
local_host: datastore['CHOST']
|
||||||
)
|
)
|
||||||
|
|
||||||
scanner.scan! do |result|
|
scanner.scan! do |result|
|
||||||
|
|
Loading…
Reference in New Issue