Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

“none” authentication error regarding publickey #134

Open
Joshua1909 opened this issue Mar 9, 2023 · 2 comments
Open

“none” authentication error regarding publickey #134

Joshua1909 opened this issue Mar 9, 2023 · 2 comments

Comments

@Joshua1909
Copy link

SSH-MITM Version

3.0.2

Platform detail

Kali Linux 6.0.0

Arguments used to start SSH-MITM

ssh-mitm server --enable-none-auth

SSH client used

putty, ssh on Linux

SSH server used

Openssh 9.0p1

What steps will reproduce the bug?

When using ssh-mitm to intercept a "none" authentication, the server provides an error "ssh agent not forwarded. Login to remote host not possible with publickey authentication.” My ssh server configuration works with none authentication, so if I ssh directly then “none” works. It seems as though the —enable-none-auth is not being carried to the backend ssh session.

What should have happened?

An ssh session would have been established to a local ssh server where “none” authentication is allowed.

Additional information

I’ve also tried: “—enable-none-auth and —disable-publickey-auth” in combination

@manfred-kaiser
Copy link
Member

manfred-kaiser commented Mar 9, 2023

Thanks for the bug report.

At the moment SSH-MITM has only full support for "publickey" AND "password" authentication. This means, the server must provide both authentication methods.

For example, if the server only supports "publickey" but does not provide "password" authentication, SSH-MITM still asks the user for the password in cases when authentication with "publickey" is not possible.

SSH-MITM was created to test if the client is vulnerable to spoofing FIDO tokens and to prove if it's possible to intercept the authentication process (mainly publickey auth). See https://docs.ssh-mitm.at/user_guide/trivialauth.html and https://www.openssh.com/agent-restrict.html

"none" authentication was added to SSH-MITM, because it can be used to spoof FIDO tokens. With "none" authentication, the client can be forced to login and does not trigger the FIDO token. "none" authentication has some drawbacks, because SSH-MITM was not able to learn something about the authentication process and this missing knowledge can result in failed login attemps. The argument "--enable-none-auth" was only added to test this behavior.

During a full man in the middle attack, SSH-MITM should respect the servers authentication methods, but at the moment, this is not implemented.

With "keyboard-interactive" it's the same as with "none" authentication. "keyboard-interactive" was only added to prove that spoofing FIDO tokens is possible, but SSH-MITM does not have support for intercepting the authentication process in cases when "keyboard-interactive" is used.

The error "ssh agent not forwarded. Login to remote host not possible with publickey authentication.” is a side effect of "none" authentication. Because you are using "none" authentication, SSH-MITM does not know anything about the authentication process and tires to login with publickey authentication (a side effect, which comes from the tests to spoof FIDO tokens)

Intercepting public key authentication requires a forwarded agent and if SSH-MITM does not got the agent the connection is closed with the mentioned error. This can be avoided to provide a fallback host (e.g. a honeypot)

I have plans to add full support to intercept the authentication process, but this requires some major changes which takes a lot of time.

At the moment I'm the only developer which is actively working on SSH-MITM, but I would be glad to get some help 😉

@Joshua1909
Copy link
Author

Thanks so much for taking the time to reply. I appreciate the context and detailed answer, that makes a lot of sense in regards to the behaviour I saw. I may take a look and see if it's a feature I can work on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants