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

Inherits:
Object
  • Object
show all
Defined in:
lib/msf/core/exploit/remote/kerberos/ticket/storage/stored_ticket.rb

Overview

A StoredTicket object that internally holds a TGT/TGS object. This class abstracts the underlying persistence implementation, as currently this data is stored as Mdm::Loot - but in the future may be migrated to a Metasploit::Credential::Login or similar in the future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(loot) ⇒ StoredTicket

Returns a new instance of StoredTicket.

Parameters:

  • loot (Mdm::Loot)


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

def initialize(loot)
  @loot = loot
  parse_loot_info
end

Instance Attribute Details

#statusObject (readonly)

Returns the value of attribute status.



54
55
56
# File 'lib/msf/core/exploit/remote/kerberos/ticket/storage/stored_ticket.rb', line 54

def status
  @status
end

Instance Method Details

#ccacheRex::Proto::Kerberos::CredentialCache::Krb5Ccache



38
39
40
# File 'lib/msf/core/exploit/remote/kerberos/ticket/storage/stored_ticket.rb', line 38

def ccache
  @ccache ||= Rex::Proto::Kerberos::CredentialCache::Krb5Ccache.read(loot.data)
end

#expired?(now = Time.now) ⇒ TrueClass, FalseClass

Returns True if the ticket is valid within the starttime/authtime/endtime, false otherwise.

Returns:

  • (TrueClass, FalseClass)

    True if the ticket is valid within the starttime/authtime/endtime, false otherwise



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

def expired?(now = Time.now)
  tkt_start = credential.starttime == Time.at(0).utc ? credential.authtime : credential.starttime
  tkt_end = credential.endtime
  !(tkt_start < now && now < tkt_end)
end

#host_addressString

Returns the host address.

Returns:

  • (String)

    the host address



17
18
19
# File 'lib/msf/core/exploit/remote/kerberos/ticket/storage/stored_ticket.rb', line 17

def host_address
  loot.host && loot.host.address ? loot.host.address : ''
end

#idObject



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

def id
  @loot.id
end

#infoString

Returns human readable info about the ticket.

Returns:

  • (String)

    human readable info about the ticket



43
44
45
# File 'lib/msf/core/exploit/remote/kerberos/ticket/storage/stored_ticket.rb', line 43

def info
  loot.info
end

#pathObject



21
22
23
# File 'lib/msf/core/exploit/remote/kerberos/ticket/storage/stored_ticket.rb', line 21

def path
  loot.path
end

#principalObject



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

def principal
  credential.client
end

#snameObject



29
30
31
# File 'lib/msf/core/exploit/remote/kerberos/ticket/storage/stored_ticket.rb', line 29

def sname
  credential.server
end

#starttimeObject



33
34
35
# File 'lib/msf/core/exploit/remote/kerberos/ticket/storage/stored_ticket.rb', line 33

def starttime
  credential.starttime
end