Persistence · Privilege Escalation · ATT&CK v20
T1098.004 Account Manipulation: SSH Authorized Keys
A Persistence technique. Keeping access across reboots, password changes and clean-ups.
- T1098.004Technique ID
- Persistence, Privilege EscalationTactics
- 2Places taught
What the attacker does
The attacker adds their own public key to a user's ~/.ssh/authorized_keys, so they can log in with SSH even after the password changes.
How it shows up in the logs
- A write to authorized_keys (auditd watch, file integrity monitoring, EDR file events).
- auth.log "Accepted publickey for" with a key fingerprint not seen before for that user.
- echo or cat appending to the file from a web shell or an unusual session.
Questions to ask in triage
- Which key was added, by which process, and when?
- Has the key been used, and from where?
- Remove it and check other users' key files on the same host.
Read T1098.004 on attack.mitre.org
A sub-technique of T1098 Account Manipulation.
Where you meet it in CyberSim
In the theory
In the hands-on labs
A simulated machine in your browser.
More Persistence techniques
- T1053.003 Scheduled Task/Job: Cron
- T1053.005 Scheduled Task/Job: Scheduled Task
- T1098.003 Account Manipulation: Additional Cloud Roles
- T1098.005 Account Manipulation: Device Registration
- T1136.001 Create Account: Local Account
- T1136.002 Create Account: Domain Account
- T1505.003 Server Software Component: Web Shell
- T1543.002 Create or Modify System Process: Systemd Service
- T1543.003 Create or Modify System Process: Windows Service
- T1547.001 Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder
- T1556.006 Modify Authentication Process: Multi-Factor Authentication
Source: MITRE ATT&CK T1098.004, tactic TA0003.