Class: Rex::Proto::Kerberos::Keytab::Krb5KeytabEntry
- Inherits:
-
BinData::Record
- Object
- BinData::Record
- Rex::Proto::Kerberos::Keytab::Krb5KeytabEntry
- Defined in:
- lib/rex/proto/kerberos/keytab/krb5_keytab.rb
Constant Summary collapse
- LEN_FIELD_BYTE_SIZE =
Returns The number of bytes for the len field.
4
Instance Attribute Summary collapse
-
#components ⇒ Array<CountedOctetString>
The components in the principal name, which can be joined by slashes to represent the SPN.
- #count_of_components ⇒ Integer
- #flags ⇒ Integer
- #keyblock ⇒ KeytabKeyBlock
-
#len ⇒ Integer
The number of remaining bytes for this record.
- #name_type ⇒ Integer
- #realm# ⇒ CountedOctetString
-
#timestamp ⇒ Integer
The time the key entry was created; Can be 0 for keytabs generated by ktpass.
- #vno ⇒ Integer
-
#vno8 ⇒ Integer
The lower 8 bits of the version number of the key.
Instance Method Summary collapse
-
#principal ⇒ String
The principal associated with this key tab entry.
Instance Attribute Details
#components ⇒ Array<CountedOctetString>
Returns The components in the principal name, which can be joined by slashes to represent the SPN.
95 |
# File 'lib/rex/proto/kerberos/keytab/krb5_keytab.rb', line 95 array :components, initial_length: :count_of_components, type: :counted_octet_string |
#count_of_components ⇒ Integer
86 |
# File 'lib/rex/proto/kerberos/keytab/krb5_keytab.rb', line 86 uint16 :count_of_components, value: -> { components.length } |
#flags ⇒ Integer
123 124 125 |
# File 'lib/rex/proto/kerberos/keytab/krb5_keytab.rb', line 123 uint32 :flags, # only present if >= 4 bytes left in entry onlyif: -> { ((len + LEN_FIELD_BYTE_SIZE) - flags.rel_offset) >= 4 } |
#keyblock ⇒ KeytabKeyBlock
112 |
# File 'lib/rex/proto/kerberos/keytab/krb5_keytab.rb', line 112 keyblock :keyblock |
#len ⇒ Integer
Returns The number of remaining bytes for this record. The length does not include the 4 bytes for this field.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/rex/proto/kerberos/keytab/krb5_keytab.rb', line 67 int32 :len, value: -> { size = [ count_of_components, realm, components, name_type, , vno8, keyblock, vno, flags ].sum { |field| field.to_binary_s.bytes.count } size } |
#name_type ⇒ Integer
100 |
# File 'lib/rex/proto/kerberos/keytab/krb5_keytab.rb', line 100 uint32 :name_type |
#realm# ⇒ CountedOctetString
90 |
# File 'lib/rex/proto/kerberos/keytab/krb5_keytab.rb', line 90 counted_octet_string :realm |
#timestamp ⇒ Integer
Returns The time the key entry was created; Can be 0 for keytabs generated by ktpass.
104 |
# File 'lib/rex/proto/kerberos/keytab/krb5_keytab.rb', line 104 epoch :timestamp |
#vno ⇒ Integer
116 117 118 119 |
# File 'lib/rex/proto/kerberos/keytab/krb5_keytab.rb', line 116 uint32 :vno, initial_value: -> { vno8.to_i }, # only present if >= 4 bytes left in entry onlyif: -> { ((len + LEN_FIELD_BYTE_SIZE) - vno.rel_offset) >= 4 } |
#vno8 ⇒ Integer
Returns The lower 8 bits of the version number of the key.
108 |
# File 'lib/rex/proto/kerberos/keytab/krb5_keytab.rb', line 108 uint8 :vno8 |
Instance Method Details
#principal ⇒ String
Returns The principal associated with this key tab entry.
128 129 130 |
# File 'lib/rex/proto/kerberos/keytab/krb5_keytab.rb', line 128 def principal "#{components.to_a.join('/')}@#{realm}" end |