DET0126 / GUIDANCE
Detection Strategy for SSH Key Injection in Authorized Keys
Adversary attempts to gain persistence by modifying ~/.ssh/authorized_keys via shell, text editor, echo or redirected output. Insertion of public keys into authorized_keys using bash/zsh or editor tools, correlated with suspicious process ancestry. Abuse of cloud metadata APIs or CLI to push SSH public keys to authorized_keys of virtual machines. Direct modification of /etc/ssh/keys- /authorized_keys or enabling SSH in sshd_config to support public key auth. Use of command-line like `ip ssh pubkey-chain` to bind SSH keys to privileged accounts on routers or switches.
- Category
- Detection & response
- Version / scope
- ATT&CK Enterprise 20.1; object 1.0
- Affected / relevant technologies
- Enterprise systems
- Evidence
- Documentation: pinned-source excerpt checked. Execution: not tested. Editorial: curated reference.
Defensive analysis and explicitly authorized assessment only. This website performs no scans, exploitation, model calls or infrastructure changes. Indicators below are investigation opportunities, not proof of compromise or guaranteed detectors.
Mechanism and prerequisites
Assess applicability to the documented environment and obtain authorization before any testing. This publisher reference is not a tested configuration or execution guide.
Potential impact
The publisher describes a mitigation or detection scope; applicability does not establish local protection or an incident.
Versioned source scope
This record contains normalized, sometimes shortened source excerpts with editorial safety context. Markup and executable example blocks are omitted. Source-field verification does not establish device testing, a working detector or local applicability.
Publisher: MITRE. Release: ATT&CK Enterprise 20.1. Source checked: 2026-11-18.
Source object: x-mitre-detection-strategy--cf33849d-67f4-418e-9a41-6a6c082e576a. Object created: 2025-10-21T15:10:28.402Z. Object modified: 2026-05-12T16:34:50.693Z.
Attribution and source terms (© The MITRE Corporation; reproduced with permission)Detection and investigation
- Analytic 0350: Adversary attempts to gain persistence by modifying ~/.ssh/authorized_keys via shell, text editor, echo or redirected output.
- Analytic 0351: Insertion of public keys into authorized_keys using bash/zsh or editor tools, correlated with suspicious process ancestry.
- Analytic 0352: Abuse of cloud metadata APIs or CLI to push SSH public keys to authorized_keys of virtual machines.
- Analytic 0353: Direct modification of /etc/ssh/keys- /authorized_keys or enabling SSH in sshd_config to support public key auth.
- Analytic 0354: Use of command-line like `ip ssh pubkey-chain` to bind SSH keys to privileged accounts on routers or switches.
Preserve source timestamps, asset identity and collection context. Correlate independent evidence before attributing malicious intent. In OT, review passive evidence with the process owner; do not induce failures, replay commands or write to controllers to test a hypothesis.
Mitigation and response
- See publisher mitigation relationships where available; local control effectiveness requires independent assessment.
Apply changes through the asset owner's approved change and recovery process. Documentation review is separate from successful testing or verified production protection.
Publisher analytics
Source excerpts and listed log sources describe the publisher's analytic references; they are not independently validated detection rules or evidence of operational coverage.
- AN0350 — Analytic 0350
Adversary attempts to gain persistence by modifying ~/.ssh/authorized_keys via shell, text editor, echo or redirected output.
Publisher platforms: Linux.
Publisher log sources: auditd:SYSCALL / write | PATH=/home/*/.ssh/authorized_keys; auditd:SYSCALL / execve.
- AN0351 — Analytic 0351
Insertion of public keys into authorized_keys using bash/zsh or editor tools, correlated with suspicious process ancestry.
Publisher platforms: macOS.
Publisher log sources: macos:unifiedlog / process: exec + filewrite: ~/.ssh/authorized_keys; macos:auth / ~/.ssh/authorized_keys.
- AN0352 — Analytic 0352
Abuse of cloud metadata APIs or CLI to push SSH public keys to authorized_keys of virtual machines.
Publisher platforms: IaaS.
Publisher log sources: gcp:audit / compute.instances.setMetadata.
- AN0353 — Analytic 0353
Direct modification of /etc/ssh/keys- /authorized_keys or enabling SSH in sshd_config to support public key auth.
Publisher platforms: ESXi.
Publisher log sources: esxi:shell / file write or edit.
- AN0354 — Analytic 0354
Use of command-line like `ip ssh pubkey-chain` to bind SSH keys to privileged accounts on routers or switches.
Publisher platforms: Network Devices.
Publisher log sources: networkdevice:cli / ip ssh pubkey-chain.
Related technical context
No protocol-specific mapping is asserted for this entry.
Publisher-defined relationships
These directed relationships come from the pinned publisher data. They describe framework context, not guaranteed prevention, detection coverage or equivalence between entities.
Authoritative sources and attribution
Identifiers and source titles belong to OWASP, MITRE, the CVE Program, CISA, NIST or the cited vendor. Source excerpts are attributed and adapted under the linked publisher license; editorial context is separate. This is not an official framework mirror. Review baseline: 2026-11-18. Live documents can change; check exact current applicability.
- https://attack.mitre.org/detectionstrategies/DET0126 — Publisher link; not separately HTTP-checked
- enterprise — source accessed 2026-11-18
Source review supports bounded reference text. It is not execution evidence, a completeness claim, a CVSS assessment, a compliance certification or verification of production security.
