heroui logo

Endpoint Discovery Commands Followed by IMDS Requests

Elastic Detection Rules

View Source
Summary
Detects a pattern where a single host process (on Linux or macOS) spawns multiple distinct discovery commands (e.g., ip, ss, hostnamectl, uptime, uname, whoami, id, hostname, netstat, arp, ifconfig, route, w, who, last, getent, dmidecode; and on macOS tools like sw_vers, system_profiler, scutil, networksetup, ioreg, sysctl, dscl, dscacheutil, csrutil, spctl, users, groups) and, within a short window, or via a child process, accesses the cloud instance metadata service (IMDS) endpoints. It also detects outbound connections to metadata endpoints (e.g., 169.254.169.254, 169.254.170.2, 169.254.170.23, 100.100.100.200, 168.63.129.16). The rule uses a correlation key Esql.correlation_id to group recon commands and any metadata requests by the same process tree, and fires when there are at least three distinct reconnaissance commands and at least one metadata access within a tight 10-second window. This behavior aligns with attacker techniques for discovery and credential access via cloud IMDS tokens, indicating potential abuse of discovery data to obtain credentials or tokens. The rule is cross-platform for Linux/macOS endpoints and maps to MITRE techniques T1016 (Discovery), T1033 (System Owner/User Discovery), T1082 (System Information Discovery), and T1552.005 (Cloud Instance Metadata API). False positives may arise from legitimate cloud bootstrap tooling or management agents; triage should verify parent process, path, and whether automation is approved. Remediation guidance includes isolating the host, rotating credentials or tokens retrieved from metadata, removing any dropped artifacts, and enforcing IMDS protections (e.g., IMDSv2) restricting access to required processes.
Categories
  • Endpoint
  • Linux
  • macOS
Data Sources
  • Process
  • Network Traffic
ATT&CK Techniques
  • T1016
  • T1033
  • T1082
  • T1552
  • T1552.005
Created: 2026-10-23