Class: Msf::Exploit::Remote::Kerberos::Ticket::Storage::StoredTicket
- Inherits:
-
Object
- Object
- Msf::Exploit::Remote::Kerberos::Ticket::Storage::StoredTicket
- 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
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #ccache ⇒ Rex::Proto::Kerberos::CredentialCache::Krb5Ccache
-
#expired?(now = Time.now) ⇒ TrueClass, FalseClass
True if the ticket is valid within the starttime/authtime/endtime, false otherwise.
-
#host_address ⇒ String
The host address.
- #id ⇒ Object
-
#info ⇒ String
Human readable info about the ticket.
-
#initialize(loot) ⇒ StoredTicket
constructor
A new instance of StoredTicket.
- #path ⇒ Object
- #principal ⇒ Object
- #sname ⇒ Object
- #starttime ⇒ Object
Constructor Details
#initialize(loot) ⇒ StoredTicket
Returns a new instance of StoredTicket.
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
#status ⇒ Object (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
#ccache ⇒ Rex::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.
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_address ⇒ String
Returns 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 |
#id ⇒ Object
12 13 14 |
# File 'lib/msf/core/exploit/remote/kerberos/ticket/storage/stored_ticket.rb', line 12 def id @loot.id end |
#info ⇒ String
Returns 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 |
#path ⇒ Object
21 22 23 |
# File 'lib/msf/core/exploit/remote/kerberos/ticket/storage/stored_ticket.rb', line 21 def path loot.path end |
#principal ⇒ Object
25 26 27 |
# File 'lib/msf/core/exploit/remote/kerberos/ticket/storage/stored_ticket.rb', line 25 def principal credential.client end |
#sname ⇒ Object
29 30 31 |
# File 'lib/msf/core/exploit/remote/kerberos/ticket/storage/stored_ticket.rb', line 29 def sname credential.server end |
#starttime ⇒ Object
33 34 35 |
# File 'lib/msf/core/exploit/remote/kerberos/ticket/storage/stored_ticket.rb', line 33 def starttime credential.starttime end |