A linux-like su/sudo on Windows.
This is a demo project. It may have security vulnerability. SO RUN AT YOUR OWN RISK.
$ git clone https://github.com/DoubleLabyrinth/WindowsSudo.git
$ cd WindowsSudo
$ msbuild WindowsSudo.sln /p:Configuration=Release /p:Platform=x64 # or `x86` if you likeThen you will get
su.exe
sudo.exe
WindowsSudo.Prompter.exe
WindowsSudo.Service.exe
at bin/x64-Release (or bin/x86-Release) directory.
-
Move the four
exefiles to a directory which is-
in
%PATH%environment variable -
is writable for administrators ONLY
For example, you can place the four
exefiles toC:\Windows\System32\. -
-
Run
cmd.exeas administrator and installWindowsSudo.Service.exeas service.$ cd C:\Windows\System32\ $ WindowsSudo.Service.exe /install $ WindowsSudo.Service.exe /start
-
Enjoy
suandsudowith yourself.Example:
$ sudo whoami /priv
