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
- #enctype ⇒ Object
-
#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.
58 59 60 |
# File 'lib/msf/core/exploit/remote/kerberos/ticket/storage/stored_ticket.rb', line 58 def status @status end |
Instance Method Details
#ccache ⇒ Rex::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 |
#enctype ⇒ Object
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.
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_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.
47 48 49 |
# File 'lib/msf/core/exploit/remote/kerberos/ticket/storage/stored_ticket.rb', line 47 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 |