Land #17873, add ensure disconnect to ftp login

Add ensure disconnect to ftp login module and ftp timeout configuration
This commit is contained in:
Jack Heysel 2023-04-18 18:31:12 -04:00
commit 9563466037
No known key found for this signature in database
GPG Key ID: D373F2C24A2A1E70
2 changed files with 6 additions and 3 deletions

View File

@ -44,9 +44,10 @@ module Metasploit
rescue ::EOFError, Errno::ECONNRESET, Rex::ConnectionError, Rex::ConnectionTimeout, ::Timeout::Error
result_options[:status] = Metasploit::Model::Login::Status::UNABLE_TO_CONNECT
success = false
ensure
disconnect
end
if success
result_options[:status] = Metasploit::Model::Login::Status::SUCCESSFUL
elsif !(result_options.has_key? :status)

View File

@ -42,7 +42,8 @@ class MetasploitModule < Msf::Auxiliary
register_advanced_options(
[
OptBool.new('SINGLE_SESSION', [ false, 'Disconnect after every login attempt', false])
OptBool.new('SINGLE_SESSION', [ false, 'Disconnect after every login attempt', false]),
OptInt.new('CONNECTION_TIMEOUT', [true, 'Connection timeout for the FTP login scanner', 30])
]
)
@ -69,7 +70,8 @@ class MetasploitModule < Msf::Auxiliary
bruteforce_speed: datastore['BRUTEFORCE_SPEED'],
max_send_size: datastore['TCP::max_send_size'],
send_delay: datastore['TCP::send_delay'],
connection_timeout: 30,
connection_timeout: datastore['CONNECTION_TIMEOUT'],
ftp_timeout: datastore['FTPTimeout'],
framework: framework,
framework_module: self,
ssl: datastore['SSL'],