diff --git a/modules/auxiliary/scanner/ssh/ssh_version.rb b/modules/auxiliary/scanner/ssh/ssh_version.rb index ddc9a276e3..05c4e1880f 100644 --- a/modules/auxiliary/scanner/ssh/ssh_version.rb +++ b/modules/auxiliary/scanner/ssh/ssh_version.rb @@ -45,7 +45,7 @@ class Metasploit3 < Msf::Auxiliary def run_host(target_host) begin - timeout(to) do + ::Timeout.timeout(to) do connect diff --git a/modules/auxiliary/scanner/telnet/telnet_version.rb b/modules/auxiliary/scanner/telnet/telnet_version.rb index 2f0d6bdbf9..05d805a2f1 100644 --- a/modules/auxiliary/scanner/telnet/telnet_version.rb +++ b/modules/auxiliary/scanner/telnet/telnet_version.rb @@ -39,12 +39,13 @@ class Metasploit3 < Msf::Auxiliary def run_host(ip) begin - timeout(to) do - res = connect - # This makes db_services look a lot nicer. - banner_santized = Rex::Text.to_hex_ascii(banner.to_s) - print_status("#{ip}:#{rport} TELNET #{banner_santized}") - report_service(:host => rhost, :port => rport, :name => "telnet", :info => banner_santized) + ::Timeout.timeout(to) do + res = connect + # This makes db_services look a lot nicer. + banner_santized = Rex::Text.to_hex_ascii(banner.to_s) + print_status("#{ip}:#{rport} TELNET #{banner_santized}") + report_service(:host => rhost, :port => rport, :name => "telnet", :info => banner_santized) + end rescue ::Rex::ConnectionError rescue Timeout::Error print_error("#{target_host}:#{rport}, Server timed out after #{to} seconds. Skipping.")