New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Comments
I'm not sure but I might still have the contact data of one of their higher up techies. If I find those I'll try contacting them and bring the problem to their attention.
Oopsie
@forest
Done, email to Contabo contacts sent. Hopefully they'll react (although probably only tomorrow).
1000%. Even the moderators despise what the staff do. And somehow every action the company takes makes things worse, as if that was their only goal.
@forest
Sorry, no response so far. But keep in mind that my last contact with the Contabo people was >= 5 years ago, so maybe the two I tried to contact don't work there anymore or the email addresses have changed.
If and as soon as I get a response I'll let you know here.
Contabo is know for being 'friendly' towards spammers and other bad actors, I suppose they will ignore complaints.
Some of the attacks are moving to OVH now.
I might test out blocking an IPv4 /24 if more than 6 IPs connect from it at once, or a /32 if it's connecting to more than 6 of my relays at once (there's no reason a single IP should have 6 guards, much less 6 guards from my relay family). Of course, exempting other relays which do have legitimate reasons to make many connections.
I run a Tor relay on a Spectrum cable modem and saw ~70 Mbps in sustained use (this is non-high-split symmetric).
The attackers abused the DOCSIS burst heavily so I had to throttle the relay to ~25 Mbps.
Why do you think it was any kind of DDoS though, 70 Mbps sustained just sounds normal for an average Tor relay operation.
Of course you can reduce that if it's too much for your connection. But rather than throttling it via external means, set up your bandwidth in torrc.
Asymmetric use maybe? There have recently been some strange issues where relays have had nearly 10x outbound rate than inbound, which I can only assume is someone abusing the directory cache somehow.
This updated
tor-ddos.confmay do better in some situations. I'm still testing it:This simplifies the blacklisting by only dealing with IPv4 /24 and IPv6 /64 so the hoster end-site prefix length doesn't need to be hardcoded. It also adds a per-/24 (and /64) max connection limit in addition to keeping the per-/32 (and /128) and additionally blocks established connections that have gotten blacklisted.
I'll be keeping an eye out for false positives.
drop nftables traffic in the ingress chain (i.e before conntrack) - not the input chain
I block 5-6000 ip's with fail2ban / nftables for zero cpu cost
It's a layer 7 DDoS, so even at its most severe, it's not going to be stressing nftables at all. That's why I didn't put much effort into micro-optimizations. But conntrack is needed anyway because it has to update the blacklist timeout each time too many new connections are attempted (i.e. an IP that attempts to connect too fast while blacklisted will reset the timeout).
In the past, for heftier servers experiencing layer a layer 4 DDoS, I had to write BPF code directly and use
xt_bpfwhich worked wonders. That was kept in the (iptables) raw table. I wish nftables had BPF support.I now see (and remembered it from before -- I even have scripts for crontab to deal with this) another symptom of the DDoS. RAM usage leak, i.e. it climbs for no reason and stays there, in a bit of unexplained way. Affected nodes will end up using a lot of swap over time, like 1.2 GB swapfile use on a 2 GB RAM VPS - even though Tor is only consuming like 1GB "RES" in top. There's also very little "avail" mem, so it's not simply in "buffers/cache". Where is it, who knows. And Tor performance drops off, since it constantly needs to fetch some data from swap and write out other data. A lot of "kswapd" in top, and iowait%.
The solution for me is to kill the Tor process,
swapoff -a,swapon -aand start Tor again. This helps for a decent period, like 6-12 hours or more.Set
DosCircuitCreationBurst 20in the torrc. That helps significantly with memory growth from the current DDoS. The other solution (which should be done even if you aren't being DDoSed) is to switch to jemalloc2 (or mimalloc2 if it's available)The problem is that Tor is naturally subject to a lot of memory fragmentation, particularly due to the consensus diff cache, and the native glibc memory allocator, ptmalloc3, suffers from fragmentation badly. The DDoS just exacerbates this issue.
Just using jemalloc2 alone reduces memory usage by more than 75%.
Isn't that something for Tor itself to do? It always felt that aside from running relays, we are also expected to crank their shit so much for them.
I could see adding a line to torrc, but hacking the initscript with a custom .so preload is beyond reasonable. And then keep ensuring that hack is reapplied after every Tor update, gl hf.
It wouldn't be really feasible for them to do that because they just use whatever
malloc()the system makes available to them. It just so happens that glibc's ptmalloc3 has pathological behavior in this case.Tor Project is rewriting Tor in Rust (the daemon is called Arti), so the Tor binary written in C is getting fewer updates for the time being. It's still being maintained of course, but major changes to the way it handles memory won't be necessary as soon as Arti is released. But it's still in beta so we're stuck with C Tor for now.
No hack needed, just two commands:
Then it'll be applied automatically on every upgrade without modifying Tor itself (which is the standard way for changing the memory allocator for an arbitrary service under systemd). I think OpenRC can do something similar.
If for whatever reason you aren't able to do that, an equivalent fix would be to add
DirCache 0to your torrc. That will disable the functionality that causes the most severe memory fragmentation, but the downside is that your relay will be disqualified from the guard position so it will only be able to act as a middle. Still better than OOMing all the time, though.I won't use systemd, hence I said initscript. I am not sure if
/etc/init.d/toris overwritten on Tor updates. Same as for your[email protected], technically it should.Added that, thanks. Always found that becoming a guard ruins the BW numbers in any case, at least for a while.
I mean they could preload jemalloc if it's available, or have a setting in torrc to do so.
That's fair enough (I'm no fan of systemd myself, but I use Debian for simplicity and that's what it comes with). I believe the init script is overwritten, although usually it might source the defaults file. Check if the init script has something along the lines of
[ -f /etc/defaults/tor ] && . /etc/defaults/toror equivalent. If so, you can just exportLD_PRELOADin the defaults file and it will stay unmodified across updates (that's what the defaults file is for).The
[email protected]doesn't get overridden at update because I usedsystemctl editcommand which creates a separate/etc/systemd/system/[email protected]/override.conffile.It's probably ruining the BW numbers because the memory fragmentation is creating an I/O bottleneck from swap (or from the diff cache being paged in over and over). Guards usually have higher bandwidth, but if being a guard is crippling the relay with memory pressure, then it could certainly make bandwidth worse.
Ideally they'd just fix whatever is causing the pathological memory fragmentation behavior.