Land #6014, support TCP advanced options for loginscanner mods

bug/bundler_fix
wchen-r7 2015-10-07 14:26:25 -05:00
commit a2c9e2549d
No known key found for this signature in database
GPG Key ID: 2384DB4EF06F730B
14 changed files with 97 additions and 17 deletions

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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|

View File

@ -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|

View File

@ -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|

View File

@ -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|

View File

@ -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|

View File

@ -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|

View File

@ -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|

View File

@ -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|

View File

@ -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|

View File

@ -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|

View File

@ -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|