Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
In Windows, it is possible to logon as a different domain user without any credentials. This is known as a S4U or a Service For User Logon. This is a Microsoft Extension to Kerberos introduced with Windows Server 2003. There have been several articles and post on this topic but I thought it would be nice to go over this topic again. The official names for S4U are:
You can find more details on the extension in the following protocol doc:
[MS-S4U] - https://msdn.microsoft.com/en-us/library/cc246071.aspx
A S4U Logon allows an application to obtain a token to a domain user with just their User Principal Name (UPN). This is a powerful feature but there are some caveats to control the power of a S4U logon.
Ok, since I've provided the highlights of S4U, how can you programmatically generate an S4U token? There are 2 ways to do this.
1. LsaLogonUser + KERB_S4U_LOGON structure. https://msdn.microsoft.com/en-us/library/windows/desktop/aa378128(v=vs.85).aspx
2. An easier way to generate an S4U token is through the WindowsIdentity object by passing a User Principal Name (UPN) which is in the format of user@domain. Remember if the caller doesn't have the SeTcbPrivilege, the internal token stored in the WindowsIdentity object will be at an identification level instead of an impersonation level. The code is very simple:
WindowsIdentity s4u = new WindowsIdentity("user@domain");
You'll see that this code is much easier than calling LsaLogonUser().
I hope this posts provides some insight to understanding and using S4U.
Please sign in to use this experience.
Sign in