Would this potentially leak consecutive TOTPs to an attacker who connects to all 1,000,000 or so possible addresses at 30 second intervals (and records the one that responds)?
Tosh: Changing your SSH server's listen address every 30 seconds based on TOTP
81–90 of 200 posts
Re: Tosh: Changing your SSH server's listen address every 30 seconds based on TOTP
#82There should be no need to do this if you have a properly configured public/private key auth setup and disable password based login. And of course keep up to date on openssh patches and security advisories. I worry that something like this will provide a false sense of security for people who might ignore other more common-sense, fundamental precautions first. Before doing something like this I would worry a lot more…
Bit like having a front door that would withstand a C4 blast, but now all your windows are shattered.
Re: Tosh: Changing your SSH server's listen address every 30 seconds based on TOTP
#83Earlier quoted context omitted.
Doesnt the TOTP in this case concern the listening port for sshd, so it doesnt actually touch the authentication in any way? Just switches the port in a TOTP’esque manner
The point is that if the attacker somehold got hold of the primary login credentials (username + key/password), then they can easily bypass this scheme with a port/address scan. This can be done very quick[1] and is hard to rate limit. Furthermore, an attacker that can eavesdrop on the user's connections can infer the OTP since it's being transmitted in the open., but if it was done through a PAM module they wouldn't…
If you could scan 1 million IP addresses a second on a /64 (which is absurd), it would take 600K years to scan a full /64.
Re: Tosh: Changing your SSH server's listen address every 30 seconds based on TOTP
#84 Host vm vm-0 vm-0.com
User user
HostName vm-0.com
ProxyCommand sh -c "pyknock-client -s 0.0.0.0 -S \"\$(myip)\" open %h "$(pass my/pyknock/%h)" && sleep 1 && exec nc -4 %h %p"
Port 1792
Where `myip` [2] is an small utility which reliably detects my external IP address.Re: Tosh: Changing your SSH server's listen address every 30 seconds based on TOTP
#85This reminds of port knocking. Could be useful if you are really annoyed by those script kiddos, but in essence this is security by obscurity.
Re: Tosh: Changing your SSH server's listen address every 30 seconds based on TOTP
#86Stop it with this cloak and dagger BS. Just set a shared secret on it: https://github.com/google/tcpauth (Yes, MD5 is safe for this use) With tcp MD5 your connection is even secured against an active attacker who can sniff. They can't inject, or even RST the connection. Even if they can sniff and spoof everything.
Sure, it just begs the question: why in the world would you still try to find nails for the hammer called MD5 when (according to Wikipedia) cryptographers recommended upgrading to SHA-1 in 1996 already? This project's first commit was well, well beyond the deprecation of MD5. It's a bit safer than but also not entirely unlike putting a Windows 7 on the internet just because there are no known exploits in an up-to-date 7 system currently.
Re: Tosh: Changing your SSH server's listen address every 30 seconds based on TOTP
#87Would this potentially leak consecutive TOTPs to an attacker who connects to all 1,000,000 or so possible addresses at 30 second intervals (and records the one that responds)?
No. The mechanism underpinning TOTP should guarantee that the internal state does not leak from any outputs produced. That is, of course, unless some security flaw is found, but that seems unlikely to ever happen at this point if you use a regular SHA-2-based TOTP. It basically does HMAC_SHA256(secret, time) where the time is known (also to the attacker) but the secret is shared between the two authenticating systems. If you could derive secret from time+output, the mechanism would serve a much more limited purpose. Part of the purpose of TOTP is that an attacker that observed a (number of) login(s) can't predict any future or past tokens for their own use.
Re: Tosh: Changing your SSH server's listen address every 30 seconds based on TOTP
#88Earlier quoted context omitted.
Your server has NTP. Your client likely, too, if it has enough network to connect to the server. If it does not use NTP, it's easy to set the time within the minute or so required manually.
Hardware clocks are famously unreliable and inaccurate. NTP has failure modes that can result in servers being wildly out of sync with reality. Letting either one of those hose your ability to log in and diagnose/recover the system is a mistake.
Re: Tosh: Changing your SSH server's listen address every 30 seconds based on TOTP
#89That’s a super cool concept, but doesn’t this fall a bit under “security by obscurity”?
In the same way that passwords, private keys, and safe combinations are security by obscurity, sure.
Re: Tosh: Changing your SSH server's listen address every 30 seconds based on TOTP
#90That’s a super cool concept, but doesn’t this fall a bit under “security by obscurity”?
It's another layer of security. There have been exploits of OpenSSH in past so this may be prudent.