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/authentication.rst
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,14 @@
1
1
Authentication
2
2
==============
3
3
4
+
The choice of the right authentication method against SSH-MITM can have a decisive influence on the success of a Man in the Middle attack.
5
+
6
+
The most popular authentication methods are "password" and "publickey" authentication. However, there are others, such as "none" and "keyboard-interactive".
7
+
8
+
To log in to an SSH server it is necessary to specify an existing user. There are systems that use a default username.
9
+
This is most common with Git repositories. Examples of this are GitLab and GitHub, which use the username "git" and distinguish which
10
+
resources a user is allowed to access based on the public key at login.
Copy file name to clipboardExpand all lines: doc/fingerprint.rst
+50-45Lines changed: 50 additions & 45 deletions
Original file line number
Diff line number
Diff line change
@@ -14,22 +14,6 @@ In most cases, a new key is automatically generated during installation. When a
14
14
For this reason, the fingerprint must always be compared against a trusted source.
15
15
16
16
17
-
There are SSH clients that have a flawed fingerprint check and are thus vulnerable to man in the middle attacks. An example of this is the SFTP implementation of Midnight Commander.
18
-
This vulnerability was discovered and fixed only after 9 years. See ref:`CVE-2021-36370`
19
-
20
-
However, most programs do not have fingerprint verification vulnerabilities. As long as the fingerprint is checked, it is not possible to connect to an unknown server.
21
-
22
-
In many cases, the vulnerability is not the program, but the user who does not properly check the fingerprint against a known value. There can be many reasons for this.
23
-
24
-
Many users do not know what the fingerprint means. There are tutorials on the Internet that do not describe what the fingerprint is, but only write that you simply have to confirm this query with "yes" to establish the connection.
25
-
26
-
It also often happens that the fingerprint is not known and cannot be checked against a trusted source. These could be new systems that generate a random key on first launch.
27
-
28
-
Systems such as a development server may have it reinstalled frequently. This causes the fingerprints to change which leads to users being used to accepting unknown fingerprints.
29
-
30
-
However, previous studies (Peter Gutmann, Do Users Verify SSH Keys? / Konrad Rieck (Fuzzy Fingerprints Attacking Vulnerabilities in the Human Brain, 2002) ) have shown that users verify a fingerprint in very few cases. In the study by Peter Gutmann, IT departments were asked how often the user asked the IT department for the new fingerprint after a new installation. The study showed that this was almost never the case.
31
-
32
-
In cases where the fingerprint is checked, it is very efficient to generate an SSH key with a similar hash value as the one of the target computer. The longer and more complex a fingerprint becomes, the more likely it is that only parts of the fingerprint are compared. This results in a fingerprint that is actually wrong being considered correct. This technique is known as fuzzy fingerprinting.
@@ -187,43 +168,30 @@ In this case, the fingerprint must still be checked against a trusted source.
187
168
188
169
However, the fingerprint stored in the DNS is no longer considered trustworthy in this case. The reason for this is that the integrity of the DNS zone is no longer guaranteed due to an incorrect DNSSEC configuration.
189
170
190
-
Recognizing clients with known fingerprints
191
-
-------------------------------------------
192
171
193
-
If the client is already in possession of a fingerprint, the received fingerprint is compared with it. If the fingerprints do not match, a warning is issued and the connection is terminated.
172
+
SSH-MITM - attacks on the fingerprint verification
However, a Man in the Middle attack should remain undetected for as long as possible. For this reason, it is necessary to prevent the warnings generated by the client.
175
+
There are SSH clients that have a flawed fingerprint check and are thus vulnerable to man in the middle attacks. An example of this is the SFTP implementation of Midnight Commander.
176
+
This vulnerability was discovered and fixed only after 9 years. See :ref:`CVE-2021-36370`
196
177
197
-
RFC-4253 defines how the key exchange works. A list of supported algorithms is sent to the server. The first entry defines the preferred algorithm.
178
+
However, most programs do not have fingerprint verification vulnerabilities. As long as the fingerprint is checked, it is not possible to connect to an unknown server.
198
179
199
-
This behavior can be used to find out whether a client has already stored a fingerprint for the current connection or not.
180
+
In many cases, the vulnerability is not the program, but the user who does not properly check the fingerprint against a known value. There can be many reasons for this.
200
181
201
-
In a Man in the Middle attack, this knowledge can be used to not intercept clients that would issue a warning or to pass the connection through to the actual destination server.
182
+
Many users do not know what the fingerprint means. There are tutorials on the Internet that do not describe what the fingerprint is, but only write that you simply have to confirm this query with "yes" to establish the connection.
202
183
203
-
An exemplary key exchange with and without a known fingerprint could look as follows:
184
+
It also often happens that the fingerprint is not known and cannot be checked against a trusted source. These could be new systems that generate a random key on first launch.
204
185
186
+
Systems such as a development server may have it reinstalled frequently. This causes the fingerprints to change which leads to users being used to accepting unknown fingerprints.
However, previous studies (Peter Gutmann, Do Users Verify SSH Keys? / Konrad Rieck (Fuzzy Fingerprints Attacking Vulnerabilities in the Human Brain, 2002) ) have shown that users verify a fingerprint in very few cases. In the study by Peter Gutmann, IT departments were asked how often the user asked the IT department for the new fingerprint after a new installation. The study showed that this was almost never the case.
189
+
190
+
In cases where the fingerprint is checked, it is very efficient to generate an SSH key with a similar hash value as the one of the target computer. The longer and more complex a fingerprint becomes, the more likely it is that only parts of the fingerprint are compared. This results in a fingerprint that is actually wrong being considered correct. This technique is known as fuzzy fingerprinting.
221
191
222
-
If the fingerprint is not known, the list is sent to the server with a predefined sequence.
223
-
However, if the client has already saved a fingerprint for the server, the last used algorithm used is put first.
224
192
225
193
Fuzzy Fingerprints
226
-
------------------
194
+
""""""""""""""""""
227
195
228
196
.. note::
229
197
@@ -276,6 +244,43 @@ Base64, which is used for SHA256 fingerprints, was not evaluated in this work, w
276
244
277
245
278
246
247
+
248
+
Recognizing clients with known fingerprints
249
+
"""""""""""""""""""""""""""""""""""""""""""
250
+
251
+
If the client is already in possession of a fingerprint, the received fingerprint is compared with it. If the fingerprints do not match, a warning is issued and the connection is terminated.
252
+
253
+
However, a Man in the Middle attack should remain undetected for as long as possible. For this reason, it is necessary to prevent the warnings generated by the client.
254
+
255
+
RFC-4253 defines how the key exchange works. A list of supported algorithms is sent to the server. The first entry defines the preferred algorithm.
256
+
257
+
This behavior can be used to find out whether a client has already stored a fingerprint for the current connection or not.
258
+
259
+
In a Man in the Middle attack, this knowledge can be used to not intercept clients that would issue a warning or to pass the connection through to the actual destination server.
260
+
261
+
An exemplary key exchange with and without a known fingerprint could look as follows:
0 commit comments