Path: blob/master/modules/auxiliary/scanner/imap/imap_version.rb
19591 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Remote::Imap7include Msf::Auxiliary::Scanner8include Msf::Auxiliary::Report910def initialize11super(12'Name' => 'IMAP4 Banner Grabber',13'Description' => 'IMAP4 Banner Grabber',14'Author' => 'hdm',15'License' => MSF_LICENSE16)17end1819def run_host(ip)20begin21connect22banner_sanitized = Rex::Text.to_hex_ascii(banner.to_s)23print_good("#{ip}:#{rport} IMAP #{banner_sanitized}")24report_service(:host => rhost, :port => rport, :name => "imap", :info => banner)25rescue ::Rex::ConnectionError26rescue ::EOFError27print_error("#{ip}:#{rport} - The service failed to respond")28rescue ::Exception => e29print_error("#{ip}:#{rport} - #{e} #{e.backtrace}")30end31end32end333435