Skip to navigation

Threat reportCloud SecurityTL-2026-1709

AWS SSM Agent Abused as a Living-off-the-Land Remote Access Trojan via Hybrid-Activation Hijacking and Parallel Agent Processes

mediumACTIVE

Mitiga researchers demonstrate how an attacker who already holds root/administrator access on an EC2 instance or on-prem/hybrid host can repurpose the legitimate, pre-installed, Amazon-signed AWS Systems Manager (SSM) Agent as a stealthy Remote Access Trojan — either by re-registering it to an attacker-controlled AWS account via hybrid activation, or by running a second, hidden SSM agent process alongside the legitimate one — giving persistent, trusted-binary C2 without deploying any separate malware.

Key facts

IdentifiersTL-2026-1709
Also known asSSM Agent as RAT, SSM-as-RAT, AWS SSM Agent Hijacking, Amazon SSM Agent Living-off-the-Land
SeverityMEDIUM
Affected productsAmazon Web Services AWS Systems Manager (SSM) Agent
Toolsssm-as-rat
MITRE ATT&CK techniquesT1021 Remote Services, T1036 Masquerading, T1059 Command and Scripting Interpreter, T1071 Application Layer Protocol, T1078 Valid Accounts, T1090 Proxy, T1102 Web Service, T1218 System Binary Proxy Execution, T1219 Remote Access Tools, T1543 Create or Modify System Process, T1570 Lateral Tool Transfer, T1583 Acquire Infrastructure
MotivationUNKNOWN
Detection rules9 (1 shown free)
Sources14 cited sources

Detection coverage

As of 2026-07-26, Threadlinqs Intelligence publishes 9 detection rule(s) for TL-2026-1709 across Splunk SPL, Microsoft KQL and Sigma, covering 21 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: AWS SSM Agent Hybrid-Activation Hijack Registration (Splunk)

Detects amazon-ssm-agent / amazon-ssm-agent.exe invoked with the hybrid-activation registration flag set (-register -code -id -region), the exact command-line pattern used to re-point a legitimate, Amazon-signed SSM Agent to an attacker-controlled AWS account (Mitiga 'ssm-as-rat' Scenario 1: Agent Hijacking). Correlates the Windows and Linux process-creation shapes of the same technique.

Splunk SPL

(
  index=sysmon sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
  (Image="*\\amazon-ssm-agent.exe" OR OriginalFileName="amazon-ssm-agent.exe")
  CommandLine="*-register*" CommandLine="*-code*" CommandLine="*-id*" CommandLine="*-region*"
  | eval platform="windows", proc=Image, cmdline=CommandLine, host=ComputerName, acct=User
)
| append [
  search index=linux_auditd OR index=nix sourcetype IN ("linux_secure","syslog","auditd")
  (proctitle="*amazon-ssm-agent*" OR comm="amazon-ssm-agent")
  proctitle="*-register*" proctitle="*-code*" proctitle="*-id*" proctitle="*-region*"
  | eval platform="linux", proc=comm, cmdline=proctitle, host=host, acct=uid
]
| eval mitre_techniques="T1078.004,T1036.005,T1218,T1543.002,T1543.003"
| table _time, platform, host, acct, proc, cmdline, mitre_techniques
| sort -_time

Microsoft KQL

union
(
    DeviceProcessEvents
    | where Timestamp > ago(24h)
    | where FileName in~ ("amazon-ssm-agent.exe","amazon-ssm-agent")
    | where ProcessCommandLine has_all ("-register","-code","-id","-region")
    | extend Platform = iif(FileName endswith ".exe", "windows", "linux")
    | project Timestamp, Platform, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessFileName, ReportId
),
(
    SecurityEvent
    | where TimeGenerated > ago(24h)
    | where EventID == 4688
    | where NewProcessName has "amazon-ssm-agent.exe"
    | where CommandLine has_all ("-register","-code","-id","-region")
    | extend Platform = "windows"
    | project Timestamp = TimeGenerated, Platform, DeviceName = Computer, AccountName = Account, FileName = NewProcessName, ProcessCommandLine = CommandLine, InitiatingProcessFileName = ParentProcessName, ReportId = EventID
)
| order by Timestamp desc

Sigma

title: AWS SSM Agent Hybrid-Activation Hijack Registration
id: 7c1a1e2a-2f3d-4b7e-9a1e-1c9b2a6f0a01
status: experimental
description: Detects amazon-ssm-agent (Windows or Linux) invoked with hybrid-activation registration flags (-register -code -id -region), indicating possible re-registration to an attacker-controlled AWS account (Mitiga SSM-as-RAT Scenario 1).
references:
    - https://www.mitiga.io/blog/abusing-the-amazon-web-services-ssm-agent-as-a-remote-access-trojan
    - https://github.com/mitiga/ssm-as-rat
    - https://detection.fyi/sigmahq/sigma/linux/process_creation/proc_creation_lnx_ssm_agent_abuse/
    - https://detection.fyi/sigmahq/sigma/windows/process_creation/proc_creation_win_ssm_agent_abuse/
author: Threadlinqs Team
date: 2026-07-26
tags:
    - attack.persistence
    - attack.defense-evasion
    - attack.t1078.004
    - attack.t1036.005
    - attack.t1218
    - attack.t1543.002
    - attack.t1543.003
    - attack.tool.ssm-as-rat
logsource:
    category: process_creation
detection:
    selection_windows:
        Image|endswith: '\amazon-ssm-agent.exe'
        CommandLine|contains|all:
            - '-register'
            - '-code'
            - '-id'
            - '-region'
    selection_linux:
        Image|endswith: '/amazon-ssm-agent'
        CommandLine|contains|all:
            - '-register'
            - '-code'
            - '-id'
            - '-region'
    condition: 1 of selection_*
falsepositives:
    - Legitimate, deliberate hybrid-activation re-registration performed by an authorized administrator during planned fleet onboarding, DR failover, or account migration
level: high

Known false positives:

  • Legitimate, deliberate hybrid-activation re-registration performed by an authorized administrator during planned fleet onboarding, DR failover, or account migration

Tuning notes: Maintain a change-management allowlist of approved hybrid-activation maintenance windows/service accounts and suppress matches inside them; alert unconditionally on any occurrence outside a known change window, since legitimate use of '-register' is otherwise narrow.

8 more detection rules (Splunk SPL, Microsoft KQL, Sigma) · unlock with TL Creds. Sign up free to unlock the detection rules or query them with the Threadlinqs MCP server (Purple)
  • AWS SSM Agent Hybrid-Activation Hijack Registration (Sentinel) · unlock with TL Creds
  • AWS SSM Agent Parallel/Hidden-Agent Persistence (Sentinel) · unlock with TL Creds
  • AWS SSM CreateActivation / StartSession / SendCommand from Unexpected Principal (Sentinel) · unlock with TL Creds
  • AWS SSM Agent Hybrid-Activation Hijack Registration (Sigma) · unlock with TL Creds
  • AWS SSM Agent Parallel/Hidden-Agent Persistence (Sigma) · unlock with TL Creds
  • AWS SSM CreateActivation / StartSession / SendCommand from Unexpected Principal (Sigma) · unlock with TL Creds
  • AWS SSM Agent Parallel/Hidden-Agent Persistence (Splunk) · unlock with TL Creds
  • AWS SSM CreateActivation / StartSession / SendCommand from Unexpected Principal (Splunk) · unlock with TL Creds

Indicators of compromise

As of 2026-07-26, Threadlinqs Intelligence tracks 21 indicators of compromise for TL-2026-1709.

21 indicators of compromise · unlock with TL Creds. Compare plans

Technical analysis

AWS Systems Manager (SSM) Agent is a signed, first-party Amazon binary pre-installed on most Amazon Linux, Ubuntu, Windows Server, and (on EC2) macOS images, and is commonly installed on-prem and in other clouds via 'hybrid activation' for centralized fleet management. Because it is trusted, digitally signed, and frequently excluded from EDR/AV inspection, Mitiga researchers (building on 2019 and January 2021 prior work by cloudonaut.io and Nick Frichette) show it can be weaponized as a Remote Access Trojan by an attacker who already has initial code execution and root/administrator privileges.

Two exploitation scenarios are documented. Scenario 1 (Agent Hijacking) re-registers the already-installed SSM Agent to an attacker-owned AWS account using AWS Systems Manager's legitimate hybrid-activation workflow: the attacker generates an activation code/ID pair in their own account (CreateActivation), stops the local agent, runs it with '-register -code <ACTIVATION_CODE> -id <ACTIVATION_ID> -region <REGION>', and restarts it — after which the agent reports to and executes RunCommand/StartSession commands from the attacker's account instead of (or in addition to) the victim's, over normal-looking HTTPS/WSS traffic to ec2messages/ssmmessages endpoints. Scenario 2 (Parallel/Hidden Agent) runs a second SSM agent process alongside the legitimate one so the original registration and connectivity are left undisturbed: on Linux this is done either via a Linux namespace (copy agent files to an alternate path, 'unshare' into a new mount namespace, mount the alternate copy over the original path) requiring elevated-but-not-necessarily-root privileges, or via the agent's container-mode configuration flag (adjusts credential-source order to bypass the ECS metadata service, works without sudo, but is restricted to the 'Start Session' capability only); on Windows, environment variables are set to redirect the agent's configuration lookup to an attacker-controlled alternate storage location, preserving 'Run Command' access.

Both scenarios avoid dropping any new malware: all execution occurs through the trusted, Amazon-signed amazon-ssm-agent binary, so file-hash/signature-based and application-allowlisting controls do not flag it, and traffic blends into expected AWS Systems Manager network flows. The technique requires no CVE — AWS confirmed it as intended (if under-hardened) product behavior rather than a vulnerability requiring a patch, after Mitiga privately disclosed it. A public proof-of-concept toolkit (github.com/mitiga/ssm-as-rat) demonstrates both scenarios. The Mitiga writeup was substantively updated on 2026-07-22, four days before this hunt, indicating continued relevance and likely refreshed guidance (organization-wide SSM command-output logging to S3/CloudWatch, scrutiny of CreateActivation events, and VPC Endpoint restriction) that keeps the technique live for defenders in 2026.

MITRE ATT&CK techniques by tactic:

Lateral Movement

T1021 Remote Services; T1570 Lateral Tool Transfer

Defense Evasion

T1036 Masquerading; T1078 Valid Accounts; T1218 System Binary Proxy Execution

Execution

T1059 Command and Scripting Interpreter

Command and Control

T1071 Application Layer Protocol; T1090 Proxy; T1102 Web Service; T1219 Remote Access Tools

Persistence

T1078 Valid Accounts; T1543 Create or Modify System Process

Resource Development

T1583 Acquire Infrastructure

Remediation

Patches

  • No vendor patch exists or is expected — AWS classifies this as abuse of intended hybrid-activation/agent functionality rather than a vulnerability, and confirmed the finding without assigning a CVE.

Immediate actions

  • Audit Systems Manager hybrid-activation (CreateActivation) events across the organization; legitimate use is narrow, so any unexpected occurrence warrants investigation.
  • Enumerate instance-metadata directories on hosts (/var/lib/amazon/ssm/i-<id> on Linux, C:\ProgramData\Amazon\SSM\InstanceData\i-<id> on Windows) for more than one instance-ID directory, indicating possible hijacking.
  • Enumerate running hosts for more than one concurrent amazon-ssm-agent / amazon-ssm-agent.exe process, indicating a possible parallel hidden agent.
  • Remove the SSM agent binary from EDR/antivirus trusted-process allow-lists so behavioral detection is not bypassed by its Amazon code-signature.
  • Alert on process execution of amazon-ssm-agent (or amazon-ssm-agent.exe) with command-line flags '-register -code -id -region'.

Workarounds

  • Where SSM Agent is not operationally required (e.g., certain on-prem or hardened hosts), remove or disable it to eliminate the trusted-binary abuse surface entirely.

Longer-term hardening

  • Deploy VPC Endpoints (PrivateLink) for Systems Manager, ec2messages, and ssmmessages with restrictive endpoint policies that only permit the account's own SSM service principals.
  • Restrict StartSession and SendCommand execution to principals within the originating AWS account/organization via IAM condition policies (aws:PrincipalOrgID / aws:SourceAccount).
  • Enable organization-wide SSM command-output logging with S3 bucket and CloudWatch Logs configured as defaults for all SendCommand executions, so RunCommand activity cannot be silently unlogged.
  • Integrate the Sigma detections (SigmaHQ 'Potential Linux/Windows Amazon SSM Agent Hijacking') and CloudTrail anomaly rules for StartSession/SendCommand/CreateActivation into SIEM/SOAR for continuous hunting.
  • Apply least-privilege IAM policies that restrict which principals may create hybrid activations or modify SSM agent registration.

Affected and fixed versions

  • Amazon Web Services — AWS Systems Manager (SSM) Agent
    Vulnerable versions: Amazon Linux 2017.09+; Amazon Linux 2; Amazon Linux 2023; SLES 12/15; Ubuntu 16.04/18.04/20.04; Windows Server 2008–2022 (post-November 2016 builds); macOS 10.14.x–11.x (EC2 only)
    Fixed in: None — no software fix exists; mitigated via IAM/network/detection controls, not by patching the agent

Timeline

  • cloudonaut.io publishes 'AWS SSM is a Trojan Horse, Fix it Now!', an early warning about SSM Agent's over-privileged default IAM policy and root-level command execution reach.
  • Nick Frichette (frichetten.com) publishes 'SSM Agent Tomfoolery' (circa January 2021), reverse-engineering the SSM binary protocol to demonstrate EC2 message interception and session-hijacking with compromised IAM credentials — foundational research Mitiga's 2023 work builds on.
  • Mitiga publishes 'Abusing the Amazon Web Services SSM Agent as a Remote Access Trojan', detailing agent-hijacking (hybrid activation) and parallel/hidden-agent scenarios; research was shared with AWS's security team ahead of publication, and the accompanying 'ssm-as-rat' PoC toolkit is released on GitHub.
  • Mainstream security press (BleepingComputer, CSO Online, Help Net Security, The Hacker News) covers the research, amplifying awareness of SSM Agent's RAT potential across the industry.
  • SigmaHQ community detection rules 'Potential (Linux/Windows) Amazon SSM Agent Hijacking' are published by author Muhammad Faisal, matching amazon-ssm-agent process execution with '-register -code -id -region' command-line flags.
  • Cloud Security Alliance republishes and amplifies the Mitiga research as a member advisory.
  • Mitiga substantively updates the original blog post, indicating the technique and its detection/mitigation guidance remain actively relevant in 2026.
  • TL-Intel-Harness flags the updated Mitiga article during RSS hunt sweep as a continued-relevance living-off-the-land technique with a public PoC, opening threat TL-2026-1709.

Sources cited

Previous and next in cloud

Drafted by the Threadlinqs research pipeline from 14 sources; published ; last updated —.

Threadlinqs Intelligence — Real-Time Threat Detection Platform

// threat_feed
$ sort --newest
Showing all threats

Live intelligence console

Threat level

Latest Threats