LmCast :: Stay tuned in

How I got over 300 Tor exit nodes removed

Recorded: Oct. 20, 2026, 3 p.m.

Original Summarized

How I got over 300 Tor exit nodes removed - KABA

Home
KABA.CX

How I got over 300 Tor exit nodes removed

October 20, 2026

On Friday Oct 2, 09:35am, 333 infected exit nodes started a coordinated campaign to intercept SSH connections and gather as much unencrypted data as possible.

To give you a sense of scale, all of Tor has around 3000 exit relays, so roughly 10% were under their control.

The attackers had gained access to the servers two months earlier, in August, and quietly deployed their Ebury 1.8.3 payload (an OpenSSH backdoor and credential stealer for Linux).

The Attack

The attack appears to have had two primary goals:

Gather as much unencrypted mail traffic as possible

Intercept SSH connections (MITM)

By blocking certain ports, they made their exit nodes handle only unencrypted mail traffic.
An interesting writeup by one of the victims (a veteran Tor operator) goes into great detail about that:
lists.torproject.org/mailman3

In this post I'll focus on the second attack, the SSH MITM.
If you happen to get a circuit that exits over one of those 333 infected exit nodes, you won't notice anything at first.
Encrypted web traffic is forwarded as usual, but if you attempt an SSH connection over Port 22, you're unknowingly redirected to one of 12 SSH interception servers.

That's exactly what happened to me on Friday morning.
My SSH connection got redirected, and I was greeted with this warning:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ED25519 key sent by the remote host is
SHA256:6baCZCPsl+AfQuujUS81fMEE/C7UeJ+AwjrImqmDB3E.
Please contact your system administrator.

But if you ignore the warning and go ahead with the login, the attacker does three things:

Steals your password

Opens a connection to your server and observes each command you type (MITM)

Opens a second connection to your server and infects it with Ebury

Getting them taken down

On Friday evening I contacted the Tor Project's network health team with my findings.
They confirmed this was something new and got to work by contacting the affected relay operators.

"We've not seen an attack like that before."
- Tor Network Health Team

Fri Oct 2: Interception started.

Sun Oct 4: The Tor network health team made an announcement to the operators, who began shutting their exit nodes down.

Sun Oct 4: The relays were marked BadExit, so clients would no longer use them to exit traffic.

Mon Oct 5: The attackers restarted many of the relays, but since they were already flagged they could only serve as middle relays.

Mon Oct 5: All infected servers were shut down, partly by the operators and partly by the attackers.

In their announcement, the health team described the pattern:

"It seems the attacker is gaining access to Linux based hosts and when these machines are running non-exits they are editing the torrc file and turning them into exits to be able to carry out the SSH attack."
- Tor Network Health in the announcement

You can see the impact of those 333 exit nodes being shut down.
On metrics.torproject.org a clear dip is visible on October 4th and has not recovered since.

Consider running a relay: community.torproject.org/relay/setup/

The technical part: how I found them

In this part I'll go into detail about how I found all the infected exit nodes.

Using exitmap, I built a simple script that did the following:
it pinned an exit node, then opened an SSH connection from my server A to my server B.

Server A checked whether it received the correct SSH fingerprint from server B.

Server B checked whether the connection came from the pinned exit node or from one of the 12 SSH interception servers.

I ran the script against every single one of the ~3000 exit relays.
Around a dozen served a fake fingerprint, and over 300 didn't intercept anything but redirected through those same interception servers.
Redirecting alone was enough to confirm the exit was infected.

In some further analysis I used sshesame as a honeypot.
Tricking the MITM into logging into the honeypot showed that they used paramiko (a Python SSH library) and also how they attempted to install Ebury using Perl.


> echo "U=$(id -u) S=$(command -v sudo >/dev/null 2>&1 && (sudo -n true 2>/dev/null && echo nopass || echo maybe) || echo none)"
> sudo bash -c 'echo <base64> | base64 -d | perl'

Checking for permissions first, then executing a base64-encoded command.

Open Questions

The biggest question is still how they got into all those servers in the first place.
One theory is that the hosting company itself was hacked
(discussed here: lists.torproject.org).
But that's just a theory floating around. In truth, no one really knows.

Another is who's behind it.
The use of Ebury and the broad collection of unencrypted data point to a financially motivated crime group.
Though this too is just speculation.

"Given how many servers had Ebury between 2009 and 2023 (400 000!) there are most likely other compromised Tor relays out there."
- Marc-Etienne M. Léveillé
(lists.torproject.org)

I also suspect they deliberately launched their attack on a Friday, hoping that no one would want to ruin their weekend by responding.
All the more credit to the Tor Team for acting so quickly!

Takeaway

The lesson is the same as always: extra security is a worthwhile investment.
Disable password authentication in favor of ssh keys.
I for one am going to buy myself some hardware keys today. :)

"At the end of the day, relays/bridges need to be treated as highly targeted production machines."
- George
(lists.torproject.org)

The article from KABA, authored by the writer, recounts a significant cybersecurity incident involving the coordinated removal of over 300 Tor exit nodes. On Friday, October 2, 09:35 am, an estimated 333 infected exit nodes launched a coordinated campaign to intercept SSH connections and extract unencrypted data, representing approximately 10 percent of the Tor network's roughly 3000 exit relays. The attackers had established access to these servers two months earlier, in August, and had silently deployed the Ebury 1.8.3 payload, an OpenSSH backdoor and credential stealer designed for Linux systems. The attackers' primary objectives were to gather as much unencrypted mail traffic as possible and to perform man-in-the-middle (MITM) interception on SSH connections, which involved blocking specific ports to force the exit nodes to handle only unencrypted mail traffic, thereby enabling data collection.

The SSH MITM attack specifically targeted users who connected to circuits exiting through one of the 333 compromised exit nodes. While encrypted web traffic was forwarded normally, any SSH connection on port 22 was redirected to a set of 12 dedicated SSH interception servers. The author experienced this firsthand on Friday morning, receiving a warning that remote host identification had changed and displaying the fingerprint of an ED25519 key, indicating a potential man-in-the-middle attack. If the user proceeded with the login, the attacker would steal the password, intercept and observe all typed commands, and subsequently infect the server by installing Ebury. The author detailed the detection process by constructing a script that utilized exitmap to pin an exit node, then established an SSH connection from a server A to a server B. Server A verified the correct SSH fingerprint, while server B checked whether the connection originated from the pinned exit node or from one of the interception servers. This script was executed against all approximately 3000 exit relays, revealing that around a dozen served a fake fingerprint, and over 300 redirected traffic without directly intercepting it, which was sufficient to confirm the exit node's infection. Further analysis employed a honeypot called sshesame, which exposed the attackers' use of the Python SSH library paramiko and their method of installing Ebury via Perl, involving a base64-encoded command that first checked for available permissions.

In response to the incident, the author contacted the Tor Project's network health team, which confirmed the attack as novel and immediately began coordinating with affected relay operators. The containment timeline unfolded as follows: on Sunday, October 4, the health team issued an announcement to operators, who began shutting down the infected exit nodes. On the same day, the relays were marked BadExit, preventing clients from utilizing them. On Monday, October 5, the attackers attempted to restart many of these relays, but because they were already flagged, they could only function as middle relays. All infected servers were subsequently shut down, either by operators or the attackers themselves. The Tor Project's announcement described the pattern: the attacker gained access to Linux-based hosts, edited the torrc file, and converted them into exits to enable the SSH attack. The impact was evident in metrics.torproject.org, where a clear dip on October 4th persisted without recovery.

Open questions remain regarding the initial compromise. One theory posits that the hosting company itself was hacked, though this remains speculative. The identity of the attackers is also uncertain; the use of Ebury and the broad collection of unencrypted data suggests a financially motivated crime group, a suspicion reinforced by the observation that over 400,000 servers had Ebury between 2009 and 2023, indicating a likely prevalence of other compromised relays. The author speculates that the attackers deliberately chose a Friday, anticipating minimal weekend response, and credits the Tor Team for their swift action. The article concludes with a takeaway emphasizing the importance of investing in extra security measures, such as disabling password authentication in favor of SSH keys and even hardware keys, and the need to treat relays and bridges as highly targeted production machines.