<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Ec2 — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/ec2/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata — refreshed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Fri, 01 May 2026 20:57:28 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/ec2/feed.xml" rel="self" type="application/rss+xml"/><item><title>AWS EC2 Role GetCallerIdentity from New Source AS Organization</title><link>https://feed.craftedsignal.io/briefs/2024-01-02-aws-ec2-role-getcalleridentity/</link><pubDate>Fri, 01 May 2026 20:57:28 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-02-aws-ec2-role-getcalleridentity/</guid><description>The rule detects when an EC2 instance role session calls AWS STS GetCallerIdentity from a new source autonomous system (AS) organization name, indicating potential credential theft and verification from outside expected egress paths.</description><content:encoded><![CDATA[<p>This detection identifies when an EC2 instance role session calls the AWS STS GetCallerIdentity API from a source Autonomous System (AS) Organization name that has not been previously observed. The GetCallerIdentity API is often used by adversaries to validate stolen instance role credentials from infrastructure outside the victim&rsquo;s normal egress points. By baselining the combination of identity and source network, the rule reduces noise associated with stable NAT or AWS-classified egress, focusing on truly novel access patterns. This detection is specifically designed to complement other rules that may detect general GetCallerIdentity calls, by excluding previously seen combinations of user identity and source AS organization.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker gains unauthorized access to an EC2 instance through methods like exploiting a Server-Side Request Forgery (SSRF) vulnerability, compromising application code or exploiting IMDS abuse.</li>
<li>The attacker leverages the instance&rsquo;s IAM role to obtain temporary AWS credentials.</li>
<li>The attacker attempts to validate the stolen credentials using the <code>GetCallerIdentity</code> API call.</li>
<li>The <code>GetCallerIdentity</code> API call originates from an IP address associated with a new and unexpected Autonomous System Organization (ASO).</li>
<li>The AWS CloudTrail logs record the <code>GetCallerIdentity</code> event, including the user identity ARN and the source AS organization name.</li>
<li>The detection rule triggers due to the new combination of user identity and source AS organization.</li>
<li>The attacker uses the validated credentials to perform reconnaissance and identify valuable resources within the AWS environment (e.g., S3 buckets, databases).</li>
<li>The attacker attempts to exfiltrate sensitive data or deploy malicious workloads using the stolen credentials.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>A successful attack can lead to unauthorized access to sensitive data stored within the AWS environment. The attacker may be able to escalate privileges, compromise other resources, and disrupt services. The potential impact includes data breaches, financial loss, and reputational damage. The lack of specific victim counts or sectors targeted suggests a broad applicability across various AWS users.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the Sigma rule &ldquo;AWS EC2 Role GetCallerIdentity from New Source AS Organization&rdquo; to your SIEM to detect suspicious activity.</li>
<li>Investigate alerts triggered by the Sigma rule, focusing on the <code>aws.cloudtrail.user_identity.arn</code> and <code>source.as.organization.name</code> fields.</li>
<li>Monitor AWS CloudTrail logs for <code>GetCallerIdentity</code> API calls, particularly those originating from unfamiliar source IP addresses and ASNs.</li>
<li>Revoke compromised IAM role sessions by stopping the affected EC2 instances or removing the role from the instance profile.</li>
<li>Rotate any long-lived secrets accessible by the EC2 instance, based on the <code>aws.cloudtrail.user_identity.access_key_id</code>.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>cloud</category><category>aws</category><category>getcalleridentity</category><category>ec2</category><category>discovery</category></item><item><title>AWS EC2 LOLBin Execution via SSM SendCommand</title><link>https://feed.craftedsignal.io/briefs/2024-01-03-aws-ec2-lolbin-ssm/</link><pubDate>Fri, 10 Apr 2026 16:27:52 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-03-aws-ec2-lolbin-ssm/</guid><description>Detection of Living Off the Land Binaries (LOLBins) or GTFOBins execution on EC2 instances via AWS Systems Manager (SSM) SendCommand API, potentially indicating malicious activity.</description><content:encoded><![CDATA[<p>This threat brief focuses on detecting the execution of Living Off the Land Binaries (LOLBins) or GTFOBins on Amazon EC2 instances via AWS Systems Manager (SSM) <code>SendCommand</code> API. The technique involves correlating AWS CloudTrail <code>SendCommand</code> events with endpoint process execution by matching SSM command IDs. While AWS redacts command parameters in CloudTrail logs, this correlation technique reveals the actual commands executed on EC2 instances. This is critical because adversaries may abuse SSM to execute malicious commands remotely without requiring SSH or RDP access. They can leverage legitimate system utilities for various malicious purposes, including data exfiltration, establishing reverse shells, or facilitating lateral movement within the cloud environment. The rule was last updated on 2026-04-10.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker gains initial access to AWS via compromised credentials or an exposed IAM role.</li>
<li>The attacker uses the AWS CLI or API to initiate an SSM <code>SendCommand</code> to a target EC2 instance. The <code>DocumentName</code> parameter is set to <code>AWS-RunShellScript</code>.</li>
<li>The SSM agent on the EC2 instance receives the <code>SendCommand</code> request.</li>
<li>The SSM agent executes a shell script (<code>_script.sh</code>) within a dedicated directory for orchestration.</li>
<li>The shell script executes a LOLBin, such as <code>curl</code>, <code>wget</code>, <code>python</code>, or <code>perl</code>, to perform malicious actions. The parent process of the LOLBin will be the SSM shell script.</li>
<li>The LOLBin is used to download a malicious payload, establish a reverse shell, or exfiltrate data.</li>
<li>The attacker uses the established reverse shell to perform further actions on the EC2 instance.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation can lead to unauthorized access to EC2 instances, data exfiltration, deployment of malware, and lateral movement within the AWS environment. Although a number of impacted organizations is not available, this attack is able to bypass traditional network security controls. Organizations in any sector utilizing AWS EC2 instances and SSM are potentially at risk. The lack of required SSH or RDP access makes this technique particularly stealthy.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Enable AWS CloudTrail logging to capture <code>SendCommand</code> events and monitor for <code>AWS-RunShellScript</code> in the <code>request_parameters</code>.</li>
<li>Deploy the Sigma rule &ldquo;Detect AWS EC2 LOLBin Execution via SSM SendCommand&rdquo; to your SIEM and tune for your environment.</li>
<li>Monitor endpoint process execution logs for the execution of LOLBins like <code>curl</code>, <code>wget</code>, <code>python</code>, <code>perl</code>, <code>nc</code>, etc., with parent processes related to SSM.</li>
<li>Implement strict IAM policies to restrict SSM <code>SendCommand</code> permissions to only authorized users and roles.</li>
<li>Review and audit existing SSM configurations to identify and remediate any overly permissive settings.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>aws</category><category>ec2</category><category>ssm</category><category>lolbin</category><category>execution</category><category>cloud</category></item><item><title>Suspicious AWS EC2 Key Pair Import Activity</title><link>https://feed.craftedsignal.io/briefs/2024-12-aws-key-pair-import/</link><pubDate>Thu, 19 Dec 2024 00:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-12-aws-key-pair-import/</guid><description>The import of SSH key pairs into AWS EC2, as detected by CloudTrail logs, may indicate unauthorized access attempts, persistence establishment, or privilege escalation by an attacker.</description><content:encoded><![CDATA[<p>The unauthorized import of SSH key pairs into Amazon Elastic Compute Cloud (EC2) is a technique that malicious actors can leverage to gain unauthorized access to EC2 instances. By importing their own key pairs, attackers can bypass existing security measures and gain persistent access to compromised systems. This activity is often part of a broader attack campaign aimed at compromising sensitive data, disrupting services, or establishing a foothold within an organization&rsquo;s cloud infrastructure. The initial publication of the detection rule was in December 2024, highlighting the ongoing relevance of this technique in cloud security. Monitoring for this activity can help defenders identify and respond to potential security breaches in a timely manner.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker gains initial access to an AWS account, potentially through compromised credentials or exploiting a misconfigured IAM role.</li>
<li>The attacker attempts to enumerate existing EC2 instances to identify potential targets.</li>
<li>The attacker generates or obtains an SSH key pair, which they intend to use for unauthorized access.</li>
<li>The attacker uses the <code>ImportKeyPair</code> API call within the EC2 service to import the generated or obtained SSH key pair.</li>
<li>The attacker modifies the EC2 instance&rsquo;s configuration to associate the newly imported key pair with the instance. This might involve stopping and restarting the instance.</li>
<li>The attacker uses the imported SSH key pair to gain SSH access to the EC2 instance.</li>
<li>Once inside the instance, the attacker attempts to escalate privileges and move laterally within the AWS environment.</li>
<li>The attacker exfiltrates sensitive data, deploys malware, or disrupts critical services.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>A successful key pair import can lead to complete compromise of the affected EC2 instances, potentially impacting dozens of servers depending on the environment. Sensitive data stored on or accessible from these instances could be exfiltrated, leading to financial loss, reputational damage, and regulatory fines. Furthermore, compromised instances can be used as a launchpad for further attacks within the AWS environment, leading to a wider breach. The financial impact can range from tens of thousands to millions of dollars, depending on the scale of the breach and the sensitivity of the data compromised.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the provided Sigma rule to your SIEM to detect <code>ImportKeyPair</code> events in CloudTrail logs (logsource: aws, service: cloudtrail).</li>
<li>Review IAM policies to ensure that only authorized users and roles have the necessary permissions to import key pairs (eventSource: &rsquo;ec2.amazonaws.com&rsquo;, eventName: &lsquo;ImportKeyPair&rsquo;).</li>
<li>Investigate any detected <code>ImportKeyPair</code> events, validating the user identity, user agent, and source IP address to ensure they are expected (detection block).</li>
<li>Implement multi-factor authentication (MFA) for all AWS accounts to reduce the risk of credential compromise.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>aws</category><category>cloudtrail</category><category>ec2</category><category>keypair</category><category>initial-access</category><category>persistence</category><category>privilege-escalation</category></item><item><title>Suspicious AWS EC2 Key Pair Creation from Non-Cloud AS</title><link>https://feed.craftedsignal.io/briefs/2024-01-aws-ec2-keypair-creation/</link><pubDate>Wed, 03 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-aws-ec2-keypair-creation/</guid><description>An AWS EC2 CreateKeyPair event triggered by a new principal originating from a network autonomous system (AS) organization not associated with major cloud providers, indicating potential unauthorized access or persistence activity.</description><content:encoded><![CDATA[<p>This alert identifies suspicious activity related to the creation of EC2 key pairs within an AWS environment. Specifically, it focuses on instances where a new IAM principal (user) creates an EC2 key pair from a network source (IP address) whose autonomous system organization is not commonly associated with major cloud providers like Amazon, Google, or Microsoft. Adversaries often create key pairs for persistence or to enable unauthorized access to EC2 instances, potentially leading to data exfiltration or further malicious activities. The rule uses a new terms approach to baseline user activity, reducing noise from repeated actions while still flagging the initial suspicious key pair creation. This activity is flagged as suspicious due to originating from outside trusted ASNs.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker gains initial access to an AWS account, potentially through compromised credentials or a misconfigured IAM role.</li>
<li>The attacker attempts to enumerate existing EC2 instances and associated key pairs.</li>
<li>The attacker uses the <code>CreateKeyPair</code> API call to generate a new SSH key pair within the AWS account. The request originates from a network with an autonomous system organization not attributed to common cloud providers.</li>
<li>The attacker stores the private key material for later use in accessing EC2 instances.</li>
<li>The attacker may then use the new key pair to launch new EC2 instances or import the key to existing instances. This can be done through <code>RunInstances</code> or <code>ImportKeyPair</code> operations.</li>
<li>The attacker uses the new key pair to SSH into the newly created or compromised EC2 instances.</li>
<li>Once inside the instances, the attacker performs malicious activities, such as data exfiltration, lateral movement, or installing malware.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation can lead to unauthorized access to EC2 instances, potentially compromising sensitive data and disrupting services. A compromised AWS account can allow the attacker to steal data, establish persistence, and move laterally within the cloud environment. The lack of expected cloud provider ASN for the source IP of the <code>CreateKeyPair</code> event raises the risk profile.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the Sigma rule &ldquo;AWS EC2 CreateKeyPair from Non-Cloud AS Organization&rdquo; to your SIEM and tune the <code>source.as.organization.name</code> exclusions based on your environment.</li>
<li>Review AWS CloudTrail logs for any <code>CreateKeyPair</code> events and correlate with other suspicious activity, as mentioned in the investigation steps in this brief.</li>
<li>Implement stricter IAM policies to limit the ability to create key pairs to only authorized users and roles.</li>
<li>Monitor for <code>RunInstances</code> or <code>ImportKeyPair</code> events using the newly created key names as identified from <code>aws.cloudtrail.request_parameters</code> / <code>response_elements</code>.</li>
<li>Enable and review AWS Config rules to detect and remediate misconfigurations related to IAM and EC2 key pair management.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>aws</category><category>ec2</category><category>keypair</category><category>persistence</category><category>credential_access</category><category>lateral_movement</category></item><item><title>AWS EC2 Stop, Start, and User Data Modification Correlation</title><link>https://feed.craftedsignal.io/briefs/2024-01-03-aws-ec2-user-data-modification/</link><pubDate>Wed, 03 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-03-aws-ec2-user-data-modification/</guid><description>Detection of a sequence of AWS EC2 management API calls indicative of malicious modification of instance user data to execute arbitrary code upon instance restart, potentially leading to privilege escalation and persistence.</description><content:encoded><![CDATA[<p>This detection identifies a specific sequence of AWS EC2 API calls suggesting malicious intent. An adversary may update the <code>userData</code> attribute of an EC2 instance and then restart the instance to execute malicious scripts with elevated privileges (root on Linux, SYSTEM on Windows). The technique involves modifying instance attributes to inject malicious code or scripts, followed by stopping and starting the instance to trigger execution of the modified user data. This can lead to privilege escalation, persistence, or other malicious activities within the AWS environment. The detection focuses on the correlation of <code>StopInstances</code>, <code>StartInstances</code>, and <code>ModifyInstanceAttribute</code> events that reference <code>userData</code> within a 5-minute window. The rule groups these events by instance ID, username, account ID, source IP, and user agent, triggering an alert only when all three distinct API calls are observed within the same group. This aims to reduce false positives by requiring the complete sequence of actions associated with this technique.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker gains initial access to an AWS account with sufficient permissions to manage EC2 instances (e.g., via compromised credentials or an IAM role).</li>
<li>The attacker identifies a target EC2 instance.</li>
<li>The attacker uses the <code>ModifyInstanceAttribute</code> API call to update the <code>userData</code> attribute of the target instance, injecting malicious code or scripts.</li>
<li>The attacker uses the <code>StopInstances</code> API call to stop the target EC2 instance.</li>
<li>The attacker uses the <code>StartInstances</code> API call to start the target EC2 instance.</li>
<li>Upon instance start, the modified <code>userData</code> script executes with elevated privileges, potentially installing malware, establishing persistence, or performing other malicious actions.</li>
<li>The attacker may use the compromised instance to further explore the AWS environment, escalate privileges, or exfiltrate data.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation can lead to unauthorized code execution within the AWS environment. Attackers can gain elevated privileges on the compromised EC2 instance, potentially leading to full control of the instance and the ability to access sensitive data or resources within the AWS account. This can result in data breaches, service disruptions, and financial losses. The modification of user data allows for persistent malicious code execution each time the instance restarts.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the following Sigma rules to your SIEM to detect the described attack pattern, and tune them to your environment.</li>
<li>Review CloudTrail logs for <code>ModifyInstanceAttribute</code> events with <code>userData</code> to identify potentially malicious modifications.</li>
<li>Monitor EC2 instance state transitions (stop/start) in conjunction with user data modifications.</li>
<li>Implement least privilege IAM policies to restrict access to EC2 management APIs.</li>
<li>Use AWS Secrets Manager or Parameter Store to manage secrets instead of embedding them in <code>userData</code>.</li>
<li>Investigate any alerts generated by the Sigma rules and correlate them with other security events.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>aws</category><category>ec2</category><category>user-data</category><category>privilege-escalation</category><category>persistence</category><category>execution</category></item></channel></rss>