You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/fingerprint.rst
+67-16Lines changed: 67 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ In most cases, a new key is automatically generated during installation. When a
11
11
12
12
However, it can also be a Man in the Middle attack, where the connection was redirected to another server.
13
13
14
-
For this reason, the fingerprint must always be compared against a trusted source.
14
+
For this reason, the fingerprint must always be compared against a trusted source.
15
15
16
16
Checking the fingerprint
17
17
------------------------
@@ -20,7 +20,7 @@ The first time you connect to a server, you will be asked if you want to connect
20
20
21
21
.. code-block:: none
22
22
23
-
$ ssh github.com
23
+
$ ssh github.com
24
24
The authenticity of host 'github.com (140.82.121.3)' can't be established.
25
25
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
26
26
Are you sure you want to continue connecting (yes/no/[fingerprint])?
@@ -37,9 +37,9 @@ The reason is that if you compare fingerprints manually, errors can occur and yo
37
37
38
38
If the fingerprint is unknown, you should ask the server administrator for the correct fingerprint.
39
39
40
-
You can also contact support if the server is a rented server. They should be able to give you information. However, don't let support trick you into simply accepting the connection and insist that the fingerprint be provided to you in writing via a trusted source.
41
-
42
-
40
+
You can also contact support if the server is a rented server. They should be able to give you information. However, don't let support trick you into simply accepting the connection and insist that the fingerprint be provided to you in writing via a trusted source.
41
+
42
+
43
43
Warning for changed fingerprints
44
44
--------------------------------
45
45
@@ -71,14 +71,14 @@ If the fingerprint has changed for a legitimate reason, you can remove the old f
@@ -122,7 +122,7 @@ On a server the SSHFP records can be created with the following command:
122
122
123
123
.. code-block:: none
124
124
125
-
$ ssh-keygen -r examplehost.example.org
125
+
$ ssh-keygen -r examplehost.example.org
126
126
examplehost.example.org IN SSHFP 1 1 d004948e1d359f2a267f03a599c3efe5d8285ae1
127
127
examplehost.example.org IN SSHFP 1 2 f94a95111db1158903bc23e61f75843d029f9d3edabfd74c200f201d4b80b330
128
128
examplehost.example.org IN SSHFP 3 1 3b355dc1e3a508e4594e7f8aa30d315d820eb602
@@ -136,7 +136,7 @@ To check whether the new DNS records work, you can check this with the program d
136
136
137
137
.. code-block:: none
138
138
139
-
dig SSHFP examplehost.example.org +short
139
+
dig SSHFP examplehost.example.org +short
140
140
141
141
Client configuration
142
142
""""""""""""""""""""
@@ -146,7 +146,7 @@ By default, the OpenSSH client does not check the fingerprint against an SSHFP r
146
146
.. code-block:: none
147
147
148
148
VerifyHostKeyDNS yes
149
-
149
+
150
150
If you then connect to the new server, you no longer need to confirm the fingerprint.
151
151
152
152
Troubleshooting
@@ -200,6 +200,57 @@ An exemplary key exchange with and without a known fingerprint could look as fol
200
200
If the fingerprint is not known, the list is sent to the server with a predefined sequence.
201
201
However, if the client has already saved a fingerprint for the server, the last used algorithm used is put first.
202
202
203
+
Fuzzy Fingerprints
204
+
""""""""""""""""""
205
+
206
+
.. note::
207
+
208
+
Fuzzy fingerprints are not implemented in SSH-MITM
209
+
210
+
In many cases, an attacker is not in possession of the private key for the server. An attack on the encryption algorithms can also only be implemented efficiently for very old and weak algorithms.
211
+
212
+
Konrad Rieck (Fuzzy Fingerprints Attacking Vulnerabilities in the Human Brain, 2002) describes in his work a method how a user can be tricked into accepting a wrong fingerprint during a manual check.
213
+
214
+
Many clients still use MD5 to represent the fingerprint. However, MD5 is no longer considered secure enough because hash collisions cannot be ruled out. For this reason, there is an increasing switch to SHA256.
215
+
216
+
The advantage of SHA256 is that it is much more resistant to collisions. However, it also makes the fingerprint longer and more difficult to read. The more complex and longer a fingerprint is, the more often only individual parts are checked.
217
+
218
+
In his work, Konrad Rieck describes that most users only compare the beginning and the end of a hash value. Users with more experience also checked parts in the middle. However, it was observed that very few compared the full hash value.
219
+
220
+
Based on these observations, it is possible to generate fingerprints that are very similar to a known fingerprint. When creating a fingerprint, care must be taken to incorporate the observed behavior of the users into the generation of the key.
221
+
222
+
Because many users only check the beginning and the end, it is more important that these have the same byte sequence as the original fingerprint. Parts in the middle are checked less often, which is why they do not necessarily have to be the same.
223
+
224
+
225
+
The following example shows a 2-byte fingerprint.
226
+
227
+
+------------------------+---+---+---+---+
228
+
| **Target fingerprint** | 9 | 7 | B | 3 |
229
+
+------------------------+---+---+---+---+
230
+
| **Fuzzy fingerprint | 9 | 1 | E | 3 |
231
+
+------------------------+---+---+---+---+
232
+
233
+
To improve the fingerprint, similar characters can also be used. Certain characters can be perceived differently by a user or, depending on the character set, can also be confused.
234
+
235
+
The more extensive the character set with which the fingerprint can be represented, the easier it is to find an optically similar fingerprint.
236
+
237
+
With a SHA256 hash, however, this is no longer represented in hex format, but as Base64.
With Base64 encoding the characters A-Z, a-z, 0-9, + and / can be used. At the end of the string a = can be used.
244
+
245
+
This extended character set offers the advantage that there are substantially more similar characters.
246
+
247
+
With fuzzy fingerprints, it is relatively easy to trick a user connecting to a server for the first time into accepting a wrong fingerprint.
248
+
249
+
Sergey Dechand et al described in "An Empirical Study of Textual Key-Fingerprint Representations" that with a hexadecimal setting over 10% of the attacks failed to detect the wrong fingerprint. Other methods, such as Base32 had a slightly better error rate of 8.5%.
250
+
251
+
Base64, which is used for SHA256 fingerprints, was not evaluated in this work, which is why no statement can be made for this.
0 commit comments