ftp: Add banner_version

This commit is contained in:
g0t mi1k
2026-04-28 17:54:57 +01:00
parent 1a9e378dcf
commit 98f3bb1d84
+9 -1
View File
@@ -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