Skip to content

Commit

Permalink
ticket parsing making fields optional
Browse files Browse the repository at this point in the history
  • Loading branch information
skelsec committed Dec 2, 2019
1 parent b794ebe commit ddbfda3
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions pypykatz/commons/kerberosticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,23 @@ def to_asn1(self):
def parse(kerberos_ticket, reader, sysinfo, type = None):
kt = KerberosTicket()
kt.type = type
kt.ServiceName_type = kerberos_ticket.ServiceName.read(reader).NameType
kt.ServiceName = kerberos_ticket.ServiceName.read(reader).read(reader)
kt.DomainName = kerberos_ticket.DomainName.read_string(reader)
if kerberos_ticket.ServiceName.read(reader):
kt.ServiceName_type = kerberos_ticket.ServiceName.read(reader).NameType
kt.ServiceName = kerberos_ticket.ServiceName.read(reader).read(reader)
if kerberos_ticket.DomainName:
kt.DomainName = kerberos_ticket.DomainName.read_string(reader)
if kerberos_ticket.TargetName.read(reader):
kt.ETargetName = kerberos_ticket.TargetName.read(reader).read(reader)
kt.ETargetName_type = kerberos_ticket.TargetName.read(reader).NameType
kt.TargetDomainName = kerberos_ticket.TargetDomainName.read_string(reader)
kt.EClientName = kerberos_ticket.ClientName.read(reader).read(reader)
kt.EClientName_type = kerberos_ticket.ClientName.read(reader).NameType
kt.AltTargetDomainName = kerberos_ticket.AltTargetDomainName.read_string(reader)
kt.Description = kerberos_ticket.Description.read_string(reader)
if kerberos_ticket.TargetDomainName:
kt.TargetDomainName = kerberos_ticket.TargetDomainName.read_string(reader)
if kerberos_ticket.ClientName:
kt.EClientName = kerberos_ticket.ClientName.read(reader).read(reader)
kt.EClientName_type = kerberos_ticket.ClientName.read(reader).NameType
if kerberos_ticket.AltTargetDomainName:
kt.AltTargetDomainName = kerberos_ticket.AltTargetDomainName.read_string(reader)
if kerberos_ticket.Description:
kt.Description = kerberos_ticket.Description.read_string(reader)

kt.StartTime = filetime_to_dt(kerberos_ticket.StartTime)
kt.EndTime = filetime_to_dt(kerberos_ticket.EndTime)
Expand Down

0 comments on commit ddbfda3

Please sign in to comment.