//THE ACADEMY IS GROWING DAILY. CHECK OUT THE FIELD NOTES FROM TECHS HERE AT THE ACADEMY
>_DAEMONCORE // ACADEMY
← FIELD NOTES

Windows token manipulation: impersonation and delegation tokens

2026.10.20//12 MIN READwindowsprivilege-escalationlateral-movementred-team

// Windows Token Basics

Every process in Windows operates under a security context defined by a token. These tokens determine the permissions associated with that process, influencing what resources it can access and what actions it can perform. Specifically, when discussing offensive tradecraft, two types of tokens are relevant: impersonation tokens and delegation tokens.

Understanding the nuances between these tokens can be the difference between a successful pivot and a dead-end encounter in a target environment.

// Impersonation Tokens

Impersonation tokens allow a process to act on behalf of a user. The key characteristic of impersonation tokens is that they can be used to access resources with the security credentials of the user who is being impersonated. This is particularly useful for lateral movement.

How to Obtain an Impersonation Token

One common way of obtaining an impersonation token is through tools like Mimikatz or by using the Windows API. Here’s a step-by-step approach to using Mimikatz for this purpose:

1. Download Mimikatz: Ensure you have a copy of Mimikatz on your target machine. You can download it from the official repository.

2. Run Mimikatz:

   mimikatz.exe

3. Use the "sekurlsa" module to dump the credentials:

   sekurlsa::minidump <path_to_dmp_file>

4. Extract the token:

   sekurlsa::tokens

This command will display the available tokens for the current session, including impersonation tokens.

Example Scenario

Imagine you’ve compromised the credentials of a user with limited access rights. By obtaining their impersonation token, you can perform actions on their behalf, effectively elevating your access level for lateral movement.

Important Note: Always check for the SeImpersonatePrivilege before proceeding. Without this privilege, you cannot impersonate another user.

// Delegation Tokens

Delegation tokens, on the other hand, allow a user or service to act on behalf of another user, but with the ability to access resources on behalf of that user across multiple systems. This is crucial in scenarios involving service accounts and multi-tier applications.

How to Obtain a Delegation Token

Obtaining a delegation token typically involves service tickets in Kerberos environments. The following steps illustrate how to leverage Rubeus, a tool designed for Kerberos ticket manipulation:

1. Download Rubeus: Obtain a copy from its GitHub repository and execute it on your target.

2. Request a Ticket Granting Ticket (TGT):

   Rubeus.exe kerberoast /user:<username> /domain:<domain>

3. Extract Service Tickets:

   Rubeus.exe kerberoast /user:<service_account> /domain:<domain> /rc4

4. Use the Ticket: Once you have the ticket, you can use it to establish a session with the service that the user has access to:

   Rubeus.exe asktgt /user:<username> /password:<password> /domain:<domain>

Example Scenario

In a corporate environment with a web application backend using Kerberos authentication, a compromised service account can be leveraged to gain access to databases that the service account can access, using the delegation token.

// Defensive Implications

Understanding these token manipulations is essential not just for offensive strategies; they also inform defensive postures. Here are a few strategies to mitigate risks associated with token manipulation:

  • Limit User Privileges: Ensure that users only have the privileges necessary for their roles.
  • Monitor Token Activities: Implement logging and alerting on token creation and usage activities.
  • Use Group Policies: Restrict which users can be delegated for services to minimize exposure.
  • Regularly Audit Service Accounts: Ensure that service accounts are monitored and have the least privilege necessary.

// Checklist for Token Manipulation Testing

  • [ ] Ensure you are using a disposable environment for testing.
  • [ ] Verify the target user has the right privileges for impersonation.
  • [ ] Utilize reliable tools like Mimikatz and Rubeus correctly.
  • [ ] Collect and analyze logs to ensure no anomalies go unnoticed.

In summary, mastering token manipulation techniques is critical for effective offensive operations in a Windows environment. The difference between using impersonation tokens and delegation tokens can significantly affect the success of your engagement. For practical application, remember that such techniques belong in a controlled setting, such as an authorized assessment or a CTF.

--- // FIELDOPS REPORT AUTHORIZED BY: Theodore O. //