Fix missing end, use explicit Timeout class

git-svn-id: file:///home/svn/framework3/trunk@10366 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2010-09-18 04:15:32 +00:00
parent b023d89469
commit e939379b1b
2 changed files with 8 additions and 7 deletions

View File

@ -45,7 +45,7 @@ class Metasploit3 < Msf::Auxiliary
def run_host(target_host) def run_host(target_host)
begin begin
timeout(to) do ::Timeout.timeout(to) do
connect connect

View File

@ -39,12 +39,13 @@ class Metasploit3 < Msf::Auxiliary
def run_host(ip) def run_host(ip)
begin begin
timeout(to) do ::Timeout.timeout(to) do
res = connect res = connect
# This makes db_services look a lot nicer. # This makes db_services look a lot nicer.
banner_santized = Rex::Text.to_hex_ascii(banner.to_s) banner_santized = Rex::Text.to_hex_ascii(banner.to_s)
print_status("#{ip}:#{rport} TELNET #{banner_santized}") print_status("#{ip}:#{rport} TELNET #{banner_santized}")
report_service(:host => rhost, :port => rport, :name => "telnet", :info => banner_santized) report_service(:host => rhost, :port => rport, :name => "telnet", :info => banner_santized)
end
rescue ::Rex::ConnectionError rescue ::Rex::ConnectionError
rescue Timeout::Error rescue Timeout::Error
print_error("#{target_host}:#{rport}, Server timed out after #{to} seconds. Skipping.") print_error("#{target_host}:#{rport}, Server timed out after #{to} seconds. Skipping.")