Threat reportTtpTL-2026-1644
Abuse of AWS Systems Manager (SSM) Agent as a Remote Access Trojan
Mitiga researchers documented a post-exploitation technique that repurposes the legitimate, Amazon-signed AWS Systems Manager (SSM) Agent on Linux and Windows EC2 hosts into a Remote Access Trojan. Attackers with root/administrator access hijack the agent into hybrid mode under an attacker-controlled AWS account, run a second parallel agent process, or proxy SSM traffic through an attacker-controlled endpoint, then use built-in RunCommand/StartSession features for command-and-control while evading EDR tools that trust the signed binary. First disclosed .
Key facts
| Identifiers | TL-2026-1644 |
|---|---|
| Also known as | SSM Agent Hijacking, AWS SSM Agent RAT |
| Severity | MEDIUM |
| First disclosed | |
| Affected products | Amazon Web Services AWS Systems Manager Agent (SSM Agent); Amazon Web Services Amazon EC2 (Linux and Windows instances with SSM Agent installed) |
| Tools | AWS Systems Manager Agent (SSM Agent) |
| MITRE ATT&CK techniques | T1036 Masquerading, T1059 Command and Scripting Interpreter, T1078.004 Cloud Accounts, T1090.002 External Proxy, T1098 Account Manipulation, T1098.001 Additional Cloud Credentials, T1127 Trusted Developer Utilities Proxy Execution, T1133 External Remote Services, T1219 Remote Access Tools, T1219.002 Remote Desktop Software, T1486 Data Encrypted for Impact, T1489 Service Stop and 3 more in the attack flow |
| Motivation | UNKNOWN |
| Target sectors | cloud infrastructure, technology, any aws ec2 customer environment |
| Target regions | Global |
| Detection rules | 9 (1 shown free) |
| Sources | 8 cited sources |
Detection coverage
As of 2026-07-22, Threadlinqs Intelligence publishes 9 detection rule(s) for TL-2026-1644 across Splunk SPL, Microsoft KQL and Sigma, covering 16 indicator(s) of compromise. The whole corpus is readable without an account. Every threat comes with one complete detection in Splunk SPL, Microsoft KQL and Sigma, free for everyone; a free account adds daily TL Creds to unlock the rest. Paid plans add a larger daily allowance, correlation and the MCP server. Threadlinqs MCP server · View plans.
Free detection: SSM Agent Hybrid-Mode Hijack Registration (CLI Flags) — SPL
Detects execution of amazon-ssm-agent / amazon-ssm-agent.exe with the -register -code -id -region hybrid-activation flag combination on an already-provisioned EC2 instance, the signature of an attacker re-registering the trusted SSM agent to their own AWS account.
- Languages: Splunk SPL, Microsoft KQL, Sigma
- ATT&CK: T1219.002, T1098.001, T1036
- Data sources: sysmon, linux_auditd, windows_security
- Severity: high
- Confidence: high
Splunk SPL
index=endpoint (sourcetype="WinEventLog:Microsoft-Windows-Sysmon/Operational" OR sourcetype="linux_secure" OR sourcetype="syslog") EventCode=1
(Image="*amazon-ssm-agent*" OR process_name="*amazon-ssm-agent*")
CommandLine="*-register*" CommandLine="*-code*" CommandLine="*-id*" CommandLine="*-region*"
| eval instance_data_mismatch=if(match(CommandLine, "i-0[A-Za-z0-9]+"), "check_instance_id", "n/a")
| stats count min(_time) as first_seen max(_time) as last_seen values(CommandLine) as cmdlines by host, user
| where count > 0
| table host, user, first_seen, last_seen, count, cmdlinesMicrosoft KQL
DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName has_any ("amazon-ssm-agent", "amazon-ssm-agent.exe")
| where ProcessCommandLine has "-register" and ProcessCommandLine has "-code" and ProcessCommandLine has "-id" and ProcessCommandLine has "-region"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessAccountName
| order by Timestamp descSigma
title: Potential AWS SSM Agent Hijack Hybrid-Mode Re-Registration
id: 7c2f9a1e-4b3d-4e2a-9f10-1a2b3c4d5e01
status: experimental
description: Detects amazon-ssm-agent invoked with the hybrid-activation -register/-code/-id/-region flag combination, indicating an attacker re-registering the agent to an attacker-controlled AWS account
references:
- https://www.mitiga.io/blog/mitiga-security-advisory-abusing-the-ssm-agent-as-a-remote-access-trojan
author: Threadlinqs Team
date: 2026-07-22
tags:
- attack.persistence
- attack.t1098.001
- attack.t1219.002
- attack.defense_evasion
- attack.t1036
logsource:
category: process_creation
product: windows
detection:
selection:
Image|endswith:
- '\amazon-ssm-agent.exe'
- '/amazon-ssm-agent'
CommandLine|contains|all:
- '-register'
- '-code'
- '-id'
- '-region'
condition: selection
falsepositives:
- Legitimate initial provisioning/activation of a new hybrid-activation managed instance by an authorized administrator
level: highKnown false positives:
- Legitimate first-time hybrid-activation registration of a new managed instance by an authorized administrator during onboarding
Tuning notes: Suppress for hosts/instance-IDs on a documented hybrid-activation onboarding allowlist; alert only when the activation account/ID does not match the organization's expected activation registry.
- SSM Agent Service Stop Immediately Preceding Hijack Re-Registration — KQL · unlock with TL Creds
- [indicator]/[indicator] Environment Variable Change in SSM Agent Process Context — KQL · unlock with TL Creds
- SendCommand AWS-RunShellScript/RunPowerShellScript Burst from New or Rare Principal — KQL · unlock with TL Creds
- Unexpected Instance-Data Directory Under SSM InstanceData Path (Instance-ID Mismatch) — Sigma · unlock with TL Creds
- [indicator] Binary Removed from AV/EDR Allowlist Trust Anomaly — Sigma · unlock with TL Creds
- IAM Principal Newly Granted ssm:SendCommand/StartSession/CreateActivation Permissions — Sigma · unlock with TL Creds
- Multiple Concurrent [indicator] Processes — SPL · unlock with TL Creds
- CloudTrail SSM StartSession/SendCommand/CreateActivation from Unexpected Principal — SPL · unlock with TL Creds
Indicators of compromise
As of 2026-07-22, Threadlinqs Intelligence tracks 16 indicators of compromise for TL-2026-1644.
Technical analysis
In a July 31, 2023 security advisory, Mitiga researchers detailed a living-off-the-land post-exploitation technique abusing the AWS Systems Manager (SSM) Agent, a signed, first-party binary pre-installed on most default Amazon Machine Images (AMIs) and widely deployed across AWS EC2 fleets for patch management, command execution, and session access. Because the SSM Agent binary is Amazon-signed and near-universally allowlisted by antivirus and EDR products (Mitiga noted 0 of 71 VirusTotal engines flagged it as malicious), an attacker who has already obtained root (Linux) or Administrator (Windows) level access on an EC2 instance can repurpose the existing, trusted agent into a full remote-access channel instead of dropping custom malware.
Three distinct exploitation scenarios were documented:
1. **Hijacking the original agent (hybrid-mode re-registration).** The attacker stops the running amazon-ssm-agent service, re-registers it in SSM 'hybrid activation' mode using an activation code/ID generated in an AWS account they control (`amazon-ssm-agent -register -code <ACTIVATION_CODE> -id <ACTIVATION_ID> -region <REGION>`), and restarts the service. The instance now takes RunCommand and Session Manager (StartSession) instructions from the attacker's AWS account instead of, or in addition to, the legitimate owning account, bypassing the EC2 instance metadata service (IMDS) for identity. This method is persistent across reboots.
2. **Running a second, parallel SSM Agent process.** Rather than hijacking the original agent (which could disrupt legitimate management and tip off defenders), the attacker launches an independent second amazon-ssm-agent process registered to their own AWS account, isolated from the original using Linux namespaces (on Linux) or a modified environment/registry context (on Windows), while the legitimate agent continues operating normally and undisturbed. This requires only a non-root/non-admin foothold to execute in some configurations described by the researchers, though full agent control still assumes elevated access to install/run the second binary persistently.
3. **Mock/proxy SSM server.** The attacker modifies the `http_proxy`/`https_proxy` environment variables (or equivalent proxy configuration) consumed by the SSM Agent so its command-and-control traffic is routed through an attacker-controlled proxy server rather than direct to AWS Systems Manager endpoints, which can also route traffic outside AWS entirely and reduce AWS-side visibility into the C2 channel.
In all scenarios the attacker gains a fully functional, Amazon-signed RAT capable of arbitrary command execution (RunCommand), interactive shell access (Session Manager StartSession), and file transfer, providing persistence, defense evasion, and command-and-control without deploying any additional flagged malware. Potential downstream impact includes data theft, ransomware deployment, cryptomining, and lateral movement across the compromised environment. AWS's public response characterized the behavior as expected/by-design ('software and systems are behaving as designed and there is no need for customers to take any action'), placing the burden of detection and prevention on defenders via SIEM/EDR tuning and network-layer restriction (VPC endpoint policies) rather than a product fix, and Mitiga's detection guidance and AWS's mitigation guidance were published together with the advisory. No CVE was assigned, consistent with this being a technique abusing intended agent functionality rather than a software vulnerability.
MITRE ATT&CK techniques by tactic:
Defense Evasion
T1036 Masquerading; T1127 Trusted Developer Utilities Proxy Execution
Execution
T1059 Command and Scripting Interpreter; T1569.002 Service Execution
Privilege Escalation
Command and Control
T1090.002 External Proxy; T1219 Remote Access Tools; T1219.002 Remote Desktop Software
persistence
T1098 Account Manipulation; T1098.001 Additional Cloud Credentials
Persistence
T1133 External Remote Services
Impact
T1486 Data Encrypted for Impact; T1489 Service Stop
Discovery
defense-impairment
Remediation
Immediate actions
- Remove the amazon-ssm-agent binary path from antivirus/EDR allowlists so behavioral analysis and process monitoring apply to it like any other binary
- Audit all EC2 instances for unexpected SSM hybrid-mode registrations or multiple concurrent amazon-ssm-agent processes
- Review CloudTrail for Session Manager and RunCommand API calls (StartSession, SendCommand, CreateActivation) originating from unexpected or unrecognized AWS account principals
- Search hosts for unexpected instance-data directories under /var/lib/amazon/ssm/i-[instanceID] (Linux) or C:\ProgramData\Amazon\SSM\InstanceData\i-[instanceID] (Windows) that do not correspond to the instance's own ID
Workarounds
- Configure AWS Systems Manager VPC endpoint policies to restrict accepted commands to the instance's original AWS account or AWS Organization only, using IAM global condition keys (e.g. aws:PrincipalAccount / aws:ResourceOrgID) on the SSM VPC endpoint policy
- Deploy AWS Systems Manager over VPC endpoints rather than the public SSM service endpoint to reduce exposure to attacker-controlled proxy redirection
Longer-term hardening
- Implement SIEM/SOAR detection content for suspicious SSM agent registration flags (-register, -code, -id, -region) and for multiple simultaneous amazon-ssm-agent processes
- Monitor and alert on http_proxy/https_proxy environment variable changes on hosts running the SSM Agent
- Continuously monitor IAM policies and permissions boundaries for unauthorized principals with ssm:SendCommand, ssm:StartSession, or ssm:CreateActivation permissions
- Bake EDR/AV visibility into the SSM Agent process itself as part of standard EC2 hardening baselines
Affected and fixed versions
- Amazon Web Services — AWS Systems Manager Agent (SSM Agent)
Vulnerable versions: all versions supporting hybrid activation and proxy configuration, pre-installed on default AMIs, Linux and Windows - Amazon Web Services — Amazon EC2 (Linux and Windows instances with SSM Agent installed)
Vulnerable versions: any EC2 instance with amazon-ssm-agent installed and running
Timeline
- Mitiga's advisory references earlier related community research from around January 2021 on abusing legitimate cloud agent tooling for post-exploitation access, which informed the SSM-specific research
- Mitiga states findings were shared with AWS security prior to public disclosure
- Mitiga publishes the security advisory 'Abusing the SSM Agent as a Remote Access Trojan,' detailing hybrid-mode hijacking, parallel-agent, and proxy-abuse exploitation scenarios along with detection guidance
- BleepingComputer publishes coverage of the Mitiga findings, summarizing AWS's public response that the SSM Agent is 'behaving as designed'
- Community researcher Muhammad Faisal publishes a Sigma detection rule ('Potential Amazon SSM Agent Hijacking') tagged to MITRE ATT&CK T1219.002, targeting indicators from the Mitiga report
- The Hacker News, CSO Online, Infosecurity Magazine, Help Net Security, and SiliconANGLE publish independent coverage summarizing the technique and AWS/Mitiga mitigation guidance
- The community Sigma rule for SSM Agent hijacking is promoted from experimental to 'test' status
- The Sigma rule is updated to align its MITRE ATT&CK T1219.002 tagging with the current technique specification
Sources cited
- Mitiga Security Advisory: Abusing the SSM Agent as a Remote Access Trojan mitiga.io · Advisory · 2023-07-31
- Sigma Rule: Potential Amazon SSM Agent Hijacking valhalla.nextron-systems.com · Research · 2023-08-02
- Researchers Uncover AWS SSM Agent Misuse as a Covert Remote Access Trojan The Hacker News · News · 2023-08-02
- Amazon's AWS SSM agent can be used as post-exploitation RAT malware BleepingComputer · News · 2023-08-01
- Mitiga report reveals unique way to abuse AWS Systems Manager agent siliconangle.com · News · 2023-08-02
- Researchers warn Amazon's AWS System Manager agent can be used as a RAT csoonline.com · News · 2023-08-02
- Threat Actors Use AWS SSM Agent as a Remote Access Trojan infosecurity-magazine.com · News · 2023-08-02
- Attackers can turn AWS SSM agents into remote access trojans Help Net Security · News · 2023-08-02
Drafted by the Threadlinqs research pipeline from 8 sources; published ; last updated —.