Skip to content

Commit 1ce739d

Browse files
reorganized authentication docs
1 parent a365caa commit 1ce739d

File tree

1 file changed

+71
-63
lines changed

1 file changed

+71
-63
lines changed

doc/authentication.rst

Lines changed: 71 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -10,83 +10,42 @@ This is most common with Git repositories. Examples of this are GitLab and GitHu
1010
resources a user is allowed to access based on the public key at login.
1111

1212

13-
none Authentication
14-
-------------------
13+
**none** authentication - `RFC-4252/5.2 <https://datatracker.ietf.org/doc/html/rfc4252#section-5.2>`_
14+
-----------------------------------------------------------------------------------------------------
1515

1616
The none authentication takes a special position among the authentication methods.
17-
The reason is that this authentication method is used to tell the client which methods are accepted by the server. For this reason, none-Authentication is executed before all other authentication methods.
17+
The reason is that this authentication method is used to tell the client which methods are accepted by the server.
18+
For this reason, none-Authentication is executed before all other authentication methods.
1819

1920
However, it can also be used to give a user access to a system without requiring an explicit login.
2021

21-
Support in SSH-MITM
22-
"""""""""""""""""""
23-
24-
**none** authentication is fully supported but disabled by default
25-
26-
.. note::
27-
28-
"none" authentication is only usfull when the remote server also accepts "none" authentication.
29-
30-
If the remote server needs anothere login method, "none" authentication can breakt the login process and
31-
SSH-MITM closes the connection.
32-
33-
.. code-block::
34-
35-
ssh-mitm --remote-host 192.168.0.x:PORT --enable-none-auth
36-
37-
password authentication
38-
-----------------------
39-
40-
Password authentication is one of the most common login methods. Almost all current operating systems support this method both for local logins and over the network. By default, OpenSSH and many other SSH servers have this type of authentication active.
41-
42-
With SSH, within the encrypted channel, the password is transmitted in clear text. If a client connects to a Man in the Middle server, the server is able to read the username and password in clear text. This information can then be used to log in to other servers if the user exists and uses the same password.
43-
44-
Another problem is that accounts with weak passwords can be compromised relatively easily through a brute force attack. This happens very often with IoT devices because they often have the same username on many devices and they are protected by a default password or only a weak password is set.
45-
46-
On the client side, password authentication should not be used because of security concernes.
47-
48-
49-
Support in SSH-MITM
50-
"""""""""""""""""""
51-
52-
**password** authentication is fully supported.
53-
54-
Example SSH-MITM session intercepting password authentication:
55-
5622
.. code-block:: none
5723
58-
$ ssh-mitm --remote-host 192.168.0.x:PORT
59-
2021-09-02 09:51:35,354 [INFO] starting SSH-MITM 0.5.13
60-
2021-09-02 09:51:38,590 [INFO] connected client version: SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.3
61-
2021-09-02 09:51:48,629 [INFO] Client connection established with parameters:
62-
Remote Address: 127.0.0.1
63-
Port: 22
64-
Username: testuser
65-
Password: secret
66-
Key: None
67-
Agent: no agent
68-
24+
5.2. The "none" Authentication Request
6925
70-
keyboard-interactive authentication
71-
-----------------------------------
26+
A client may request a list of authentication 'method name' values
27+
that may continue by using the "none" authentication 'method name'.
7228
73-
keyboard-interactive is similar to password authentication. The main difference is that the server can send any number of requests to the client, which are necessary for the login process. The server defines both the prompt text and whether the value is visible or not when entered.
29+
If no authentication is needed for the user, the server MUST return
30+
SSH_MSG_USERAUTH_SUCCESS. Otherwise, the server MUST return
31+
SSH_MSG_USERAUTH_FAILURE and MAY return with it a list of methods
32+
that may continue in its 'authentications that can continue' value.
7433
75-
In many cases keyboard-interactive is used for 2 factor authentication. In the first step a password is requested and then e.g. the input of a time-based token is necessary (TOTP).
76-
77-
Unless special tools are used to create cryptographically secured input, all input via keyboard-interactive can be reused during a man in the middle attack to login to another server.
34+
This 'method name' MUST NOT be listed as supported by the server.
7835
7936
Support in SSH-MITM
8037
"""""""""""""""""""
8138

82-
The current version of SSH-MITM does not support man in the middle attacks using keyboard-interactive authentication.
39+
**none** authentication is fully supported but disabled by default. The reason is, that this authentication method can
40+
break ssh-mitm attacks, if the remote server does not allow logins with **none** authentication
8341

84-
At the moment only one prompt is snet to the client and the answer is used for password authentication on the remote server.
42+
.. code-block::
8543
86-
It's planned, that the upcoming release of SSH-MITM 1.0, has full support for keyboard-interactive authentication.
44+
ssh-mitm --remote-host 192.168.0.x:PORT --enable-none-auth
8745
88-
publickey authentication
89-
------------------------
46+
47+
**publickey** authentication - `RFC-4252/7 <https://datatracker.ietf.org/doc/html/rfc4252#section-7>`_
48+
------------------------------------------------------------------------------------------------------
9049

9150
In contrast to password authentication, where the password is transmitted in plain text, publickey authentication is based on asymmetric encryption. In asymmetric encryption, a key pair consisting of a private part and a public part is created.
9251

@@ -121,14 +80,12 @@ Publickey authentication in SSH-MITM is enabled by default.
12180
All you have to do is to start the server:
12281

12382
.. code-block:: none
124-
:linenos:
12583
12684
$ ssh-mitm --remote-host 192.168.0.x:PORT
12785
12886
To do a full mitm attack, the client should use agent forwarding.
12987

13088
.. code-block:: none
131-
:linenos:
13289
13390
$ ssh -A -p 10022 user@proxyserver
13491
@@ -138,9 +95,60 @@ If the client does not forward an agent, but publickey authentication would be p
13895
SSH-MITM can redirect the session to a honeypot.
13996

14097
.. code-block:: none
141-
:linenos:
14298
14399
$ ssh-mitm --remote-host 192.168.0.x:PORT --fallback-host user:password@honeypot:22
144100
145101
Connections are only redirected to the honeypot if no agent was forwarded after publickey authentication.
146102
All other connections are forwarded to the destination server and a full man in the middle attack is possible.
103+
104+
105+
**password** authentication - `RFC-4252/8 <https://datatracker.ietf.org/doc/html/rfc4252#section-8>`_
106+
-----------------------------------------------------------------------------------------------------
107+
108+
Password authentication is one of the most common login methods. Almost all current operating systems support this method both for local logins and over the network. By default, OpenSSH and many other SSH servers have this type of authentication active.
109+
110+
With SSH, within the encrypted channel, the password is transmitted in clear text. If a client connects to a Man in the Middle server, the server is able to read the username and password in clear text. This information can then be used to log in to other servers if the user exists and uses the same password.
111+
112+
Another problem is that accounts with weak passwords can be compromised relatively easily through a brute force attack. This happens very often with IoT devices because they often have the same username on many devices and they are protected by a default password or only a weak password is set.
113+
114+
On the client side, password authentication should not be used because of security concernes.
115+
116+
117+
Support in SSH-MITM
118+
"""""""""""""""""""
119+
120+
**password** authentication is fully supported.
121+
122+
Example SSH-MITM session intercepting password authentication:
123+
124+
.. code-block:: bash
125+
126+
$ ssh-mitm --remote-host 192.168.0.x:PORT
127+
2021-09-02 09:51:35,354 [INFO] starting SSH-MITM 0.5.13
128+
2021-09-02 09:51:38,590 [INFO] connected client version: SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.3
129+
2021-09-02 09:51:48,629 [INFO] Client connection established with parameters:
130+
Remote Address: 127.0.0.1
131+
Port: 22
132+
Username: testuser
133+
Password: secret
134+
Key: None
135+
Agent: no agent
136+
137+
138+
**keyboard-interactive** authentication - `RFC-4256 <https://datatracker.ietf.org/doc/html/rfc4256>`_
139+
-----------------------------------------------------------------------------------------------------
140+
141+
keyboard-interactive is similar to password authentication. The main difference is that the server can send any number of requests to the client, which are necessary for the login process. The server defines both the prompt text and whether the value is visible or not when entered.
142+
143+
In many cases keyboard-interactive is used for 2 factor authentication. In the first step a password is requested and then e.g. the input of a time-based token is necessary (TOTP).
144+
145+
Unless special tools are used to create cryptographically secured input, all input via keyboard-interactive can be reused during a man in the middle attack to login to another server.
146+
147+
Support in SSH-MITM
148+
"""""""""""""""""""
149+
150+
The current version of SSH-MITM does not support man in the middle attacks using keyboard-interactive authentication.
151+
152+
At the moment only one prompt is sent to the client and the answer is used for password authentication on the remote server.
153+
154+
It's planned, that the upcoming release of SSH-MITM 1.0, has full support for keyboard-interactive authentication.

0 commit comments

Comments
 (0)