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.



58
59
60
# File 'lib/msf/core/exploit/remote/kerberos/ticket/storage/stored_ticket.rb', line 58

def status
  @status
end

Instance Method Details

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



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

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

#enctypeObject



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

def enctype
  credential.keyblock.enctype
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



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

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



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

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