Windows Sudo
October 12, 2019 · View on GitHub
A linux-like su/sudo on Windows.
This is a demo project. It may have security vulnerability. SO RUN AT YOUR OWN RISK.
1. How to build?
$ git clone https://github.com/DoubleLabyrinth/WindowsSudo.git
$ cd WindowsSudo
$ msbuild WindowsSudo.sln /p:Configuration=Release /p:Platform=x64 # or `x86` if you like
Then you will get
su.exe
sudo.exe
WindowsSudo.Prompter.exe
WindowsSudo.Service.exe
at bin/x64-Release (or bin/x86-Release) directory.
2. How to use?
-
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
3. Preview
