Sardeep Lakhera
Sardeep Lakhera

Reputation: 319

is it possible to use LogonUser API without password?

I am developing a c++ application and this application runs as a windows service. I need to impersonate the current user to access the network location and for this I am using Windows API LogonUser and ImpersonateLoggedOnUser.

The problem is that I only have username and domain information but not the password. So is it possible to call the LogonUser without providing the password to get the user handle?

Upvotes: 1

Views: 893

Answers (1)

MSalters
MSalters

Reputation: 179907

No, that would be a rather obvious security leak.

You may however use a named pipe between a UI process for the current user and your service. Your service can then impersonate the other side of the named pipe. This is secure because you control both ends of the pipe.

Upvotes: 2

Related Questions