by rafpin · 2y ago · 0 comments
I'm not sure I got it correctly, but seems the RCE can only be performed after connecting to the ssh server, but if the port is hidden behind a reasonable sequence of tcp/udp knocks, then it won't happen?
I've been using port knocking on ssh servers, and it definitely does not replace proper ssh configuration, but so far seems like a cheap extra layer of defense that might either prevent or give extra time to respond when these ssh vulnerabilities appear.
That said, just make sure you aren't using the backdoored versions. I don't see how you can reasonably skip this step.
Such things can always be automatically discovered.
https://github.com/eliemoutran/KnockIt
Any effort spent on setups like this is likely better spent removing the need for having ssh at all by moving to immutable appliance distros be they specialized like homeassistant or general purpose like TalosOS.
This is not obscurity, as someone said on HN earlier, good security is good armor, good port knocking is camouflage. They are both important.
Wouldn't fail2ban + reasonably sized (10+ ports using a mix of udp and tcp) knock sequence prevent brute force attacks like these?
Better time investment in security is just do not have ssh or a shell in production in the first place, because ssh is probably not required for your production application to function.