Access Token Manipulation

T1134

Technique with 5 sub-techniques.View on attack.mitre.org

About this technique

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.

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.

Detection rules32

Rules on DetectionCode tagged with T1134 or one of its sub-techniques.

Sigma17

Splunk15

RuleTypeRiskData sourceTechnique
Runas Execution in CommandLineHuntingNULLSysmon EventID 1, Windows Event Log Security 4688, CrowdStrike ProcessRollup2T1134.001
Windows Access Token Manipulation SeDebugPrivilegeAnomalyNULLWindows Event Log Security 4703T1134.002
Windows Access Token Manipulation Winlogon Duplicate Token HandleHuntingNULLSysmon EventID 10T1134.001
Windows Access Token Winlogon Duplicate Handle In Uncommon PathAnomalyNULLSysmon EventID 10T1134.001
Windows AD Cross Domain SID History AdditionTTPNULLWindows Event Log Security 4742, Windows Event Log Security 4738T1134.005
Windows AD Privileged Account SID History AdditionTTPNULLWindows Event Log Security 4742, Windows Event Log Security 4738T1134.005
Windows AD Same Domain SID History AdditionTTPNULLWindows Event Log Security 4742, Windows Event Log Security 4738T1134.005
Windows AD SID History Attribute ModifiedTTPNULLWindows Event Log Security 5136T1134.005
Windows Handle Duplication in Known UAC-Bypass BinariesAnomalyNULLSysmon EventID 10T1134.001
Windows Parent PID Spoofing with ExplorerTTPNULLSysmon EventID 1, Windows Event Log Security 4688, CrowdStrike ProcessRollup2T1134.004
Windows Privilege Escalation Suspicious Process ElevationTTPNULLSysmon EventID 1 AND Sysmon EventID 1T1134
Windows Privilege Escalation System Process Without System ParentTTPNULLSysmon EventID 1T1134
Windows Privilege Escalation User Process Spawn System ProcessTTPNULLSysmon EventID 1 AND Sysmon EventID 1T1134
Windows Wermgr Spawning System Integrity ProcessTTPNULLSysmon EventID 1, Windows Event Log Security 4688, CrowdStrike ProcessRollup2T1134.001
Wscript Or Cscript Suspicious Child ProcessAnomalyNULLSysmon EventID 1, Windows Event Log Security 4688, CrowdStrike ProcessRollup2T1134.004

Sub-techniques5

IDNameExamples
T1134.001Token Impersonation/Theft20
T1134.002Create Process with Token13
T1134.003Make and Impersonate Token5
T1134.004Parent PID Spoofing4
T1134.005SID-History Injection2

Groups3

Software19

Campaigns1

Procedure examples23

Groups3

Used byProcedure example
GroupBlue Mockingbird

Blue Mockingbird has used JuicyPotato to abuse the SeImpersonate token privilege to escalate from web application pool accounts to NT Authority\SYSTEM.

GroupFIN6

FIN6 has used has used Metasploit’s named-pipe impersonation technique to escalate privileges.

GroupLotus Blossom

Lotus Blossom has retrieved process tokens for processes to adjust the privileges of the launch process or other items.

Software19

Used byProcedure example
MalwareAppleSeed

AppleSeed can gain system level privilege by passing SeDebugPrivilege to the AdjustTokenPrivilege API.

MalwareBlackCat

BlackCat has the ability modify access tokens.

MalwareCuba

Cuba has used SeDebugPrivilege and AdjustTokenPrivileges to elevate privileges.

MalwareDuqu

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.

ToolEmpire

Empire can use PowerSploit's Invoke-TokenManipulation to manipulate access tokens.

MalwareGelsemium

Gelsemium can use token manipulation to bypass UAC on Windows7 systems.

MalwareHermeticWiper

HermeticWiper can use `AdjustTokenPrivileges` to grant itself privileges for debugging with `SeDebugPrivilege`, creating backups with `SeBackupPrivilege`, loading drivers with `SeLoadDriverPrivilege`, and shutting down a local system with `SeShutdownPrivilege`.

MalwareHydraq

Hydraq creates a backdoor through which remote attackers can adjust token privileges.

View all 19 software examples

Campaigns1

Used byProcedure example
CampaignC0017

During C0017, APT41 used a ConfuserEx obfuscated BADPOTATO exploit to abuse named-pipe impersonation for local `NT AUTHORITY\SYSTEM` privilege escalation.

References1

  1. Pentestlab Token Manipulation Open source
    netbiosX. (2017, April 3). Token Manipulation. Retrieved April 21, 2017.

Data from MITRE ATT&CK® (Enterprise). ATT&CK® is a registered trademark of The MITRE Corporation.