antonioCoco / RunasCs

RunasCs - Csharp and open version of windows builtin runas.exe
GNU General Public License v3.0
1.01k stars 131 forks source link

GetTokenIntegrityLevel never returns SYSTEM IL #10

Open antonioCoco opened 11 months ago

antonioCoco commented 11 months ago

There is a bug in the function GetTokenIntegrityLevel function which will never returns a SYSTEM IL for a token.

While this should be never problematic due to the fact logon with explicit credentials can returns only Medium or High IL tokens, it's better to fix the bug for avoiding any unwanted behaviors in the future.

Bug lies here:

https://github.com/antonioCoco/RunasCs/blob/a1e47b55952fadd46bf097be74a6efbcbe846c2b/RunasCs.cs#L1624-L1628

So when a SYSTEM IL level is found, the High IL condition satisfied and the value is returned from the function.