Account Manipulation: SSH Authorized Keys T1098.004
Tactics: Persistence, Privilege Escalation
Adversaries may modify the SSH authorized_keys file to maintain persistence on a victim host. Linux distributions, macOS, and ESXi hypervisors commonly use key-based authentication to secure the authentication process of SSH sessions for remote management. The authorized_keys file in SSH specifies the SSH keys that can be used for logging into the user account for which the file is configured. This file is usually found in the user's home directory under &lt;user-home&gt;/.ssh/authorized_keys (or, on ESXi, `/etc/ssh/keys-<username>/authorized_keys`). Users may edit the system’s SSH config file to modify the directives `PubkeyAuthentication` and `RSAAuthentication` to the value `yes` to ensure public key and RSA authentication are enabled, as well as modify the directive `PermitRootLogin` to the value `yes` to enable root authentication via SSH. The SSH config file is usually located under /etc/ssh/sshd_config.
Events covered
4 catalog events are tagged with this technique by at least one rule.
| Provider | Event | Title |
|---|---|---|
| Linux-Auditd | Event ID 1302 | PATH |
| Linux-Auditd | Event ID 1307 | CWD |
| Sysmon-for-Linux | Event ID 1 | Process Create |
| Sysmon-for-Linux | Event ID 11 | File created |
Authoring guide
These 13 rules share fields, values, and exclusions.
Fields filtered most (20 distinct)
These fields appear most often in rule filters.
Top indicator values (316 distinct)
These values appear most often in rule predicates.
Exclusions (22 distinct)
These values appear most often in top-level exclusions.
Rules under this technique
These vendors publish rules tagged with this technique.
Elastic 9 rules
- AWS EC2 Instance Connect SSH Public Key Uploaded
- Pod or Container Creation with Suspicious Command-Line
- Potential Persistence via File Modification
- Potential Redis CONFIG SET SSH Authorized Key Injection
- SSH Authorized Key File Activity Detected via Defend for Containers
- SSH Authorized Keys File Activity
- SSH Key Generated via ssh-keygen
- Suspicious Echo or Printf Execution Detected via Defend for Containers
- Unusual Login via System User