Class: Metasploit::Framework::LoginScanner::FTP
- Inherits:
-
Object
- Object
- Metasploit::Framework::LoginScanner::FTP
- Includes:
- Ftp::Client, Base, RexSocket
- Defined in:
- lib/metasploit/framework/login_scanner/ftp.rb
Overview
This is the LoginScanner class for dealing with FTP. It is responsible for taking a single target, and a list of credentials and attempting them. It then saves the results.
Constant Summary collapse
- DEFAULT_PORT =
21
- LIKELY_PORTS =
[ DEFAULT_PORT, 2121 ]
- LIKELY_SERVICE_NAMES =
[ 'ftp' ]
- PRIVATE_TYPES =
[ :password ]
- REALM_KEY =
nil
Instance Attribute Summary collapse
-
#ftp_timeout ⇒ Integer
The timeout in seconds to wait for a response to an FTP command.
Attributes included from Ftp::Client
Attributes included from Tcp::Client
#max_send_size, #send_delay, #sock
Instance Method Summary collapse
Methods included from Ftp::Client
#connect, #connect_login, #data_connect, #data_disconnect, #raw_send, #raw_send_recv, #recv_ftp_resp, #send_cmd, #send_cmd_data, #send_pass, #send_quit, #send_user
Methods included from Tcp::Client
#chost, #connect, #cport, #disconnect, #proxies, #rhost, #rport, #set_tcp_evasions, #ssl, #ssl_version
Instance Attribute Details
#ftp_timeout ⇒ Integer
Returns The timeout in seconds to wait for a response to an FTP command.
25 26 27 |
# File 'lib/metasploit/framework/login_scanner/ftp.rb', line 25 def ftp_timeout @ftp_timeout end |
Instance Method Details
#attempt_login(credential) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/metasploit/framework/login_scanner/ftp.rb', line 37 def attempt_login(credential) = { credential: credential } begin success = connect_login(credential.public, credential.private) rescue ::EOFError, Errno::ECONNRESET, Rex::ConnectionError, Rex::ConnectionTimeout, ::Timeout::Error [:status] = Metasploit::Model::Login::Status::UNABLE_TO_CONNECT success = false ensure disconnect end if success [:status] = Metasploit::Model::Login::Status::SUCCESSFUL elsif !(.has_key? :status) [:status] = Metasploit::Model::Login::Status::INCORRECT end result = ::Metasploit::Framework::LoginScanner::Result.new() result.host = host result.port = port result.protocol = 'tcp' result.service_name = 'ftp' result end |