The Kerberos PAC: Structure, Validation, and Forgery
Concept
Section titled βConceptβWhen a security principal authenticates to an Active Directory KDC, the KDC constructs a binary structure known as the PAC and injects it into the encrypted payload of the TGT, and subsequently into requested TGS tickets.
The PAC encapsulates:
- Principal Security Identifiers: The accountβs primary SID (
UserSid) and primary group identifier (PrimaryGroupId). - Security Group Memberships: An exhaustive array of domain group RIDs (
GroupIds), along with cross-domain or legacy SIDs (ExtraSids/sIDHistory). - Cryptographic Integrity Signatures:
- Server Signature: Signed using the target service accountβs secret key (proves the receiving service did not tamper with the PAC).
- KDC Signature: Signed using the domain KDC
krbtgtkey (proves the PAC was authored by an authoritative KDC). - Ticket Signature & Full PAC Checksum (post CVE-2022-37967 / KB5020805): Modern cryptographic signatures preventing PAC manipulation and cross-service ticket reuse.
Why It Matters in DFIR
Section titled βWhy It Matters in DFIRβThe PAC is the primary structural target of high-impact Windows privilege escalation techniques:
- PAC Forgery (Golden / Diamond / Silver Tickets): An adversary possessing
krbtgtkeys or service account hashes can fabricate a synthetic PAC, granting themselves arbitrary high-privilege memberships likeDomain Admins(RID 512). - Historical Elevation Flaws (MS14-068 / CVE-2014-6324 and CVE-2021-42287): Vulnerabilities allowing low-privilege users to induce the KDC to sign forged PACs or spoof machine sAMAccountNames (noPac), delivering instantaneous domain dominance.
- Target Service PAC Validation: Understanding when a member server initiates a Netlogon RPC validation call (
LogonSamLogonEx) to verify a PAC explains network telemetry that might otherwise be misdiagnosed as rogue DC traffic.
How It Works
Section titled βHow It WorksβAnatomy of an MS-PAC Structure
Section titled βAnatomy of an MS-PAC Structureββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ PAC STRUCTURE βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€β 1. PACTYPE Header (Buffer count and version) βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€β 2. KERB_VALIDATION_INFO (Logon Info Buffer): ββ - User SID: S-1-5-21-DOM-1001 ββ - Group RIDs: [513, 1105, 1108] ββ - sIDHistory / ExtraSids: [S-1-5-21-OLD-512] ββ - UserAccountControl flags βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€β 3. PAC_CLIENT_INFO (Account name and logon timestamp) βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€β 4. SERVER_SIGNATURE (Encrypted with Service key) βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€β 5. KDC_SIGNATURE (Encrypted with krbtgt key) βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€β 6. PAC_ATTRIBUTES_INFO (PAC flags and state) βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€β 7. FULL_PAC_CHECKSUM (Cryptographic HMAC signature) βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββThe PAC Verification Workflow
Section titled βThe PAC Verification Workflowβ- Upon receiving a TGS, the target workload decrypts the ticket using its own secret account key (computer machine account or service account).
- It verifies the Server Signature across the PAC.
- If valid, the host Local Security Authority (LSA) extracts the SIDs and constructs the userβs Access Token.
- DC Verification (Optional/Conditional): For sensitive services running under high privileges, the server can issue an RPC Netlogon query to an authoritative DC to validate the authenticity of the KDC Signature.
What Is Possible
Section titled βWhat Is Possibleβ- Dumping and Inspecting PAC Payloads in Memory: DFIR tools (Mimikatz
kerberos::list /export, Rubeustriage, Wireshark) can decode the raw ASN.1/NDR PAC stream from memory or network captures. - Fabricating Arbitrary Group SIDs with
krbtgt: Possessing the domainkrbtgthash allows an attacker to forge a PAC containing any combination of SIDs with a valid KDC signature. - Enforcing Cryptographic Signatures: Recent Windows Server security updates enforce mandatory Full PAC signatures, blocking legacy forged tickets.
What Is Not Possible
Section titled βWhat Is Not Possibleβ- Tampering with In-Flight PAC SIDs Without Invalidation: An adversary intercepting a Kerberos ticket cannot inject new SIDs without breaking the cryptographic Server and KDC signatures.
- Bypassing KDC Validation on RPC-Validating Services (Silver Tickets): In Silver Ticket attacks where only the service key is known, if the target server forwards the PAC to a DC for validation, the forged KDC signature fails and access is denied.
- Persisting Indefinitely After Group Removal Without Ticket Lifetime: SIDs inside a PAC remain static during the ticketβs valid lifetime (typically 10 hours). Once the ticket expires, the user must request a new ticket reflecting updated group memberships.
Common DFIR Confusions
Section titled βCommon DFIR Confusionsβ| Frequent Confusion | Verifiable Forensic Reality |
|---|---|
| βA Kerberos ticket proves current group membership in Active Directory.β | No. The PAC reflects group memberships at the time the TGT was requested. If an account was removed from an admin group 1 hour ago, its active PAC still retains administrative RIDs until ticket expiration. |
| βA Silver Ticket contains a valid KDC signature.β | False. An attacker forging a Silver Ticket lacks the krbtgt key and inserts a dummy KDC signature. It only succeeds if the target server skips remote DC validation. |
| βAll Windows services validate PACs against the DC.β | The majority of member servers only validate the Server Signature locally for performance optimization. |
Concrete Forensic Example
Section titled βConcrete Forensic ExampleβDuring post-compromise forensic analysis, an investigator dumps residual Kerberos tickets from memory on a compromised SQL server:
Rubeus.exe dump /luid:0x3e7extracts an active service ticket presented forMSSQLSvc/sql01.corp.local.- Decoding the PAC reveals:
- Client name:
guest - Encapsulated
GroupIds: RID 512 (Domain Admins), RID 519 (Enterprise Admins). - KDC Signature: HMAC-MD5 (RC4), despite the domain enforcing AES-256 exclusively for over 4 years.
- Client name:
- DC Event 4769 logs for that timestamp show zero TGS requests for
guesttargetingsql01. - Irrefutable Finding: The ticket was fabricated offline (Silver Ticket) using the stolen SQL service account hash.
Key Forensic Artefacts
Section titled βKey Forensic Artefactsβ- DC Event Logs (PAC Hardening and Violations):
- Event ID 30 (Microsoft-Windows-Kerberos-Key-Distribution-Center): Rejection of a ticket with an unsigned PAC or missing CVE-2022-37967 signatures.
- Event ID 31: Warning regarding tickets presenting weak or legacy PAC signatures.
- Member Host Security Logs:
- Event ID 4624: Token security attributes populated directly from the parsed PAC.
- Network Telemetry:
- Pre-authentication
padatatypePA-PAC-REQUEST(type 128) inAS-REQpackets. - ASN.1
AuthorizationDatastructures encapsulating the raw MS-PAC stream.
- Pre-authentication
Investigation Methods
Section titled βInvestigation Methodsβ- Extract and Decode Memory-Resident Kerberos Tickets: Dump cached tickets on suspect hosts to inspect embedded SIDs and compare with actual directory memberships.
- Audit Ticket Encryption Algorithms:
Flag tickets utilizing RC4 encryption (
0x17) in domains where modern AES algorithms are standardized. - Monitor System Logs on Domain Controllers:
Query
Microsoft-Windows-Kerberos-Key-Distribution-Centerevents 30 through 32 for evidence of rejected or forged PAC tickets.
Investigative Tooling
Section titled βInvestigative Toolingβ- Rubeus:
Terminal window Rubeus.exe triageRubeus.exe dump /nowrap - Wireshark:
Filter:
kerberos.pac.client_nameto examine cleartext PAC header fields in network streams. - Klist:
Terminal window klist get cifs/dc01.corp.local
Key Takeaways
Section titled βKey Takeawaysβ- The PAC is Microsoftβs extension that transports authorization SIDs and privileges within Kerberos tickets.
- The PAC is protected by two primary signatures: the Service key and the
krbtgtkey. - Compromising
krbtgtallows fabricating arbitrary PAC memberships (Golden Tickets). - Silver Tickets lack valid KDC signatures and fail against services enforcing remote DC validation.
References & Further Reading
Section titled βReferences & Further Readingβ- Microsoft Learn: MS-PAC Privilege Attribute Certificate Data Structure
- Microsoft Support: KB5020805 - Managing Kerberos Changes Related to CVE-2022-37967
- Card 21 β NTLM vs Kerberos: Fundamental Differences in DFIR Investigations
- Card 27 β Golden Ticket vs Silver Ticket: Creation, Scope, and Detection