2010-01-15 03:25:34 +00:00
|
|
|
##
|
2013-10-15 18:50:46 +00:00
|
|
|
# This module requires Metasploit: http//metasploit.com/download
|
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2010-01-15 03:25:34 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Auxiliary
|
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
include Msf::Exploit::Remote::Ftp
|
|
|
|
include Msf::Auxiliary::Scanner
|
|
|
|
include Msf::Auxiliary::Report
|
2010-01-15 03:25:34 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def initialize
|
|
|
|
super(
|
|
|
|
'Name' => 'FTP Version Scanner',
|
|
|
|
'Description' => 'Detect FTP Version.',
|
|
|
|
'Author' => 'hdm',
|
|
|
|
'License' => MSF_LICENSE
|
|
|
|
)
|
2010-01-15 03:25:34 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
Opt::RPORT(21),
|
|
|
|
], self.class)
|
|
|
|
end
|
2010-01-15 03:25:34 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def run_host(target_host)
|
2010-01-15 03:25:34 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
begin
|
2010-01-15 03:25:34 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
res = connect(true, false)
|
2010-01-15 03:25:34 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
if(banner)
|
|
|
|
banner_sanitized = Rex::Text.to_hex_ascii(self.banner.to_s)
|
|
|
|
print_status("#{rhost}:#{rport} FTP Banner: '#{banner_sanitized}'")
|
|
|
|
report_service(:host => rhost, :port => rport, :name => "ftp", :info => banner_sanitized)
|
|
|
|
end
|
2010-01-15 03:25:34 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
disconnect
|
2010-01-15 03:25:34 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
rescue ::Interrupt
|
|
|
|
raise $!
|
|
|
|
rescue ::Rex::ConnectionError, ::IOError
|
|
|
|
end
|
2010-01-15 03:25:34 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
end
|
2010-01-15 03:25:34 +00:00
|
|
|
end
|