Skip to content

Commit a1d7748

Browse files
committed
Fix rapid7#8061, Handle ::Errno::ECONNRESET in telnet_version
Fix rapid7#8061
1 parent d4ee254 commit a1d7748

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

modules/auxiliary/scanner/telnet/telnet_version.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,15 @@ def run_host(ip)
3939
print_status("#{ip}:#{rport} TELNET #{banner_santized}")
4040
report_service(:host => rhost, :port => rport, :name => "telnet", :info => banner_santized)
4141
end
42-
rescue ::Rex::ConnectionError
43-
rescue Timeout::Error
42+
rescue ::Rex::ConnectionError, ::Errno::ECONNRESET => e
43+
print_error("A network issue has occurred: #{e.message}")
44+
elog("#{e.class} #{e.message}\n#{e.backtrace * "\n"}")
45+
rescue Timeout::Error => e
4446
print_error("#{target_host}:#{rport}, Server timed out after #{to} seconds. Skipping.")
47+
elog("#{e.class} #{e.message}\n#{e.backtrace * "\n"}")
4548
rescue ::Exception => e
4649
print_error("#{e} #{e.backtrace}")
50+
elog("#{e.class} #{e.message}\n#{e.backtrace * "\n"}")
4751
end
4852
end
4953
end

0 commit comments

Comments
 (0)