{"id":20266437,"url":"https://github.com/m2team/privexec","last_synced_at":"2025-05-16T08:00:26.841Z","repository":{"id":81551016,"uuid":"93252561","full_name":"M2Team/Privexec","owner":"M2Team","description":"Run the program with the specified permission level (C++20 required)","archived":false,"fork":false,"pushed_at":"2025-02-21T11:51:54.000Z","size":11335,"stargazers_count":342,"open_issues_count":2,"forks_count":56,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-09T08:01:37.101Z","etag":null,"topics":["windows"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/M2Team.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-03T14:16:07.000Z","updated_at":"2025-04-07T17:24:28.000Z","dependencies_parsed_at":"2025-02-24T11:12:01.146Z","dependency_job_id":"814cc2eb-40f9-4dd3-9f7b-116fa18254aa","html_url":"https://github.com/M2Team/Privexec","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/M2Team%2FPrivexec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/M2Team%2FPrivexec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/M2Team%2FPrivexec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/M2Team%2FPrivexec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/M2Team","download_url":"https://codeload.github.com/M2Team/Privexec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254493382,"owners_count":22080126,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["windows"],"created_at":"2024-11-14T12:09:20.612Z","updated_at":"2025-05-16T08:00:26.791Z","avatar_url":"https://github.com/M2Team.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Privexec\n\n[![license badge](https://img.shields.io/github/license/M2Team/Privexec.svg)](LICENSE)\n[![Master Branch Status](https://github.com/M2Team/Privexec/workflows/CI/badge.svg)](https://github.com/M2Team/Privexec/actions)\n[![Latest Release Downloads](https://img.shields.io/github/downloads/M2Team/Privexec/latest/total.svg)](https://github.com/M2Team/Privexec/releases/latest)\n[![Total Downloads](https://img.shields.io/github/downloads/M2Team/Privexec/total.svg)](https://github.com/M2Team/Privexec/releases)\n[![996.icu](https://img.shields.io/badge/link-996.icu-red.svg)](https://996.icu)\n\n\n[简体中文](./README.zh-CN.md)\n\nRun the program with the specified permission level\n\n## Install\n\nInstall Privexec by [baulk](https://github.com/baulk/baulk)\n\n```powershell\nbaulk install wsudo\nwsudo --version\n```\n\nOr you can download it directly, use Exeplorer or 7z and other tools to extract and then use Privexec, download link: [https://github.com/M2Team/Privexec/releases/latest](https://github.com/M2Team/Privexec/releases/latest)\n\n\n\n## Alias\nPrivexec and wsudo can resolve aliases. In addition, wsudo adds or deletes aliases. It is also a good choice to use vscode to edit `Privexec.json` to modify aliases. When Privexec is installed via baulk, the storage directory of `Privexec.json` is `$BAULK_ROOT/bin/etc`. If Privexec Download and unzip directly, then `Privexec.json` will be in the same directory as `Privexec.exe`.\n\n\n```json\n{\n    \"alias\": [\n        {\n            \"description\": \"Edit Hosts\",\n            \"name\": \"edit-hosts\",\n            \"target\": \"Notepad %windir%\\\\System32\\\\Drivers\\\\etc\\\\hosts\"\n        },\n        {\n            \"description\": \"Windows Debugger\",\n            \"name\": \"windbg\",\n            \"target\": \"\\\"%ProgramFiles(x86)%\\\\Windows Kits\\\\10\\\\Debuggers\\\\x64\\\\windbg.exe\\\"\"\n        }\n    ]\n}\n```\n\n\n## Screenshot\n\n![ui](docs/images/admin.png)\n\n\nAlias:\n\n![alias](docs/images/alias.png)\n\nAppContainer:\n\n![appcoantiner](docs/images/appcontainer.png)\n\n\nwsudo usage:\n\n![wsudo](docs/images/wsudo.png)\n\nwsudo Verbose Mode:\n\n![wsudo](docs/images/wsudo3.png)\n\nAppContainer Exec\n\n![appexec](docs/images/appexec.png)\n\n## Usage\n\nPrivexec is a GUI client. When running as a standard user, you can start the administrator process; when running as an administrator, you can elevate the privileges to `System` or `TrustedInstaller`. It should be noted that `System` or `TrustedInstaller` has too many privileges, which can easily damage the system operation. Be careful when using it.\n\nAppExec is a program that starts the AppContainer process. Some developers use this program to study the running details of Windows AppContainer and the vulnerabilities of AppContaner. UWP applications run in the AppContainer container.\n\nwsudo is the console version of Privexec/AppExec. The detailed help is as follows:\n\n**wsudo usage:**\n\n```txt\nwsudo 💖 5.0 run the program with the specified permissions\nusage: wsudo command args...\n   -v|--version        print version and exit\n   -h|--help           print help information and exit\n   -V|--verbose        Make the operation more talkative\n   -c|--cwd            Use a working directory to launch the process.\n   -e|--env            Use specific environment variables to start child processes.\n   -n|--nui            Starts a separate window to run a specified program or command.\n   -H|--hide           Hide child process window. not wait. (CREATE_NO_WINDOW)\n   -w|--wait           Start application and wait for it to terminate.\n   -u|--user           run as user (optional), support '-uX', '-u X', '--user=X', '--user X'\n                       Supported user categories (Ignore case):\n                       AppContainer  MIC            Basic\n                       Standard      Administrator  System\n                       TrustedInstaller\n\n   -x|--appx           AppContainer AppManifest file path\n   -L|--lpac           Less Privileged AppContainer mode.\n   --disable-alias     Disable Privexec alias, By default, if Privexec exists alias, use it.\n   --appid             Set AppContainer ID name (compatible --appname)\n   --retain            Retain AppContainer Profile (experimental)\n\nSelect user can use the following flags:\n   -a|--appcontainer   AppContainer\n   -M|--mic            Mandatory Integrity Control\n   -B|--basic          Basic execution, permission inheritance mode (default)\n   -U|--standard       Standard user no elevated (UAC)\n   -A|--administrator  Administrator\n   -S|--system         System\n   -T|--ti             TrustedInstaller\n\nExample:\n   wsudo -A pwsh -NoProfile\n   wsudo -T cmd\n   wsudo -U -V -eCURL_SSL_BACKEND=schannel curl --verbose  -I https://nghttp2.org\n   wsudo -U -V CURL_SSL_BACKEND=schannel curl --verbose  -I https://nghttp2.org\n\nBuiltin 'alias' command:\n   wsudo alias add ehs \"notepad %SYSTEMROOT%/System32/drivers/etc/hosts\" \"Edit Hosts\"\n   wsudo alias delete ehs\n\n```\n\nWhen Privexec, AppExec, wsudo launch commands, the command line and launch directory support deduction via `ExpandEnvironmentString`.\n\n\n## WSUDO Details\n\nThe wsudo visible and wait related parameters are `--hide` `--wait` `--new-console`. The corresponding situation is as follows:\n\n|PE Subsystem|`No relevant parameters`|`--new-console`|`--hide`|\n|---|---|---|---\n|Windows CUI|wait/Inheritance console|no wait/New console|no wait/No console|\n|Windows GUI|no wait/New UI|no wait/New UI|no wait/No window|\n|Windows CUI `-wait`|wait/Inheritance console|wait/New console|wait/No console|\n|Windows GUI `-wait`|wait/New UI|wait/New UI|wait/No window|\n\nWhen wsudo starts the administrator process as a standard user, if it is currently running in the console, it supports inheriting the console window. If it is not running in the console, it can do nothing. The newer Cygwin currently supports the newer Windows 10 `ConPty` starts the console, so it can inherit the console window, which is the terminal. The picture below is the proof.\n\nwsudo exec administrator process under mintty (Turn on ConPty):\n\n![wsudo](docs/images/wsudo-bridge-new-mintty.png)\n\n### WSUDO Environment\n\nwsudo support `-e/--env` to set environment. such as:\n\n```batch\n::curl must enabled multiple SSL backends.\nwsudo  -U -V --env CURL_SSL_BACKEND=schannel curl --verbose  -I https://nghttp2.org\n```\nThe environment variables will be deduced according to the Batch mechanism, that is, the environment variables are marked with matching `%`.\n\n```powershell\n# powershell\n.\\bin\\wsudo.exe -n -e 'PATH=%PATH%;%TEMP%' -U cmd\n```\n\n```batch\n::cmd\nwsudo -e \"PATH=%PATH%;%TEMP%\" -n -U cmd\n```\n\n## Changelog\n\nsee: [changelog.md](./docs/changelog.md)\n\n## LICENSE\n\nThis project use MIT License, and JSON use [https://github.com/nlohmann/json](https://github.com/nlohmann/json) , some API use NSudo, but rewrite it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm2team%2Fprivexec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm2team%2Fprivexec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm2team%2Fprivexec/lists"}