Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Bitvise SSH Server authenticate user without a password?

Since version 5.50 the Bitvise SSH Server allows connected client to authenticate to Windows user account without providing this user's Windows password. See here: https://www.bitvise.com/ssh-server-version-history

I've checked it myself - it does indeed.

My question is of pure curiosity: what kind of sorcery is this? Is there any WinAPI that allows such thing or is this some kind of clever hack? I always thought it is impossible to impersonate as other user without a password (as even when configuring Windows service or scheduled task to "run as user" it is neccessary to provide one).

like image 520
Kuba Wyrostek Avatar asked Sep 05 '25 03:09

Kuba Wyrostek


2 Answers

IIRC, the SSH server in Cygwin does the same thing.

If you have the appropriate privileges you can create an access token with ZwCreateToken, no password required. Such a token has some limitations. For example, you can't access network resources without a password and some encrypted material isn't accessible.

There's an explanation and some sample code here.

like image 146
arx Avatar answered Sep 07 '25 22:09

arx


Since version 5.50, Bitvise SSH Server comes with a Windows authentication package. An authentication package can enhance the Windows logon process in custom ways. When the SSH server needs to log you in, but does not have a password (e.g. because you logged in with a public key), it calls the authentication package to construct a logon token which closely resembles the logon token that would have been created by Windows. As arx has noted, a session created this way does not contain your authentication credentials, so side effects are that you can't access things like network resources and EFS.

like image 29
user2226180 Avatar answered Sep 07 '25 23:09

user2226180