ImpersonateCLI

2021-10-14

Helper to use for impersonation of any CLI call on Windows.

Based on native Windows authentication mechanisms this utility could be used to execute any command line interface (CLI) command under another user context. It's similar to the Windows internal RunAs command, but with wider liberties in security. The login sessions are in interactive mode.

Usage

This utility is placed anywhere on the drive, and called with parameters as below.

screenshot

It could be used with domain included with the user name:

        
        C:\>ImpersonateCLI.exe ZingtonGroup\joda topSecret123! iexplore.exe
                

Without domain specified (should default to current user domain):

        
        C:\>ImpersonateCLI.exe joda topSecret123! iexplore.exe
                

Command arguments could be used to any extent since any trailing argument is used as a command argument:

        
        C:\>ImpersonateCLI.exe joda topSecret123! java.exe -jar selenium-server-standalone.jar -role node -hub http://localhost:4444
                

This should start a Selenium Grid node as the specified user, making any browser started with that node running as the specified user too.


Files download

Needed file:
ImpersonateCLI.exe

Not needed files:
ImpersonateCLI.exe.config (framework info)

ImpersonateCLI.pdb (debug info)

C# Source code