Cloud Instance Metadata API

T1552.005

Sub-technique of T1552 Unsecured Credentials.View on attack.mitre.org

About this technique

Adversaries may attempt to access the Cloud Instance Metadata API to collect credentials and other sensitive data.

Most cloud service providers support a Cloud Instance Metadata API which is a service provided to running virtual instances that allows applications to access information about the running virtual instance. Available information generally includes name, security group, and additional metadata including sensitive data such as credentials and UserData scripts that may contain additional secrets. The Instance Metadata API is provided as a convenience to assist in managing applications and is accessible by anyone who can access the instance. A cloud metadata API has been used in at least one high profile compromise.

If adversaries have a presence on the running virtual instance, they may query the Instance Metadata API directly to identify credentials that grant access to additional resources. Additionally, adversaries may exploit a Server-Side Request Forgery (SSRF) vulnerability in a public facing web proxy that allows them to gain access to the sensitive information via a request to the Instance Metadata API.

The de facto standard across cloud service providers is to host the Instance Metadata API at http[:]//169.254.169.254.

Detection rules1

Rules on DetectionCode tagged with T1552.005.

Sigma0

No Sigma rules are mapped to this technique yet.

Splunk1

RuleTypeRiskData source
Cisco Isovalent - Access To Cloud Metadata ServiceAnomalyNULLCisco Isovalent Process Connect

Groups1

Software5

Campaigns0

None recorded.

Procedure examples6

Groups1

Used byProcedure example
GroupTeamTNT

TeamTNT has queried the AWS instance metadata service for credentials.

Software5

Used byProcedure example
MalwareHildegard

Hildegard has queried the Cloud Instance Metadata API for cloud credentials.

MalwareMini Shai-Hulud

Mini Shai-Hulud has gathered credentials and secrets from AWS, Google Cloud Platform (GCP) and Azure metadata API.

ToolPeirates

Peirates can query the query AWS and GCP metadata APIs for secrets.

MalwareShai-Hulud

Shai-Hulud has queried the AWS and GCP metadata endpoints for instances and service credentials.

ToolTruffleHog

TruffleHog can query the AWS and GCP metadata endpoints for instances and service credentials.

References3

  1. AWS Instance Metadata API Open source
    AWS. (n.d.). Instance Metadata and User Data. Retrieved July 18, 2019.
  2. Krebs Capital One August 2019 Open source
    Krebs, B.. (2019, August 19). What We Can Learn from the Capital One Hack. Retrieved March 25, 2020.
  3. RedLock Instance Metadata API 2018 Open source
    Higashi, Michael. (2018, May 15). Instance Metadata API: A Modern Day Trojan Horse. Retrieved July 16, 2019.

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