Class: Msf::Exploit::Remote::Kerberos::Ticket::Storage::Base

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Auxiliary::Report
Defined in:
lib/msf/core/exploit/remote/kerberos/ticket/storage/base.rb

Direct Known Subclasses

None, ReadOnly, ReadWrite, WriteOnly

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Auxiliary::Report

#active_db?, #create_cracked_credential, #create_credential, #create_credential_and_login, #create_credential_login, #db, #db_warning_given?, #get_client, #get_host, #inside_workspace_boundary?, #invalidate_login, #mytask, #myworkspace, #myworkspace_id, #report_auth_info, #report_client, #report_exploit, #report_host, #report_loot, #report_note, #report_service, #report_vuln, #report_web_form, #report_web_page, #report_web_site, #report_web_vuln, #store_cred, #store_local, #store_loot

Methods included from Metasploit::Framework::Require

optionally, optionally_active_record_railtie, optionally_include_metasploit_credential_creation, #optionally_include_metasploit_credential_creation, optionally_require_metasploit_db_gem_engines

Constructor Details

#initialize(framework: nil, framework_module: nil) ⇒ Base

Returns a new instance of Base.



14
15
16
17
# File 'lib/msf/core/exploit/remote/kerberos/ticket/storage/base.rb', line 14

def initialize(framework: nil, framework_module: nil)
  @framework = framework || framework_module&.framework
  @framework_module = framework_module
end

Instance Attribute Details

#frameworkObject (readonly)

Returns the value of attribute framework.



8
9
10
# File 'lib/msf/core/exploit/remote/kerberos/ticket/storage/base.rb', line 8

def framework
  @framework
end

#framework_moduleObject (readonly)

Returns the value of attribute framework_module.



12
13
14
# File 'lib/msf/core/exploit/remote/kerberos/ticket/storage/base.rb', line 12

def framework_module
  @framework_module
end

Instance Method Details

#activate_ccache(ids) ⇒ Array<StoredTicket>

Mark ccache(s) as active

Parameters:

  • ids (Array<Integer>)

    The list of ccache IDs.

Returns:



76
77
78
# File 'lib/msf/core/exploit/remote/kerberos/ticket/storage/base.rb', line 76

def activate_ccache(ids)
  []
end

#deactivate_ccache(ids) ⇒ Array<StoredTicket>

Mark ccache(s) as inactive

Parameters:

  • ids (Array<Integer>)

    The list of ccache IDs.

Returns:



68
69
70
# File 'lib/msf/core/exploit/remote/kerberos/ticket/storage/base.rb', line 68

def deactivate_ccache(ids)
  []
end

#delete_tickets(options = {}) ⇒ Array<StoredTicket>

Delete tickets matching the options query.

Parameters:

  • options (Hash) (defaults to: {})

    See the options hash description in #tickets.

Options Hash (options):

  • :ids (Array<Integer>)

    The identifiers of the tickets to delete (optional)

Returns:



24
25
26
# File 'lib/msf/core/exploit/remote/kerberos/ticket/storage/base.rb', line 24

def delete_tickets(options = {})
  []
end

#load_credential(options = {}) ⇒ Rex::Proto::Kerberos::CredentialCache::Krb5CcacheCredential?

Load a stored credential object that is suitable for authentication.

Parameters:

  • options (Hash) (defaults to: {})

    See the options description in #tickets.

Returns:



49
50
51
# File 'lib/msf/core/exploit/remote/kerberos/ticket/storage/base.rb', line 49

def load_credential(options = {})
  nil
end

#store_ccache(ccache, options = {}) ⇒ Hash

Store the specified object.

Parameters:

Returns:

  • (Hash)
    • :path [String] The path to the persisted ccache file if successful



60
61
62
# File 'lib/msf/core/exploit/remote/kerberos/ticket/storage/base.rb', line 60

def store_ccache(ccache, options = {})
  {}
end

#tickets(options = {}, &block) ⇒ Array<StoredTicket>

Get stored tickets matching the options query.

Parameters:

  • options (Hash) (defaults to: {})

    The options for matching tickets. The :realm, :server, :client and :status options are all processed as a group. If any one or more of them are specified, they are all used for filtering. It can not for example specify client and fetch all tickets for a particular client where the server is different.

Options Hash (options):

  • :id (Integer, Array<Integer>)

    The identifier of the ticket (optional)

  • :host (String)

    The host for the ticket (optional)

  • :realm (String)

    The realm of the ticket (optional)

  • :server (String)

    The service name of the ticket (optional)

  • :client (String)

    The client username of the ticket (optional)

  • :status (Symbol)

    The ticket status, defaults to valid (optional)

Returns:



40
41
42
# File 'lib/msf/core/exploit/remote/kerberos/ticket/storage/base.rb', line 40

def tickets(options = {}, &block)
  []
end

#workspaceString

Returns The name of the workspace in which to operate.

Returns:

  • (String)

    The name of the workspace in which to operate.



81
82
83
84
85
86
87
# File 'lib/msf/core/exploit/remote/kerberos/ticket/storage/base.rb', line 81

def workspace
  if @framework_module
    return @framework_module.workspace
  elsif @framework&.db&.active
    return @framework.db.workspace&.name
  end
end