class Rex::Proto::Kerberos::Pac::ClientInfo

This class provides a representation of a PAC-CLIENT-INFO structure, containing the client's name and authentication time. It's used to verify which the ticket's client is the PAC's owner.

Attributes

client_id[RW]

@!attribute client_id

@return [Time] The auth_time field of the Kerberos KDC-AS response.
name[RW]

@!attribute name

@return [String] The client name from the ticket

Public Instance Methods

encode() click to toggle source

Encodes the Rex::Proto::Kerberos::Pac::ClientInfo

@return [String]

# File lib/rex/proto/kerberos/pac/client_info.rb, line 20
def encode
  encoded = ''
  encoded << encode_client_id
  encoded << [name.length * 2].pack('v')
  encoded << encode_name

  encoded
end

Private Instance Methods

encode_client_id() click to toggle source

Encodes the client_id attribute

@return [String]

# File lib/rex/proto/kerberos/pac/client_info.rb, line 34
def encode_client_id
  file_time = (client_id.to_i + 11644473600) * 10000000
  encoded = ''
  encoded << [file_time].pack('Q<')

  encoded
end
encode_name() click to toggle source

Encodes the name attribute

@return [String]

# File lib/rex/proto/kerberos/pac/client_info.rb, line 45
def encode_name
  Rex::Text.to_unicode(name)
end