Land #17873, add ensure disconnect to ftp login
Add ensure disconnect to ftp login module and ftp timeout configuration
This commit is contained in:
commit
9563466037
|
@ -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)
|
||||
|
|
|
@ -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'],
|
||||
|
|
Loading…
Reference in New Issue