Class: Rex::Proto::Kerberos::Pac::Krb5UpnDnsInfo
- Inherits:
-
BinData::Record
- Object
- BinData::Record
- Rex::Proto::Kerberos::Pac::Krb5UpnDnsInfo
- Defined in:
- lib/rex/proto/kerberos/pac/krb5_pac.rb
Overview
See [2.10 UPN_DNS_INFO](learn.microsoft.com/en-us/openspecs/windows_protocols/ms-pac/1c0d6e11-6443-4846-b744-f9f810a504eb)
Instance Attribute Summary collapse
-
#dns_domain_name ⇒ String
The DNS Domain Name (e.g. WINDOMAIN.LOCAL).
-
#dns_domain_name_length ⇒ Integer
The length of the DNS domain name.
-
#dns_domain_name_offset ⇒ Integer
The relative offset of the DNS domain name from the beginning of this structure.
-
#flags ⇒ Integer
U flag (bit 0) The user account object does not have the userPrincipalName attribute.
-
#sam_name ⇒ String
The SAM Name (e.g. test).
-
#sam_name_length ⇒ Integer
Only available if the S flag is set.
-
#sam_name_offset ⇒ Integer
Only available if the S flag is set.
-
#sid ⇒ MsDtypSid
The SID (e.g. S-1-5-32-544).
-
#sid_length ⇒ Integer
Only available if the S flag is set.
-
#sid_offset ⇒ Integer
Only available if the S flag is set.
-
#ul_type ⇒ Integer
readonly
Describes the type of data present in the buffer.
-
#upn ⇒ String
The UPN (User Principal Name) (e.g. test@windomain.local).
-
#upn_length ⇒ Integer
The length of the UPN.
-
#upn_offset ⇒ Integer
The relative offset of the UPN from the beginning of this structure.
Instance Method Summary collapse
- #do_num_bytes ⇒ Object
-
#has_s_flag? ⇒ Boolean
def initialize_instance(*args) super set_offsets! end.
-
#has_u_flag? ⇒ Boolean
Returns the value of the U flag.
-
#set_offsets!(upn: nil, dns_domain_name: nil, sam_name: nil, sid: nil) ⇒ void
Allows you to specify the offsets for the contents, otherwise defaults them.
- #set_s_flag(bool) ⇒ void
- #set_u_flag(bool) ⇒ void
Instance Attribute Details
#dns_domain_name ⇒ String
Returns The DNS Domain Name (e.g. WINDOMAIN.LOCAL).
730 731 732 |
# File 'lib/rex/proto/kerberos/pac/krb5_pac.rb', line 730 delayed_io :dns_domain_name, read_abs_offset: -> { self.abs_offset + dns_domain_name_offset } do string16 read_length: :dns_domain_name_length end |
#dns_domain_name_length ⇒ Integer
Returns The length of the DNS domain name.
689 |
# File 'lib/rex/proto/kerberos/pac/krb5_pac.rb', line 689 uint16 :dns_domain_name_length, value: -> { dns_domain_name.num_bytes } |
#dns_domain_name_offset ⇒ Integer
Returns The relative offset of the DNS domain name from the beginning of this structure.
693 |
# File 'lib/rex/proto/kerberos/pac/krb5_pac.rb', line 693 uint16 :dns_domain_name_offset |
#flags ⇒ Integer
U flag (bit 0) The user account object does not have the userPrincipalName attribute. S flag (bit 1) The structure has been extended with the user account’s SAM Name and SID. The remaining bits are ignored.
700 |
# File 'lib/rex/proto/kerberos/pac/krb5_pac.rb', line 700 uint32 :flags |
#sam_name ⇒ String
Returns The SAM Name (e.g. test).
736 737 738 |
# File 'lib/rex/proto/kerberos/pac/krb5_pac.rb', line 736 delayed_io :sam_name, read_abs_offset: -> { self.abs_offset + sam_name_offset }, onlyif: -> { has_s_flag? } do string16 read_length: :sam_name_length end |
#sam_name_length ⇒ Integer
Only available if the S flag is set
705 |
# File 'lib/rex/proto/kerberos/pac/krb5_pac.rb', line 705 uint16 :sam_name_length, value: -> { sam_name.num_bytes }, onlyif: :has_s_flag? |
#sam_name_offset ⇒ Integer
Only available if the S flag is set
710 |
# File 'lib/rex/proto/kerberos/pac/krb5_pac.rb', line 710 uint16 :sam_name_offset, onlyif: :has_s_flag? |
#sid ⇒ MsDtypSid
Returns The SID (e.g. S-1-5-32-544).
742 743 744 |
# File 'lib/rex/proto/kerberos/pac/krb5_pac.rb', line 742 delayed_io :sid, read_abs_offset: -> { self.abs_offset + sid_offset }, onlyif: -> { has_s_flag? } do ms_dtyp_sid end |
#sid_length ⇒ Integer
Only available if the S flag is set
715 |
# File 'lib/rex/proto/kerberos/pac/krb5_pac.rb', line 715 uint16 :sid_length, value: -> { sid.num_bytes }, onlyif: :has_s_flag? |
#sid_offset ⇒ Integer
Only available if the S flag is set
720 |
# File 'lib/rex/proto/kerberos/pac/krb5_pac.rb', line 720 uint16 :sid_offset, onlyif: :has_s_flag? |
#ul_type ⇒ Integer (readonly)
Returns Describes the type of data present in the buffer.
677 |
# File 'lib/rex/proto/kerberos/pac/krb5_pac.rb', line 677 virtual :ul_type, value: Krb5PacElementType::USER_PRINCIPAL_NAME_AND_DNS_INFORMATION |
#upn ⇒ String
Returns The UPN (User Principal Name) (e.g. test@windomain.local).
724 725 726 |
# File 'lib/rex/proto/kerberos/pac/krb5_pac.rb', line 724 delayed_io :upn, read_abs_offset: -> { self.abs_offset + upn_offset } do string16 read_length: :upn_length end |
#upn_length ⇒ Integer
Returns The length of the UPN.
681 |
# File 'lib/rex/proto/kerberos/pac/krb5_pac.rb', line 681 uint16 :upn_length, value: -> { upn.num_bytes } |
#upn_offset ⇒ Integer
Returns The relative offset of the UPN from the beginning of this structure.
685 |
# File 'lib/rex/proto/kerberos/pac/krb5_pac.rb', line 685 uint16 :upn_offset |
Instance Method Details
#do_num_bytes ⇒ Object
746 747 748 749 750 751 752 753 |
# File 'lib/rex/proto/kerberos/pac/krb5_pac.rb', line 746 def do_num_bytes if has_s_flag? result = sid_offset + sid_length else result = dns_domain_name_offset + dns_domain_name_length end result end |
#has_s_flag? ⇒ Boolean
def initialize_instance(*args)
super
set_offsets!
end
760 761 762 |
# File 'lib/rex/proto/kerberos/pac/krb5_pac.rb', line 760 def has_s_flag? flags.anybits?(0b10) end |
#has_u_flag? ⇒ Boolean
Returns the value of the U flag
771 772 773 |
# File 'lib/rex/proto/kerberos/pac/krb5_pac.rb', line 771 def has_u_flag? flags.anybits?(0b01) end |
#set_offsets!(upn: nil, dns_domain_name: nil, sam_name: nil, sid: nil) ⇒ void
This method returns an undefined value.
Allows you to specify the offsets for the contents, otherwise defaults them
788 789 790 791 792 793 |
# File 'lib/rex/proto/kerberos/pac/krb5_pac.rb', line 788 def set_offsets!(upn: nil, dns_domain_name: nil, sam_name: nil, sid: nil) self.upn_offset = upn || calc_upn_offset self.dns_domain_name_offset = dns_domain_name || calc_dns_domain_name_offset self.sam_name_offset = sam_name || calc_sam_name_offset self.sid_offset = sid || calc_sid_offset end |
#set_s_flag(bool) ⇒ void
This method returns an undefined value.
766 767 768 |
# File 'lib/rex/proto/kerberos/pac/krb5_pac.rb', line 766 def set_s_flag(bool) set_flag_bit(1, bool) end |
#set_u_flag(bool) ⇒ void
This method returns an undefined value.
777 778 779 |
# File 'lib/rex/proto/kerberos/pac/krb5_pac.rb', line 777 def set_u_flag(bool) set_flag_bit(0, bool) end |