Application Access Token

T1550.001

Sub-technique of T1550 Use Alternate Authentication Material.View on attack.mitre.org

About this technique

Adversaries may use stolen application access tokens to bypass the typical authentication process and access restricted accounts, information, or services on remote systems. These tokens are typically stolen from users or services and used in lieu of login credentials.

Application access tokens are used to make authorized API requests on behalf of a user or service and are commonly used to access resources in cloud, container-based applications, and software-as-a-service (SaaS).

OAuth is one commonly implemented framework that issues tokens to users for access to systems. These frameworks are used collaboratively to verify the user and determine what actions the user is allowed to perform. Once identity is established, the token allows actions to be authorized, without passing the actual credentials of the user. Therefore, compromise of the token can grant the adversary access to resources of other sites through a malicious application.

For example, with a cloud-based email service, once an OAuth access token is granted to a malicious application, it can potentially gain long-term access to features of the user account if a "refresh" token enabling background access is awarded. With an OAuth access token an adversary can use the user-granted REST API to perform functions such as email searching and contact enumeration.

Compromised access tokens may be used as an initial step in compromising other services. For example, if a token grants access to a victim’s primary email, the adversary may be able to extend access to all other services which the target subscribes by triggering forgotten password routines. In AWS and GCP environments, adversaries can trigger a request for a short-lived access token with the privileges of another user account. The adversary can then use this token to request data or perform actions the original account could not. If permissions for this feature are misconfigured – for example, by allowing all users to request a token for a particular account - an adversary may be able to gain initial access to a Cloud Account or escalate their privileges.

Direct API access through a token negates the effectiveness of a second authentication factor and may be immune to intuitive countermeasures like changing passwords. For example, in AWS environments, an adversary who compromises a user’s AWS API credentials may be able to use the `sts:GetFederationToken` API call to create a federated user session, which will have the same permissions as the original user but may persist even if the original user credentials are deactivated. Additionally, access abuse over an API channel can be difficult to detect even from the service provider end, as the access can still align well with a legitimate workflow.

Detection rules4

Rules on DetectionCode tagged with T1550.001.

Sigma4

Splunk0

No Splunk rules are mapped to this technique yet.

Groups4

Software6

Campaigns1

Procedure examples11

Groups4

Used byProcedure example
GroupAPT28

APT28 has used several malicious applications that abused OAuth access tokens to gain access to target email accounts, including Gmail and Yahoo Mail.

GroupHAFNIUM

HAFNIUM has abused service principals with administrative permissions for data exfiltration.

GroupShinyHunters

ShinyHunters has used stolen OAuth keys to access cloud infrastructure and to bypass two-factor authentication.

GroupTeamPCP

TeamPCP has used stolen access tokens to inject malicious code into CI/CD workflows and to exfiltrate sensitive data from cloud, developer, and container environments.

Software6

Used byProcedure example
MalwareCanisterWorm

CanisterWorm has leveraged stolen npm tokens to automate compromise by enumerating all publishable packages in a namespace, bumping versions, and publishing itself across the entire scope.

MalwareCreepyDrive

CreepyDrive can use legitimate OAuth refresh tokens to authenticate with OneDrive.

MalwareKali365

Kali365 has utilized an Exchange Admin module that captured admin tokens to create rogue mailbox connectors and change mail-flow rules.

MalwareMini Shai-Hulud

Mini Shai-Hulud has the ability to authenticate using stolen application access tokens.

ToolPeirates

Peirates can use stolen service account tokens to perform its operations. It also enables adversaries to switch between valid service accounts.

MalwareShai-Hulud

Shai-Hulud has leveraged captured valid NPM tokens to enumerate and update packages on compromised accounts. Shai-Hulud has also utilized stolen GitHub access tokens to access compromised accounts.

Campaigns1

Used byProcedure example
CampaignSolarWinds Compromise

During the SolarWinds Compromise, APT29 used compromised service principals to make changes to the Office 365 environment.

References8

  1. AWS Temporary Security Credentials Open source
    AWS. (n.d.). Requesting temporary security credentials. Retrieved April 1, 2022.
  2. Auth0 - Why You Should Always Use Access Tokens to Secure APIs Sept 2019 Open source
    Auth0. (n.d.). Why You Should Always Use Access Tokens to Secure APIs. Retrieved September 12, 2019.
  3. Crowdstrike AWS User Federation Persistence Open source
    Vaishnav Murthy and Joel Eng. (2023, January 30). How Adversaries Can Persist with AWS User Federation. Retrieved March 10, 2023.
  4. Google Cloud Service Account Credentials Open source
    Google Cloud. (2022, March 31). Creating short-lived service account credentials. Retrieved April 1, 2022.
  5. Microsoft Identity Platform Access 2019 Open source
    Cai, S., Flores, J., de Guzman, C., et. al.. (2019, August 27). Microsoft identity platform access tokens. Retrieved October 4, 2019.
  6. Rhino Security Labs Enumerating AWS Roles Open source
    Spencer Gietzen. (2018, August 8). Assume the Worst: Enumerating AWS Roles through ‘AssumeRole’. Retrieved April 1, 2022.
  7. Staaldraad Phishing with OAuth 2017 Open source
    Stalmans, E.. (2017, August 2). Phishing with OAuth and o365/Azure. Retrieved October 4, 2019.
  8. okta Open source
    okta. (n.d.). What Happens If Your JWT Is Stolen?. Retrieved September 12, 2019.

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