Varonis announces strategic partnership with Microsoft to accelerate the secure adoption of Copilot.

Learn more

Fighting Golden Ticket Attacks with Privileged Attribute Certificate (PAC)

Learn how and why to control the Active Directory Environment state with PACRequestorEnforcement, the implications of doing so and how to detect Golden Ticket attacks happening in your network.
Masha Garmiza
4 min read
Last updated September 30, 2022

For the past several years, as part of security assessments and live attack scenarios, operators have attempted to pull off the well-known, but difficult-to-execute, Golden Ticket attack.

Malicious actors achieve this task by bypassing the Kerberos key distribution center (KDC) and impersonating a domain controller account (KRBTGT) to fabricate new ticket-granting tickets (TGTs) for the entire Active Directory, offline.

Later, the impersonated TGT is presented to the key distribution center (KDC) to obtain a service ticket with forged high privileges. While patch CVE-2021-42287 attempts to address Golden Ticket Attacks, attackers may still impersonate a user if they use its corresponding SID. The impersonated user privileges are non-relevant and its group membership can be forged.

Enter PAC guardrails

Authentication updates - KB5008380 patch was presented to address this vulnerability. The updates, which were made available in November 2021 and will be enforced from October 2022, intend to provide additional safeguards in the Kerberos privileged attribute certificate (PAC) with additional information about the account that requested the TGT.

In this post, we're going to talk in-depth about what PAC is, the updated PAC and how it is designed to improve the authentication process, why it's not a perfect solution, and how the enforcement will influence ticket impersonation and its detection.

What is a privileged attribute certificate?

The PAC data is responsible for user authorization. It contains permissions to access different services. The PAC data is copied from one ticket to another through the Kerberos authentication and authorization flow.

When a user first successfully authenticates to the key distribution center (AS_REQ), the user receives in response (AS_REP) a TGT containing encrypted PAC data of the user (steps one and two in the diagram below). The PAC in the TGT, contains the authorization data — a list of user memberships.

Later, when the user requests TGS to access specific services (TGS_REQ), the PAC is copied as-is from the TGT to the TGS (steps three and four below). When The TGS is used for access (AP_REQ), the service checks the PAC to validate the user's access permissions (step five).

Blog_NewPAC-and-GoldenTicket_BlogDiagram_202208_FNL (2)Figure 1: PAC data in the Kerberos flow

PAC authorization data resides in “KERB_VALIDATION_INFO” structure, under “GroupIds” property. PAC data is copied along the flow from the TGT to the TGS ticket to be used to access the desired service.

figure2

Figure 2: Decrypted KERB_VALIDATION_INFO structure from PAC of a domain user

The update presents a new data structure in PAC containing the user security identifier (SID). The SID is validated by the KDC (step three in the diagram above). The username (“cname”) from the ticket is resolved to SID and compared with the new PAC_REQUESTOR value:

figure3Figure 3: Decrypted PAC_REQUESTOR from PAC of a domain user

PACRequestorEnforcement: release phases and events

The PAC update is divided into three phases: initial deployment, second deployment, and enforcement.

According to Microsoft's documentation, the Active Directory environment state can be controlled with the PACRequestorEnforcement registry key to modify the desired PAC validation behavior. Security-conscious system administrators can now enable this, allowing them to better time the rollout.

Registry key value PAC validation November 2021: initial deployment July 2022: second deployment October 2022: enforcement
0 - Disabled The validation is disabled. Old PAC may be used. V NA NA
1 - Deployment Both old and new PAC may be used. If new structure PAC is used, the requestor is validated. V default NA
2 - Enforcement Authentication with old PAC is denied. The user requestor value is validated. V NA NA

Dividing the update into three phases means organizations will have enough time to understand the implications of the changes made. Once the new PAC is enforced, every account in the organization will need to re-authenticate, rendering the old Kerberos tickets useless, which can cause disruptions in production environments.

Along with the PAC validation updates, new system events are also available. The events found to be indicative of ticket-based attacks are events related to the PAC Requestor new field:

Event ID Name Description  
37 Ticket without requestor The KDC encountered ticket without PAC_REQUESTOR while requesting service ticket.  
38 Requestor mismatch The PAC_REQUESTOR_SID does not match what was resolved from the username  

/newPAC or /oldPAC?

Following this security update, offensive tools have also been updated to support both new and old PAC structures in forged tickets.

Picture4-1Figure 4: Mimikatz — Pull request, supporting new PAC structure by default
Picture5-1
Figure 5: Rubeus — flag supporting the updated PAC structure

However, forging TGT with new PAC but the default user SID, or using the old PAC in updated environment, will trigger the corresponding new events once the forged TGT is used.

PAC_REQUESTOR in practice

The new structure PAC_REQUESTOR is included in the new TGT PAC, and its value validated in the KDC on TGS request. What does it mean for Golden Ticket attacks and what can be detected by the new events?

“Ticket without requestor” — a TGT without the new PAC_REQUESTOR structure used.

In a deployment environment, this event might be an indicator of a successful attack because new PAC structure is not mandatory. Once the user is authenticated by the domain controller in deployment mode for the first time, a TGT is granted using the new updated PAC containing the requestor structure. Therefore, “ticket without requestor” events should be identified as a first indication of a possibly forged TGT. The event contains the impersonated user, but unfortunately not the source client host:

Picture6-1

Figure 6: System event 37 “ticket without requestor”

In an enforcement environment, the event indicates a failed attempt to use a TGT with an old PAC, after which the TGT will be revoked. An adversary may then try creating a TGT using the /newPAC and carry out successful Golden Ticket attack. Therefore, monitoring further user activity and TGS events (4769) is highly recommended.

“Requestor mismatch” — User SID does not match the username in TGT.

The new PAC_REQUESTOR data structure contains the user SID. When the TGT is presented to the KDC in the TGS request (KRB_TGS_REQ), the KDC performs validation where the user SID in the PAC_REQUESTOR must correspond to the cname in the TGS request. If they differ, the system event 38 “requestor mismatch” is flagged.

Picture7-1
Figure 7: System event 38 “requestor mismatch”

Both in deployment and enforcement environments, when a TGT with a new PAC is used to issue a TGS, the user ID will be validated. Traditionally, forging a TGT without explicitly mentioning the user ID results in a default of “500” (a user account for the system administrator).

Picture8-1
Figure 8: Mimikatz - User ID default value

Using this ticket causes a “request mismatch” event, and the TGT is revoked. Using the correct corresponding user ID, with forged high-privilege GroupIds membership leads to successful Golden Ticket attack. Although the impersonated user may not be a member of the mentioned groups, this information is not validated.

In the following comparison, we can see the original users PAC compared to PAC with SID mismatch and PAC with corresponding SID:

Click image to expand

Picture9-1
Figure 9: Comparison between original PAC of domain user with forged versions of the user's PAC in TGT

 

All possible scenarios:

Click image to expand
Blog_VTLPAC_202209_FNL-01
Figure 10: Using forged TGT tickets

The good news:

A “Golden Ticket attack” using an unknown user is no longer possible in deployment/enforcement environments with usernames that do not exist in the domain. In both deployment and enforcement environments, using either new or old PAC will end up with a revoked TGT once TGS is requested. Neither “ticket without requestor” nor “requestor mismatch” events are triggered in this case.

Moving forward to enforcement will also prevent successful use of forged TGT without the new PAC structures.

To summarize, although the PAC Kerberos security update cannot fully prevent a Golden Ticket attack, the new events leave meaningful indicators of compromise to help Varonis customers identify the attempted attack.

What you should do now

Below are three ways we can help you begin your journey to reducing data risk at your company:

  1. Schedule a demo session with us, where we can show you around, answer your questions, and help you see if Varonis is right for you.
  2. Download our free report and learn the risks associated with SaaS data exposure.
  3. Share this blog post with someone you know who'd enjoy reading it. Share it with them via email, LinkedIn, Reddit, or Facebook.

Try Varonis free.

Get a detailed data risk report based on your company’s data.
Deploys in minutes.

Keep reading

Varonis tackles hundreds of use cases, making it the ultimate platform to stop data breaches and ensure compliance.

kerberos-attack:-silver-ticket-edition
Kerberos Attack: Silver Ticket Edition
With a name like Silver Ticket, you might think it’s not as scary as its cousin the Golden Ticket – you’d be horribly mistaken. A Silver Ticket is just as nasty...
active-directory-security-best-practices
Active Directory Security Best Practices
Active Directory Security should be a top priority of any organization. Read on to learn why AD is so important and how to protect yourself from cyber attacks.
kerberos-attack:-how-to-stop-golden-tickets?
Kerberos Attack: How to Stop Golden Tickets?
The Golden Ticket Attack, discovered by security researcher Benjamin Delpy, gives an attacker total and complete access to your entire domain. It’s a Golden Ticket (just like in Willy Wonka)...
in-search-of-kerberos’s-golden-ticket
In Search of Kerberos’s Golden Ticket
In a Kerberos environment, all users get tickets, or more specifically TGTs (Ticketing Granting Tickets). It’s the starting point for gaining access to services—network files, email, apps, etc.  In Windows,...