Skip to content

Commit 2f8188e

Browse files
committed
ftp_version: Use FTP mixin
1 parent a263f5a commit 2f8188e

1 file changed

Lines changed: 4 additions & 21 deletions

File tree

modules/auxiliary/scanner/ftp/ftp_version.rb

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
class MetasploitModule < Msf::Auxiliary
77
include Msf::Exploit::Remote::Ftp
88
include Msf::Auxiliary::Scanner
9-
include Msf::Auxiliary::Report
109

1110
def initialize
1211
super(
@@ -29,33 +28,17 @@ def initialize
2928
]
3029
)
3130

32-
# XXXX: One day, might be nice to enum via doing: `send_cmd(['xxx'])` {STAT,SYST,FEAT}
31+
# TODO: One day, might be nice to enum via doing: `send_cmd(['xxx'])` {STAT,SYST,FEAT}
3332
deregister_options('FTPUSER', 'FTPPASS')
3433
end
3534

36-
def sanitize_ftp_response(str)
37-
Rex::Text.to_hex_ascii(str.to_s.gsub(/^\d{3}[\s-]/, '').strip.gsub(/\A\(|\)\z/, ''))
38-
end
39-
4035
def run_host(_target_host)
4136
connect(true, false)
4237

4338
if banner
44-
banner_sanitized = sanitize_ftp_response(banner)
45-
print_good("FTP Banner: #{banner_sanitized}")
46-
report_service(
47-
host: rhost,
48-
port: rport,
49-
name: 'ftp',
50-
info: banner_sanitized
51-
)
52-
report_note(
53-
host: rhost,
54-
port: rport,
55-
proto: 'tcp',
56-
type: 'ftp.banner',
57-
data: { banner: banner.strip }
58-
)
39+
print_good("FTP Banner: #{Rex::Text.to_hex_ascii(banner_version)}")
40+
else
41+
vprint_warning('No FTP banner received')
5942
end
6043
rescue ::Rex::ConnectionRefused
6144
vprint_error('Connection refused')

0 commit comments

Comments
 (0)