set default connection tiemouts

loginscanners should have a default connection timeout
bug/bundler_fix
David Maloney 2014-07-10 11:35:10 -05:00
parent 1a0200f711
commit a319d5270e
No known key found for this signature in database
GPG Key ID: DEDBA9DC3A913DB2
10 changed files with 37 additions and 24 deletions

View File

@ -39,9 +39,10 @@ module Metasploit
end end
def set_sane_defaults def set_sane_defaults
self.port = DEFAULT_PORT if self.port.nil? self.connection_timeout ||= 30
self.max_send_size = 0 if self.max_send_size.nil? self.port ||= DEFAULT_PORT
self.send_delay = 0 if self.send_delay.nil? self.max_send_size ||= 0
self.send_delay ||= 0
end end
end end
end end

View File

@ -96,10 +96,12 @@ module Metasploit
# This method sets the sane defaults for things # This method sets the sane defaults for things
# like timeouts and TCP evasion options # like timeouts and TCP evasion options
def set_sane_defaults def set_sane_defaults
self.port ||= DEFAULT_PORT self.connection_timeout ||= 30
self.max_send_size ||= 0 self.port ||= DEFAULT_PORT
self.send_delay ||= 0 self.max_send_size ||= 0
self.ssl ||= false self.send_delay ||= 0
self.ssl = false if self.ssl.nil?
end end
# This method takes a response packet and checks to see # This method takes a response packet and checks to see

View File

@ -62,10 +62,11 @@ module Metasploit
# This method sets the sane defaults for things # This method sets the sane defaults for things
# like timeouts and TCP evasion options # like timeouts and TCP evasion options
def set_sane_defaults def set_sane_defaults
self.port = DEFAULT_PORT if self.port.nil? self.connection_timeout ||= 30
self.max_send_size = 0 if self.max_send_size.nil? self.port ||= DEFAULT_PORT
self.send_delay = 0 if self.send_delay.nil? self.max_send_size ||= 0
self.ftp_timeout = 16 if self.ftp_timeout.nil? self.send_delay ||= 0
self.ftp_timeout ||= 16
end end
end end

View File

@ -92,6 +92,7 @@ module Metasploit
# This method sets the sane defaults for things # This method sets the sane defaults for things
# like timeouts and TCP evasion options # like timeouts and TCP evasion options
def set_sane_defaults def set_sane_defaults
self.connection_timeout ||= 20
self.max_send_size = 0 if self.max_send_size.nil? self.max_send_size = 0 if self.max_send_size.nil?
self.send_delay = 0 if self.send_delay.nil? self.send_delay = 0 if self.send_delay.nil?

View File

@ -53,9 +53,12 @@ module Metasploit
private private
def set_sane_defaults def set_sane_defaults
self.port = DEFAULT_PORT if self.port.nil? self.connection_timeout ||= 30
self.max_send_size = 0 if self.max_send_size.nil? self.port ||= DEFAULT_PORT
self.send_delay = 0 if self.send_delay.nil? self.max_send_size ||= 0
self.send_delay ||= 0
# Don't use ||= with booleans
self.send_lm = true if self.send_lm.nil? self.send_lm = true if self.send_lm.nil?
self.send_ntlm = true if self.send_ntlm.nil? self.send_ntlm = true if self.send_ntlm.nil?
self.send_spn = true if self.send_spn.nil? self.send_spn = true if self.send_spn.nil?

View File

@ -78,9 +78,10 @@ module Metasploit
# This method sets the sane defaults for things # This method sets the sane defaults for things
# like timeouts and TCP evasion options # like timeouts and TCP evasion options
def set_sane_defaults def set_sane_defaults
self.port = DEFAULT_PORT if self.port.nil? self.connection_timeout || 30
self.max_send_size = 0 if self.max_send_size.nil? self.port ||= DEFAULT_PORT
self.send_delay = 0 if self.send_delay.nil? self.max_send_size ||= 0
self.send_delay ||= 0
end end
end end

View File

@ -68,9 +68,10 @@ module Metasploit
# (see Base#set_sane_defaults) # (see Base#set_sane_defaults)
def set_sane_defaults def set_sane_defaults
self.port = DEFAULT_PORT if self.port.nil? self.connection_timeout ||= 30
self.max_send_size ||= 0 self.port ||= DEFAULT_PORT
self.send_delay ||= 0 self.max_send_size ||= 0
self.send_delay ||= 0
end end
end end

View File

@ -70,7 +70,8 @@ module Metasploit
end end
def set_sane_defaults def set_sane_defaults
self.port = DEFAULT_PORT if self.port.nil? self.connection_timeout ||= 30
self.port ||= DEFAULT_PORT
end end
end end

View File

@ -96,6 +96,7 @@ module Metasploit
# This method sets the sane defaults for things # This method sets the sane defaults for things
# like timeouts and TCP evasion options # like timeouts and TCP evasion options
def set_sane_defaults def set_sane_defaults
self.connection_timeout ||= 30
self.max_send_size ||= 0 self.max_send_size ||= 0
self.port ||= DEFAULT_PORT self.port ||= DEFAULT_PORT
self.send_delay ||= 0 self.send_delay ||= 0

View File

@ -90,9 +90,10 @@ module Metasploit
# This method sets the sane defaults for things # This method sets the sane defaults for things
# like timeouts and TCP evasion options # like timeouts and TCP evasion options
def set_sane_defaults def set_sane_defaults
self.port ||= 5900 self.connection_timeout ||= 30
self.max_send_size ||= 0 self.port ||= 5900
self.send_delay ||= 0 self.max_send_size ||= 0
self.send_delay ||= 0
end end
# This method attempts the actual VNC authentication. It has built in retries to handle # This method attempts the actual VNC authentication. It has built in retries to handle