Path: blob/master/modules/auxiliary/scanner/ftp/ftp_version.rb
19500 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::Ftp7include Msf::Auxiliary::Scanner8include Msf::Auxiliary::Report910def initialize11super(12'Name' => 'FTP Version Scanner',13'Description' => 'Detect FTP Version.',14'Author' => 'hdm',15'License' => MSF_LICENSE16)1718register_options(19[20Opt::RPORT(21),21]22)23end2425def run_host(target_host)26begin27res = connect(true, false)2829if (banner)30banner_sanitized = Rex::Text.to_hex_ascii(self.banner.to_s)31print_good("FTP Banner: '#{banner_sanitized}'")32report_service(:host => rhost, :port => rport, :name => "ftp", :info => banner_sanitized)33end3435disconnect36rescue ::Interrupt37raise $!38rescue ::Rex::ConnectionError, ::IOError39end40end41end424344