Adversaries may modify access tokens to operate under a different user or system security context to perform actions and bypass access controls. Windows uses access tokens to determine the ownership of a running process. A user can manipulate access tokens to make a running process appear as though it is the child of a different process or belongs to someone other than the user that started the process. When this occurs, the process also takes on the security context associated with the new token.
An adversary can use built-in Windows API functions to copy access tokens from existing processes; this is known as token stealing. These token can then be applied to an existing process (i.e. Token Impersonation/Theft) or used to spawn a new process (i.e. Create Process with Token). An adversary must already be in a privileged user context (i.e. administrator) to steal a token. However, adversaries commonly use token stealing to elevate their security context from the administrator level to the SYSTEM level. An adversary can then use a token to authenticate to a remote system as the account for that token if the account has appropriate permissions on the remote system.[1]
Any standard user can use the runas command, and the Windows API functions, to create impersonation tokens; it does not require access to an administrator account. There are also other mechanisms, such as Active Directory fields, that can be used to modify access tokens.
| ID | Name | Description |
|---|---|---|
| S0622 | AppleSeed |
AppleSeed can gain system level privilege by passing |
| S1068 | BlackCat | |
| G0108 | Blue Mockingbird |
Blue Mockingbird has used JuicyPotato to abuse the |
| C0017 | C0017 |
During C0017, APT41 used a ConfuserEx obfuscated BADPOTATO exploit to abuse named-pipe impersonation for local |
| S0625 | Cuba |
Cuba has used |
| S0038 | Duqu |
Duqu examines running system processes for tokens that have specific system privileges. If it finds one, it will copy the token and store it for later use. Eventually it will start new processes with the stored token attached. It can also steal tokens to acquire administrative privileges.[8] |
| S0363 | Empire |
Empire can use PowerSploit's |
| G0037 | FIN6 |
FIN6 has used has used Metasploit’s named-pipe impersonation technique to escalate privileges.[10] |
| S0666 | Gelsemium |
Gelsemium can use token manipulation to bypass UAC on Windows7 systems.[11] |
| S0697 | HermeticWiper |
HermeticWiper can use |
| S0203 | Hydraq |
Hydraq creates a backdoor through which remote attackers can adjust token privileges.[14] |
| S0607 | KillDisk |
KillDisk has attempted to get the access token of a process by calling |
| G0030 | Lotus Blossom |
Lotus Blossom has retrieved process tokens for processes to adjust the privileges of the launch process or other items.[16] |
| S1060 | Mafalda |
Mafalda can use |
| S0576 | MegaCortex |
MegaCortex can enable |
| S0378 | PoshC2 |
PoshC2 can use Invoke-TokenManipulation for manipulating tokens.[19] |
| S0194 | PowerSploit |
PowerSploit's |
| S1242 | Qilin |
Qilin can use an embedded Mimikatz module for token manipulation.[22] |
| S0446 | Ryuk |
Ryuk has attempted to adjust its token privileges to have the |
| S1210 | Sagerunex |
Sagerunex finds the |
| S0633 | Sliver |
Sliver has the ability to manipulate user tokens on targeted Windows systems.[25][26] |
| S0058 | SslMM |
SslMM contains a feature to manipulate process privileges and tokens.[27] |
| S0562 | SUNSPOT |
SUNSPOT modified its security token to grants itself debugging privileges by adding |
| ID | Mitigation | Description |
|---|---|---|
| M1026 | Privileged Account Management |
Limit permissions so that users and user groups cannot create tokens. This setting should be defined for the local system account only. GPO: Computer Configuration > [Policies] > Windows Settings > Security Settings > Local Policies > User Rights Assignment: Create a token object. [29] Also define who can create a process level token to only the local and network service through GPO: Computer Configuration > [Policies] > Windows Settings > Security Settings > Local Policies > User Rights Assignment: Replace a process level token.[30] Administrators should log in as a standard user but run their tools with administrator privileges using the built-in access token manipulation command |
| M1018 | User Account Management |
An adversary must already have administrator level access on the local system to make full use of this technique; be sure to restrict users and accounts to the least privileges they require. |
| ID | Name | Analytic ID | Analytic Description |
|---|---|---|---|
| DET0283 | Behavior-chain detection for T1134 Access Token Manipulation on Windows | AN0786 |
Detection of suspicious token manipulation chains: use of token-related APIs (e.g., LogonUser, DuplicateTokenEx) or commands (runas) → spawning of a new process under a different security context (e.g., SYSTEM) → mismatched parent-child process lineage or anomalies in Event Tracing for Windows (ETW) token/PPID data → abnormal lateral or privilege escalation activity. |