C # Unlock Workstation

For the usb-smartstick application that I want to do, I need to be able to unlock a locked workstation in C #. When I insert my USB with a unique identifier, I want to unlock ws. What would be the best way to do this?

I am aiming for a similar application like Rohos Logon Key.

+4
source share
1 answer

As I understand it, for this you need a replacement / binding to the implementation of the Windows component that handles the login. As far as I know, there is no other way to achieve what you are asking for - the reason why users need to enter a secure attention sequence (SAS) before entering the system is to prevent malware from spoofing the login dialog. If any old program can do what you ask for, then this malware can use it.

There are two different ways to do this, depending on the version of Windows you are targeting.

For Windows XP and earlier

To do this, you need to write your own replacement GINA (Microsoft Graphical Identification and Authentication). FYI implementing such a DLL in .Net is probably a bad idea (see. Replacing GINA in .NET? ). It is also quite advanced material to cite one of the articles below.

GINA replacement is an advanced method that should not be taken lightly. You should only do this if you have no other choice (if, for example, you are introducing a new login mechanism that makes Windows unsupported).

For more information on GINA, check out the following links.

Vista and later

In Windows Vista and later, GINA has been replaced by Credential Providers , so instead you need to implement the ICredentialProviderCredential Interface . Although it is a COM interface, reimplementing it in .Net would be a bad idea.

More details can be found in the following links.

+6
source

Source: https://habr.com/ru/post/1435928/


All Articles