CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/auxiliary/scanner/ftp/ftp_version.rb
Views: 11784
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
class MetasploitModule < Msf::Auxiliary
7
include Msf::Exploit::Remote::Ftp
8
include Msf::Auxiliary::Scanner
9
include Msf::Auxiliary::Report
10
11
def initialize
12
super(
13
'Name' => 'FTP Version Scanner',
14
'Description' => 'Detect FTP Version.',
15
'Author' => 'hdm',
16
'License' => MSF_LICENSE
17
)
18
19
register_options(
20
[
21
Opt::RPORT(21),
22
])
23
end
24
25
def run_host(target_host)
26
27
begin
28
29
res = connect(true, false)
30
31
if(banner)
32
banner_sanitized = Rex::Text.to_hex_ascii(self.banner.to_s)
33
print_good("FTP Banner: '#{banner_sanitized}'")
34
report_service(:host => rhost, :port => rport, :name => "ftp", :info => banner_sanitized)
35
end
36
37
disconnect
38
39
rescue ::Interrupt
40
raise $!
41
rescue ::Rex::ConnectionError, ::IOError
42
end
43
44
end
45
end
46
47