Class: Metasploit::Framework::LoginScanner::AFP

Inherits:
Object
  • Object
show all
Includes:
AFP::Client, Base, RexSocket, Tcp::Client
Defined in:
lib/metasploit/framework/login_scanner/afp.rb

Overview

This is the LoginScanner class for dealing with Apple Filing Protocol.

Constant Summary collapse

DEFAULT_PORT =
548
LIKELY_PORTS =
[ DEFAULT_PORT ]
LIKELY_SERVICE_NAMES =
[ "afp" ]
PRIVATE_TYPES =
[ :password ]
REALM_KEY =
nil

Instance Attribute Summary collapse

Attributes included from Tcp::Client

#max_send_size, #send_delay, #sock

Instance Method Summary collapse

Methods included from AFP::Client

#close_session, #get_body, #get_info, #login, #next_id, #no_user_authent_login, #open_session, #parse_flags, #parse_header, #parse_info_response, #parse_login_response_add_send_login_count, #parse_network_addresses, #parse_open_session_response, #read_array, #read_pascal_string, #read_utf8_pascal_string

Methods included from Tcp::Client

#chost, #connect, #cport, #disconnect, #proxies, #rhost, #rport, #set_tcp_evasions, #ssl, #ssl_version

Instance Attribute Details

#login_timeoutInteger

Returns Number of seconds to wait before giving up.

Returns:

  • (Integer)

    Number of seconds to wait before giving up



26
27
28
# File 'lib/metasploit/framework/login_scanner/afp.rb', line 26

def 
  @login_timeout
end

Instance Method Details

#attempt_login(credential) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/metasploit/framework/login_scanner/afp.rb', line 28

def (credential)
  begin
    connect
  rescue Rex::ConnectionError, EOFError, Timeout::Error
    status = Metasploit::Model::Login::Status::UNABLE_TO_CONNECT
  else
    begin
      success = (credential.public, credential.private)
    rescue RuntimeError => e
      return {:status => Metasploit::Model::Login::Status::UNABLE_TO_CONNECT, :proof => e.message}
    end

    status = (success == true) ? Metasploit::Model::Login::Status::SUCCESSFUL : Metasploit::Model::Login::Status::INCORRECT
  end

  result = Result.new(credential: credential, status: status)
  result.host         = host
  result.port         = port
  result.protocol     = 'tcp'
  result.service_name = 'afp'
  result
end

#set_sane_defaultsObject



51
52
53
54
55
56
# File 'lib/metasploit/framework/login_scanner/afp.rb', line 51

def set_sane_defaults
  self.connection_timeout ||= 30
  self.port               ||= DEFAULT_PORT
  self.max_send_size      ||= 0
  self.send_delay         ||= 0
end