diff --git a/lib/msf/core/exploit/remote/ftp.rb b/lib/msf/core/exploit/remote/ftp.rb index 1970423a1f..0590d6d33b 100644 --- a/lib/msf/core/exploit/remote/ftp.rb +++ b/lib/msf/core/exploit/remote/ftp.rb @@ -56,7 +56,15 @@ module Exploit::Remote::Ftp # Wait for a banner to arrive... self.banner = recv_ftp_resp(fd) - print_status("Connected to target FTP server.") if verbose + # 220 (vsFTPd 2.3.4)\x0d\x0a -> vsFTPd 2.3.4 + # 220 ProFTPD 1.3.1 Server (Debian) [::ffff:10.0.0.10]\x0d\x0a -> ProFTPD 1.3.1 Server (Debian) + @banner_version = self.banner.to_s + .gsub(/^\d{3}[\s-]/, '') + .strip + .gsub(/\A\(|\)\z/, '') + .gsub(/\s*\[(?:(?:\d{1,3}\.){3}\d{1,3}|[0-9A-Fa-f:]*:[0-9A-Fa-f:.]+)\]/, '') + + print_status('Connected to target FTP server') if verbose # Return the file descriptor to the caller fd