Attackers Hijack Over 300 Tor Exit Relays to Intercept SSH Logins
What Happened — In early October 2024, a security researcher discovered that threat actors had taken control of more than 300 Tor exit relays. By compromising the relays’ underlying servers, the attackers were able to perform a man‑in‑the‑middle (MITM) on outbound SSH sessions that originated from Tor users between October 1 – 5. When a victim initiated an SSH connection to a remote host through Tor, the malicious exit node silently redirected the traffic to a server operated by the attackers. That server presented a fake SSH banner, captured the username and password entered by the user, and then forwarded the connection to the intended destination, allowing the attacker to harvest valid credentials without the user’s knowledge.
The researcher, who posted the findings on a public forum, captured network traces that showed the altered TCP handshake and the presence of a “proxy‑auth” string injected by the compromised relay. The malicious relays were identified by cross‑referencing the Tor consensus list with IP addresses that exhibited abnormal packet‑level behavior (e.g., unusually high rates of TCP reset packets and TLS termination on port 22). The attacker’s infrastructure was hosted on a mix of compromised cloud instances and previously hijacked home routers, indicating a low‑cost, high‑scale operation.
Tor’s design assumes that exit relays are untrusted and that end‑to‑end encryption (e.g., SSH, HTTPS) protects data in transit. However, the attack exploited the fact that many SSH users still rely on password‑based authentication when connecting through Tor, a practice discouraged by security best practices. Because the attackers could observe the clear‑text password entry after the MITM, they harvested thousands of credentials across a variety of target systems, including web servers, IoT devices, and internal corporate bastion hosts.
The researcher notified the Tor Project and several affected cloud providers. The Tor Project responded by flagging the compromised relays in its next consensus and urging users to avoid password‑based SSH over Tor. Cloud providers began revoking the malicious instances and issuing advisories to customers with assets reachable via Tor. No public attribution has been made, but the tactics align with previously observed “exit‑node hijack” campaigns that target anonymity networks for credential theft.
Why It Matters for Trust & Control Assurance — The incident underscores the need for robust network monitoring and logging of outbound connections, especially when third‑party routing services are involved. Continuous evidence of egress traffic can surface anomalous relay behavior before credentials are exfiltrated.
Who Is Affected
- Enterprises that permit remote SSH access via Tor or other anonymity networks.
- Cloud service providers whose instances are used as malicious exit relays.
- Security operations teams responsible for monitoring network egress and credential hygiene.
Recommended Actions
- Enforce key‑based SSH authentication and disable password logins for any service reachable through Tor.
- Deploy network egress monitoring that logs destination IPs, ports, and TLS/SSH handshake metadata; alert on sudden spikes from known Tor exit nodes.
- Integrate continuous verification of third‑party routing paths (e.g., Tor consensus checks) into your security monitoring stack.
- Conduct a credential rotation for any accounts that may have been used over Tor during the affected window.
- Review and harden cloud instance provisioning to prevent abuse as exit relays.
Source: The Hacker News – Attackers Hijacked Over 300 Tor Exit Relays to Intercept SSH Connections
Technical Notes
- Attack vector: Compromise of Tor exit relay servers → MITM on SSH traffic.
- Tools observed: Custom proxy scripts injecting SSH banners; use of
iptablesto redirect port 22 traffic. - Data stolen: Plain‑text SSH usernames and passwords; no encryption keys reported.
- Mitigations: Tor consensus flagging, password‑less SSH, egress traffic analytics.