AWS EC2 LOLBin Execution via SSM SendCommand
Identifies the execution of Living Off the Land Binaries (LOLBins) or GTFOBins on EC2 instances via AWS Systems Manager (SSM) `SendCommand` API. This detection correlates AWS CloudTrail `SendCommand` events with…
Description
Identifies the execution of Living Off the Land Binaries (LOLBins) or GTFOBins on EC2 instances via AWS Systems Manager (SSM) `SendCommand` API. This detection correlates AWS CloudTrail `SendCommand` 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. Adversaries may abuse SSM to execute malicious commands remotely without requiring SSH or RDP access, using legitimate system utilities for data exfiltration, establishing reverse shells, or lateral movement.
Detection logic
Its licence does not clear it for publishing here
Sunturai publishes a detection's own text where the licence it arrived under has been reviewed and permits it, and Elastic License 2.0 has not. The query as its source wrote it, its canonical form and the hash that pins this revision are in the workspace record.
Detection requirements
- Platform
- ContainersESXiIaaSIdentity ProviderLinuxmacOSNetwork DevicesOffice SuiteSaaSWindows
The rule states no platform. This is derived from the 3 ATT&CK techniques it maps to.
Known benign triggers
- Automated configuration management or monitoring scripts that use LOLBins via SSM for legitimate purposes. Consider excluding known automation accounts or specific command patterns.
- Legitimate administrative tasks using SSM to run system utilities may trigger this rule. Review the command context, user identity, and timing to determine if the activity is authorized.
MITRE ATT&CK mappings
0 exclusive techniques.This is coverage no other published rule has; it is not this rule's total technique count.
References
| Reference | Cited by |
|---|---|
| gtfobins.github.io | 5 |
| hackingthe.cloud/aws/post_exploitation/run_shell_commands_on_ec2/ | 2 |
| www.100daysofredteam.com/p/ghost-in-the-cloud-abusing-aws-ssm | Only this detection cites it |
| www.kali.org/tools/pacu/ | Only this detection cites it |
| www.mitiga.io/blog/abusing-the-amazon-web-services-ssm-agent-as-a-remote-access-trojan | 3 |
From the source
- At source
- Open at source
- Upstream identifier
- a8b3e2f0-8c7d-11ef-b4c6-f661ea17fbcd
- Tagged by the source as
- Data Source: Amazon Web ServicesData Source: AWSData Source: AWS CloudTrailData Source: AWS EC2Data Source: AWS SSMData Source: AWS Systems ManagerData Source: Elastic DefendDomain: CloudDomain: EndpointNoise: LowOS: LinuxPerformance: NormalPlatform: AWSPlatform: LinuxProfile: RecommendedResources: Investigation GuideRule Type: ES|QLService: AWS EC2Service: AWS SSMTactic: Command and ControlTactic: ExecutionThreat: Cloud VM ExecutionThreat: Living off the LandUse Case: Threat Detection
Licence
- Published under
- Elastic License 2.0Read the licence
- Attribution
- Required
Authorship
- Written by
- Published
- Sep 20, 2026
- Version
- 3