Hi Andy,
At Z+0000=2024-10-30Wed20:45:22, Andy Smith via BitFolk Users sent:
[...]
Since BitFolk has a business relationship with its suppliers, if they have an issue they
will contact us about it and we'll probably iron it out without BitFolk's customer
being involved.
It is when an abuse report comes in from some third party that has no contractual
relationship with BitFolk or the customer concerned that we would pass this on to the
customer to deal with because it will be boring administrative work. First though we must
determine if it's a genuine report of malicious behaviour, as we wouldn't want to
just pass on an abuse report with the reporter's contact details to the possible bad
actor.
I am really only talking about the cases where it's clear it is some misunderstanding
or at least something to be discussed and negotiated, and with permission of the
reporter.
An non-Tor-related example that springs to mind is when automated scans of web servers by
"good cause" projects find a binary that is a known piece of malware, so they
report it to us as a possibly infected host, but we happen to know for example that the
customer concerned is a security researcher or penetration tester and the file is there on
purpose. Rather than explain all this on our customer's behalf we would like to put
them in direct contact with each other.
Yep, this all makes sense. Thanks for clarifying. :-)
[...]
In this case there cannot be any payload because a TCP connection can't exchange any
data until the three way handshake is completed to set it up.
Yep, it can't transmit any TCP payload data. When I first mentioned
"payload", I think I was actually thinking about the payload of the IP packet --
in this case the IP payloads are the TCP packets that are all TCP header.
In other words, when I was wondering about looking closer at the packets for details
that might help differentiate, I was wondering whether there were any other details in
these spoofed packets that could be used to distinguish them from legitimate SSH
connections, in either the fields that have been listed by Delroth, or in fields or flags
that were in Delroth's TCPdump that were not listed, if any. Given that these IP
packets are small and all-header, with just a few header fields, if anything could
distinguish them, these details are probably already visible in Delroth's article.
I have been thinking about this some more, and something that I am wondering about is
whether the src and dst /ports/ seem to be back-to-front from the usual way of doing it.
This comprises a single bit of information hidden in plain sight which is actually quite
helpful in potentially blocking this attack, if I am not mistaken.
My understanding, in the 3-stage handshake, SYN, SYN+ACK, ACK, is that that initial
SYN packet usually goes from a high port to a low port -- e.g. a low port of 22 for SSH.
Now, Delroth's article does open with this quoted abuse alert email listing a number
of packets outbound from Delroth's server at 195.201.9.37 with high src ports, and
heading towards dst port 22 on various other hosts -- making it look like, at first
glance, that these are SSH connection attempts initiating on Delroth's 195.201.9.37.
But as Delroth soon discovers that these are backscatters triggered by incoming spoofed
SYN packets, it means that these outgoing packets are actually SYN+ACK packets, and thus
/out-of-phase/ with the usual sequence. This could be a really key way to detect and
block this kind of attack, both for operators of servers and for service providers running
honeypots with automated abuse warnings.
I also notice that the destination IP addresses listed are all within the range of
202.91.16[1-3].* -- in the quoted email, that is -- the others listed below are different,
though. I also wonder whether the TTL of these packets would be 1 less than normal --
however, this can be spoofed as well, and also depends on how far these have travelled
across the Internet, so not really very helpful.
The SYN versus SYN+ACK phase mismatch seems to me like the most useful thing here.
Also, simply blocking outbound SSH, except for a whitelist, seems like a quick easy fix.
This would not block me from SSH'ing-in to the server, and if I find that I want to
SSH-out to another server, maybe for SCP, SFTP, Rsync, a temporary port forward, or
whatever and I find that I have blocked myself -- well I can fix that from that server
that I am already SSH'd into! :-) I don't see the harm in blocking outbound SSH
until otherwise needed, if it avoids transmitting abuse, seeing as I can always change
that later if it becomes a problem.
All that happens here is:
ATTACKER --SYN packet with source IP of VICTIM--> TARGET
TARGET --SYN+ACK packet back------------------> VICTIM
VICTIM --RST back because sequence number-----> TARGET
didn't match any SYN it had sent
All of these are empty TCP packets with only flags and src/dst IPs in them.
ATTACKER's real IP address is not known to anyone because they have forged
VICTIM's IP as the source on their packets.
Yep, so, for clarity, I will annotate that with what I think the high/low port numbers
are doing in the activity that Delroth has observed:-
ATTACKER
\
\
-SYN packet with source IP of VICTIM--> TARGET
VICTIM <------------------SYN+ACK packet back-- TARGET (e.g. Delroth's
VICTIM --RST back because sequence number-----> TARGET 195.201.9.37:xxxxx)
(port 22) didn't match any SYN it had sent
Btw., it seems to me that both TARGET and VICTIM are victim to different parts of the
attack -- VICTIM is victim to a more typical DDoS attack, whereas TARGET is victim to
consequences that may be more severe than mere Denial-of-Service. I would label these
VICTIM1 and VICTIM2, if not for matching the labels with your own diagram.
Normally this would probably go totally unnoticed.
It's only because certain sites are hyper sensitive to port 22 SYN packets being
received and think it is an SSH dictionary attack. Really they should wait for the
connection to be established and log the actual login attempt before assuming that.
Yes, hypersensitive security can create new vulnerabilities and instabilities. But if
I am not mistaken about the aforementioned phase mismatch, there could be a small
adjustment to those detections that avoids incentivising this new kind of attack that
seems to be leveraging those abuse alerts as a new form of abuse in itself. Well, nothing
new about the concept of a "stitch-up", but it may be fairly new to witness a
stitch-up at the TCP/IP level in incomplete connections that don't even complete their
TCP handshakes.
Btw., "port 22 SYN packets" is ambiguous, in this context. Normally, a port
22 SYN packet would be a SYN packet with a destination port of 22. In this context,
Delroth observed packets that were out-of-phase with this usual relationship, implying
that in fact the SYN packets in this case actually had a source port of 22 -- as far as I
understand. These are 2 very different things, even though informatically, this can be
reduced to being different by only a single bit of information. This single bit of
information may be key to distinguishing the spoofed packets and blocking them before any
backscatter occurs.
[...]
Okay, yes. But in this case the only link between Tor and SSH is that some miscreant has
apparently decided to harass operators of known Tor nodes by means of attacking servers
known to run SSH. Tor is really incidental here and the attacker could just as well have
decided to target IP addresses thought to be in Spain, or IP address that are prime
numbers or something.
Yep.
When the forged traffic hits the TARGET, it has not
been anywhere near the VICTIM yet, so whatever software the VICTIM is running is not
relevant.
I never suggested it was. It is TARGET that represents the Tor relay. And as Delroth
and we have established and seconded, the software on TARGET such as Tor is not
particularly relevant either, except in being the reason selected as the target of this
attack.
[...]
So what I mean is that it wouldn't matter if VICTIM is a Tor exit node or relay node
or not a Tor node at all, it could even be a networked coffee machine. It was a human
attacker who seems to have chosen to harass people operating Tor nodes.
Agreed, but VICTIM? Have I misinterpreted the orientation of VICTIM and TARGET in
your diagram? Are you implying that Delroth's 195.201.9.37:xxxxx is an example of
VICTIM in your diagram, rather than TARGET? This would be an alternative explanation for
the srcport/dstport phase mismatch that I see, but I don't see how that would match
Delroth's logs that he quoted in his article. I may be mistaken but it is worth
checking this phase mismatch idea because I think that it could be very helpful if it
turns-out to be an easy identifier.
[...]
That is correct. It seems that some setups require only to see TCP SYN packets and
consider that an attack. Over-sensitive intrusion detection systems have been a thing for
as long as there have been networks and ways to report abuse.
Even predates computer networks -- you can generalise it with witch-hunts, for
example. (Lol, to be making this comment by-chance on 31st October! :-P No pun was
intended.)
[...]
It is in some ways a pity that there is a public directory of all Tor nodes which makes
it easier for people to harass them, but it's an open decentralised network so these
things need ways to find each other. Also a lot of site operators demand a way to know all
Tor exit node IPs so they can pre-emptively block them.
Probably there are multiple other things like Tor but with more secretive node
directories.
If "like Tor" means "anonymising network", then I think that this
might actually be an impossible problem to solve. To anonymise requires that multiple
users (preferably a very large number) use the network and their identities are shuffled.
Anyone who uses the network will come into direct contact with nodes on the network, and
thus have access to attack them.
If the node-directories were somehow made secret, then this would not be an
open-access network. The entire network being closed-access, implies a central control,
and this central authority would operate more like an individual. E.g., if a government
agency operated its own, in-house anonymising network -- whatever goes in or out of it is
connected with that government agency, and so it is not really anonymising that agency in
any useful way. I gather that Tor itself was born out of a USA governmental/military
agency desire to anonymise, and had to make it open-access and gather enough civilian
support in order to hide the military activity. So Tor's own foundings kind of imply
that an anonymising network has to be open-access and thus will always be very easy to see
some or all of the participating nodes.
[...]
I think so yes. I cannot really think of any other service where people are so twitchy
about looking at multiple "strange" connections attempts to it.
I see.
You would not even notice if this were port 80/443 for
example because you do expect the world to visit a public web site and the web server
would log nothing as none of those connections ever get established far enough for user
space to see them.
Yep.
Kind regards,
James.
--
Wealth doesn't bring happiness, but poverty brings sadness.
Sent from Debian with Claws Mail, using email subaddressing as an alternative to
error-prone heuristical spam filtering.