diff --git a/modules/auxiliary/scanner/imap/imap_version.rb b/modules/auxiliary/scanner/imap/imap_version.rb index 2c69b41023..74ff3e3e3f 100644 --- a/modules/auxiliary/scanner/imap/imap_version.rb +++ b/modules/auxiliary/scanner/imap/imap_version.rb @@ -22,13 +22,15 @@ class Metasploit3 < Msf::Auxiliary def run_host(ip) begin - res = connect + connect banner_sanitized = Rex::Text.to_hex_ascii(banner.to_s) print_status("#{ip}:#{rport} IMAP #{banner_sanitized}") report_service(:host => rhost, :port => rport, :name => "imap", :info => banner) rescue ::Rex::ConnectionError + rescue ::EOFError + print_error("#{ip}:#{rport} - The service failed to respond") rescue ::Exception => e - print_error("#{rhost}:#{rport} #{e} #{e.backtrace}") + print_error("#{ip}:#{rport} - #{e} #{e.backtrace}") end end diff --git a/modules/auxiliary/scanner/pop3/pop3_version.rb b/modules/auxiliary/scanner/pop3/pop3_version.rb index a6a232972b..ff3d1828c2 100644 --- a/modules/auxiliary/scanner/pop3/pop3_version.rb +++ b/modules/auxiliary/scanner/pop3/pop3_version.rb @@ -25,14 +25,16 @@ class Metasploit3 < Msf::Auxiliary def run_host(ip) begin - res = connect + connect banner = sock.get_once(-1, 30) banner_sanitized = Rex::Text.to_hex_ascii(banner.to_s) print_status("#{ip}:#{rport} POP3 #{banner_sanitized}") report_service(:host => rhost, :port => rport, :name => "pop3", :info => banner) rescue ::Rex::ConnectionError + rescue ::EOFError + print_error("#{ip}:#{rport} - The service failed to respond") rescue ::Exception => e - print_error("#{rhost}:#{rport} #{e} #{e.backtrace}") + print_error("#{ip}:#{rport} - #{e} #{e.backtrace}") end end