4 ms·
> Man-in-the-Middle attack does require the victim to accept the wrong host fingerprint. This should be a WONTFIX. The idea that it could be not only a man-in
by kazinator 8y ago
> Man-in-the-Middle attack does require the victim to accept the wrong host fingerprint.
This should be a WONTFIX.
The idea that it could be not only a man-in-the-middle attack but simply a "malicious scp server" is completely ridiculous.
No secure login or transfer method can protect you from the actions of a malicious server, which could be anything.
If I have the root privs to install malicious software on the server, why would I muck around perpetrating a scp exploit on remote users.
- dancek 8y agoSome people only check a couple of bytes in the beginning and end of the host fingerprint. I've done that. It's not ridiculous to prevent attack vectors that depend on common behavior, even if it's strictly speaking the user's fault.
- deleted 8y ago[deleted]
- deleted 8y ago[deleted]
- kakarot 8y agoYou should not be checking the host fingerprint at all. 1. Use `VisualHostKey=yes` in your ssh config. Learn the randomart image for your server. Don't try to compare two long random strings directly, that's not a job for humans. 2. Use an offline SSH certificate authority to generate SSH certificates, bypassing the need for a host fingerprint check altogether. If you can trust your offline CA, you don't need to trust your server's host key at all. Either they have a valid certificate or they don't. Your SSH client won't even ask you if you trust the server. It's one thing to access a compromised server, but you should NEVER be exposed to MITM attacks with proper SSH usage, except for your very first connection on a brand-spanking new server when you drop your SSH host certificates (ideally in an automated fashion which can be deployed immediately after spinning up your box).
- dancek 8y agoSounds good in theory. Now, say I want to use github over ssh, how do I check if the randomart image is correct? (Getting my configs from github tends to be the first thing I do on a new machine.) The CA approach is probably good if you control the servers you use. Right now I connect to about 5-7 ssh servers on a regular basis, and I don't have (full) control over any one of them.
- kakarot 8y ago`ssh-keyscan -t rsa github.com | ssh-keygen -lf -` gives you the fingerprint for github.com. Save this key, and reuse it everywhere before connecting to github. Now the issue of being MITM'd is once again only an issue with your very first connection, which is done via ssh-keyscan. As for your other servers, you should only check the host key once for any of them, and then save it. And that's only if they are owned by a third-party, like a shared server. If your provider routinely cycles host keys, get a new provider who actually cares about security. If these servers are owned by your employer, then your employer needs better security practices and, failing a certificate authority, should provide you with the necessary host fingerprints before you ever connect to a box.
- dancek 8y agoI currently check fingerprints on first connection and then save them. They're available for most servers, including github and other git providers. I think I've only had to connect to one server without knowing the fingerprint in advance in the last couple of years. Looks to me like the fingerprint-checking process has to be manual if you can't choose the server certificate.
- deleted 8y ago[deleted]
- Aeolun 8y agoExpansion of privileges. If a malicious actor is already in your network, but doesn’t have domain admin right yet for example, taking control of all the machines that connect to a server they do have control over would be helpful in a variety of ways.
- kazinator 8y ago> If a malicious actor is already in your network ... Then you're talking about a man-in-the-middle attack, which I acknowledge as a problem. I don't agree that fixing bugs which date back to the completely insecure rcp program are the key to solving man-in-the-middle attacks in the SSH suite. If you have to put in defenses at that level, you've already lost; the goal must be to eliminate or minimize the threat of a MITM attack on the authentication system. This nonsense is analogous to putting a layer of Pig Latin and ROT-13 into the protocol in case the attacker breaks the AES cipher.
- Dylan16807 8y ago> No [...] transfer method can protect you from the actions of a malicious server Try applying that logic to a web browser. Oh, just do whatever the server says and overwrite whatever files it wants?