diff --git a/lib/metasploit/framework/login_scanner/afp.rb b/lib/metasploit/framework/login_scanner/afp.rb index 7db4b49c1f..9e23d10084 100644 --- a/lib/metasploit/framework/login_scanner/afp.rb +++ b/lib/metasploit/framework/login_scanner/afp.rb @@ -39,9 +39,10 @@ module Metasploit end def set_sane_defaults - self.port = DEFAULT_PORT if self.port.nil? - self.max_send_size = 0 if self.max_send_size.nil? - self.send_delay = 0 if self.send_delay.nil? + self.connection_timeout ||= 30 + self.port ||= DEFAULT_PORT + self.max_send_size ||= 0 + self.send_delay ||= 0 end end end diff --git a/lib/metasploit/framework/login_scanner/db2.rb b/lib/metasploit/framework/login_scanner/db2.rb index becdd3ed28..61bfce756b 100644 --- a/lib/metasploit/framework/login_scanner/db2.rb +++ b/lib/metasploit/framework/login_scanner/db2.rb @@ -96,10 +96,12 @@ module Metasploit # This method sets the sane defaults for things # like timeouts and TCP evasion options def set_sane_defaults - self.port ||= DEFAULT_PORT - self.max_send_size ||= 0 - self.send_delay ||= 0 - self.ssl ||= false + self.connection_timeout ||= 30 + self.port ||= DEFAULT_PORT + self.max_send_size ||= 0 + self.send_delay ||= 0 + + self.ssl = false if self.ssl.nil? end # This method takes a response packet and checks to see diff --git a/lib/metasploit/framework/login_scanner/ftp.rb b/lib/metasploit/framework/login_scanner/ftp.rb index c5b63a9972..be93bd7074 100644 --- a/lib/metasploit/framework/login_scanner/ftp.rb +++ b/lib/metasploit/framework/login_scanner/ftp.rb @@ -62,10 +62,11 @@ module Metasploit # This method sets the sane defaults for things # like timeouts and TCP evasion options def set_sane_defaults - self.port = DEFAULT_PORT if self.port.nil? - self.max_send_size = 0 if self.max_send_size.nil? - self.send_delay = 0 if self.send_delay.nil? - self.ftp_timeout = 16 if self.ftp_timeout.nil? + self.connection_timeout ||= 30 + self.port ||= DEFAULT_PORT + self.max_send_size ||= 0 + self.send_delay ||= 0 + self.ftp_timeout ||= 16 end end diff --git a/lib/metasploit/framework/login_scanner/http.rb b/lib/metasploit/framework/login_scanner/http.rb index 4bd78075cf..2d343f6e03 100644 --- a/lib/metasploit/framework/login_scanner/http.rb +++ b/lib/metasploit/framework/login_scanner/http.rb @@ -92,6 +92,7 @@ module Metasploit # This method sets the sane defaults for things # like timeouts and TCP evasion options def set_sane_defaults + self.connection_timeout ||= 20 self.max_send_size = 0 if self.max_send_size.nil? self.send_delay = 0 if self.send_delay.nil? diff --git a/lib/metasploit/framework/login_scanner/mssql.rb b/lib/metasploit/framework/login_scanner/mssql.rb index 186346c415..2d5ae1b7f2 100644 --- a/lib/metasploit/framework/login_scanner/mssql.rb +++ b/lib/metasploit/framework/login_scanner/mssql.rb @@ -53,9 +53,12 @@ module Metasploit private def set_sane_defaults - self.port = DEFAULT_PORT if self.port.nil? - self.max_send_size = 0 if self.max_send_size.nil? - self.send_delay = 0 if self.send_delay.nil? + self.connection_timeout ||= 30 + self.port ||= DEFAULT_PORT + 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_ntlm = true if self.send_ntlm.nil? self.send_spn = true if self.send_spn.nil? diff --git a/lib/metasploit/framework/login_scanner/mysql.rb b/lib/metasploit/framework/login_scanner/mysql.rb index 734d7304d3..2d19fcef46 100644 --- a/lib/metasploit/framework/login_scanner/mysql.rb +++ b/lib/metasploit/framework/login_scanner/mysql.rb @@ -78,9 +78,10 @@ module Metasploit # This method sets the sane defaults for things # like timeouts and TCP evasion options def set_sane_defaults - self.port = DEFAULT_PORT if self.port.nil? - self.max_send_size = 0 if self.max_send_size.nil? - self.send_delay = 0 if self.send_delay.nil? + self.connection_timeout || 30 + self.port ||= DEFAULT_PORT + self.max_send_size ||= 0 + self.send_delay ||= 0 end end diff --git a/lib/metasploit/framework/login_scanner/pop3.rb b/lib/metasploit/framework/login_scanner/pop3.rb index 5f3fbfe5c1..85fdace6eb 100644 --- a/lib/metasploit/framework/login_scanner/pop3.rb +++ b/lib/metasploit/framework/login_scanner/pop3.rb @@ -68,9 +68,10 @@ module Metasploit # (see Base#set_sane_defaults) def set_sane_defaults - self.port = DEFAULT_PORT if self.port.nil? - self.max_send_size ||= 0 - self.send_delay ||= 0 + self.connection_timeout ||= 30 + self.port ||= DEFAULT_PORT + self.max_send_size ||= 0 + self.send_delay ||= 0 end end diff --git a/lib/metasploit/framework/login_scanner/postgres.rb b/lib/metasploit/framework/login_scanner/postgres.rb index dcd29cbd62..bf81c3cefe 100644 --- a/lib/metasploit/framework/login_scanner/postgres.rb +++ b/lib/metasploit/framework/login_scanner/postgres.rb @@ -70,7 +70,8 @@ module Metasploit end def set_sane_defaults - self.port = DEFAULT_PORT if self.port.nil? + self.connection_timeout ||= 30 + self.port ||= DEFAULT_PORT end end diff --git a/lib/metasploit/framework/login_scanner/telnet.rb b/lib/metasploit/framework/login_scanner/telnet.rb index d6aa3b9b9a..1e1d3f873c 100644 --- a/lib/metasploit/framework/login_scanner/telnet.rb +++ b/lib/metasploit/framework/login_scanner/telnet.rb @@ -96,6 +96,7 @@ module Metasploit # This method sets the sane defaults for things # like timeouts and TCP evasion options def set_sane_defaults + self.connection_timeout ||= 30 self.max_send_size ||= 0 self.port ||= DEFAULT_PORT self.send_delay ||= 0 diff --git a/lib/metasploit/framework/login_scanner/vnc.rb b/lib/metasploit/framework/login_scanner/vnc.rb index e393668887..21316aa097 100644 --- a/lib/metasploit/framework/login_scanner/vnc.rb +++ b/lib/metasploit/framework/login_scanner/vnc.rb @@ -90,9 +90,10 @@ module Metasploit # This method sets the sane defaults for things # like timeouts and TCP evasion options def set_sane_defaults - self.port ||= 5900 - self.max_send_size ||= 0 - self.send_delay ||= 0 + self.connection_timeout ||= 30 + self.port ||= 5900 + self.max_send_size ||= 0 + self.send_delay ||= 0 end # This method attempts the actual VNC authentication. It has built in retries to handle