Remote Service Session Hijacking: SSH Hijacking
- ID
- T1563.001
- Tactics
- TA0008 Lateral Movement
- Sub-technique of
- T1563 Remote Service Session Hijacking
- Platforms
- Linux, macOS
- Data sources
- Network Connection Creation, Process Creation, Logon Session Creation, Process Metadata
- Source
- attack.mitre.org
- MITRE last modified
- 25 Oct 2025
Adversaries may hijack a legitimate user's SSH session to move laterally within an environment. Secure Shell (SSH) is a standard means of remote access on Linux and macOS systems. It allows a user to connect to another system via an encrypted tunnel, commonly authenticating through a password, certificate or the use of an asymmetric encryption key pair.
In order to move laterally from a compromised host, adversaries may take advantage of trust relationships established with other systems via public key authentication in active SSH sessions by hijacking an existing connection to another system. This may occur through compromising the SSH agent itself or by having access to the agent's socket. If an adversary is able to obtain root access, then hijacking SSH sessions is likely trivial.[2][3][4][5]
SSH Hijacking differs from use of SSH because it hijacks an existing SSH session rather than creating a new session using Valid Accounts.
Detection
- DET0256 Detection Strategy for SSH Session Hijacking
Data components: Network Connection Creation, Process Creation, Logon Session Creation, Process Metadata
Mitigations (4)
- M1022 Restrict File and Directory Permissions
Ensure proper file permissions are set and harden system to prevent root privilege escalation opportunities.
- M1026 Privileged Account Management
Do not allow remote access via SSH as root or other privileged accounts.
- M1027 Password Policies
Ensure SSH key pairs have strong passwords and refrain from using key-store technologies such as ssh-agent unless they are properly protected.
- M1042 Disable or Remove Feature or Program
Ensure that agent forwarding is disabled on systems that do not explicitly require this feature to prevent misuse. [1]
Software (1)
References
- Symantec SSH and ssh-agent
- Slideshare Abusing SSH
- SSHjack Blackhat
- Clockwork SSH Agent Hijacking
- Breach Post-mortem SSH Hijack
