Whoami Attack: Remote Code Execution on Amazon EC2

Search for a command to run...

No comments yet. Be the first to comment.
Tổng Quan Hãy tưởng tượng: một nhân viên nhân sự tại một công ty hàng không ở Pakistan nhận được lời mời phỏng vấn hấp dẫn từ một thương hiệu tuyển dụng có vẻ rất quen thuộc. Một cuộc gọi video được l

Tóm tắt Ngày 19/03/2026, cơ quan chức năng Mỹ, Canada và Đức triệt phá hạ tầng của bốn botnet IoT lớn nhất từng được ghi nhận — Aisuru, Kimwolf, JackSkid và Mossad. Hơn ba triệu thiết bị bị nhiễm. Hơn

Tóm tắt Không có malware nào trong chiến dịch này. Payload cuối cùng mà nạn nhân nhận được là trình cài đặt chính thức của Level RMM, tải trực tiếp từ hạ tầng của chính Level, cài đặt bằng msiexec với

Phần lớn dữ liệu thu được từ một honeypot SSH internet-facing là nhiễu: dò mật khẩu liên tục, hoặc bot đăng nhập thành công rồi tải payload xuống chạy ngay lập tức. Nhưng ngày 27/6/2026, honeypot của

Từ tháng 1/2025, một nhóm tấn công chưa xác định danh tính đã duy trì hoạt động gián điệp mạng nhắm vào các cơ quan chính phủ tại Afghanistan, Kyrgyzstan, Tajikistan, Uzbekistan, Kazakhstan và Syria,

In the realm of cloud security, vulnerabilities stemming from misconfigurations or inadequate management are frequently targeted by malicious actors. Recently, a significant vulnerability was identified in AWS's Amazon EC2 service, which permits attackers to perform remote code execution (RCE) on virtual machines (instances) via a technique termed the "Whoami Attack."
The Whoami Attack is a method that takes advantage of weaknesses in the metadata management mechanism of Amazon EC2. Metadata includes information about the virtual machine, such as the instance ID, region, and details about IAM roles (Identity and Access Management). Ordinarily, this metadata is accessible from within the instance through a local IP address.
However, if the metadata service is improperly configured, attackers may exploit it to obtain sensitive information, including IAM role credentials. This can result in privilege escalation and remote code execution on the instance.ce.

Attacker creates a malicious public AMI:
Attacker publishes the public AMI:
Victim searches for an AMI:
ec2:DescribeImages API without specifying the "owners" attribute.Selection of the malicious AMI:
Launch EC2 instance from the AMI:
EC2 executes malicious code:
Reverse connection to the attacker:
Perform post-attack actions:
This vulnerability can lead to serious consequences, including:
Leak of sensitive data: The attacker can access sensitive information stored on the instance or in other AWS services.
Control of AWS account: If credentials are exposed, the attacker can perform destructive actions or steal data across the entire AWS account.
Service disruption: Executing malicious code can disrupt the operation of services running on the instance.
To mitigate the risks from the Whoami Attack, organizations using AWS EC2 should implement the following measures:
Restrict metadata access: Use AWS's Instance Metadata Service Version 2 (IMDSv2), which requires token authentication to access metadata.
Limit IAM roles: Assign only the minimum necessary permissions to IAM roles for the instance.
Monitor and audit activities: Use tools like AWS CloudTrail to monitor unusual activities in the AWS account.
Update and patch: Ensure that instances are always updated with the latest security patches.
AWS stated that this vulnerability has not been exploited outside of security researchers' tests, so no customer data has been compromised through WhoAMI attacks.
Amazon advises users to always specify the AMI owner when using the "ec2:DescribeImages" API and enable the 'Allowed AMIs' feature for enhanced protection.
Starting from November last year, Terraform version 5.77 began warning users when using "most_recent = true" without an owner filter, with stricter enforcement planned for future versions (6.0).
System administrators must check and update their code configurations on AMI sources (Terraform, AWS CLI, Python Boto3, and Go AWS SDK) to ensure safe AMI retrieval.
This issue was resolved on September 19 last year, and on December 1, AWS introduced a new security control called 'Allowed AMIs', which allows customers to create a whitelist of trusted AMI providers.
AWS stated that this vulnerability has not been exploited outside of security researchers' tests, so no customer data has been compromised through WhoAMI attacks.
The Whoami Attack is a serious vulnerability that reminds organizations of the importance of configuring and managing security in cloud environments. With the increasing complexity of cloud services, understanding and applying appropriate security measures is essential to protect data and resources from potential threats.