|
1 | | -# Privexec |
| 1 | +# AppContainer Launcher |
| 2 | +## AppContainer and LPAC (Less Privileged AppContainer) Launcher with Capabilities |
2 | 3 |
|
3 | | -[](LICENSE) |
4 | | -[](https://github.com/M2Team/Privexec/actions) |
5 | | -[](https://github.com/M2Team/Privexec/releases/latest) |
6 | | -[](https://github.com/M2Team/Privexec/releases) |
7 | | -[](https://996.icu) |
8 | 4 |
|
| 5 | +## Download: |
9 | 6 |
|
10 | | -[简体中文](./ReadMe.zh-CN.md) |
11 | 7 |
|
12 | | -Run the program with the specified permission level |
| 8 | +## Source Code: |
13 | 9 |
|
14 | | -## Install |
15 | 10 |
|
16 | | -Install Privexec by [baulk](https://github.com/baulk/baulk) |
| 11 | +## Screenshot: |
| 12 | + |
| 13 | + |
17 | 14 |
|
18 | | -```powershell |
19 | | -baulk install wsudo |
20 | | -wsudo --version |
21 | | -``` |
22 | 15 |
|
23 | | -Or 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) |
| 16 | +All credit goes to Force Charlie (https://github.com/fcharlie) |
24 | 17 |
|
| 18 | +Original Privexec: https://github.com/M2Team/Privexec |
25 | 19 |
|
26 | 20 |
|
27 | | -## Alias |
28 | | -Privexec 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`. |
| 21 | +## LPAC (Less Privileged AppContainer) Details: |
29 | 22 |
|
| 23 | +## Important Capabilities for LPAC (minimum) |
30 | 24 |
|
31 | | -```json |
32 | | -{ |
33 | | - "alias": [ |
34 | | - { |
35 | | - "description": "Edit Hosts", |
36 | | - "name": "edit-hosts", |
37 | | - "target": "Notepad %windir%\\System32\\Drivers\\etc\\hosts" |
38 | | - }, |
39 | | - { |
40 | | - "description": "Windows Debugger", |
41 | | - "name": "windbg", |
42 | | - "target": "\"%ProgramFiles(x86)%\\Windows Kits\\10\\Debuggers\\x64\\windbg.exe\"" |
43 | | - } |
44 | | - ] |
45 | | -} |
46 | | -``` |
| 25 | +- lpacCom |
| 26 | +- lpacAppExperience |
| 27 | +- registryRead |
47 | 28 |
|
48 | 29 |
|
49 | | -## Screenshot |
| 30 | +## Identifying LPAC Processes |
50 | 31 |
|
51 | | - |
| 32 | +System Informer (previously Process Hacker) latest Nightly builds can identify LPAC as well. On the Token tab, go to Advanced to bring up the Token Properties and go to the Attributes tab. LPAC can be identified with the WIN://NOALLAPPPKG security attribute. |
52 | 33 |
|
53 | 34 |
|
54 | | -Alias: |
55 | | - |
56 | | - |
57 | | - |
58 | | -AppContainer: |
59 | | - |
60 | | - |
61 | | - |
62 | | - |
63 | | -wsudo usage: |
64 | | - |
65 | | - |
66 | | - |
67 | | -wsudo Verbose Mode: |
68 | | - |
69 | | - |
70 | | - |
71 | | -AppContainer Exec |
72 | | - |
73 | | - |
74 | | - |
75 | | -## Usage |
76 | | - |
77 | | -Privexec 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. |
78 | | - |
79 | | -AppExec 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. |
80 | | - |
81 | | -wsudo is the console version of Privexec/AppExec. The detailed help is as follows: |
82 | | - |
83 | | -**wsudo usage:** |
84 | | - |
85 | | -```txt |
86 | | -wsudo 💖 5.0 run the program with the specified permissions |
87 | | -usage: wsudo command args... |
88 | | - -v|--version print version and exit |
89 | | - -h|--help print help information and exit |
90 | | - -V|--verbose Make the operation more talkative |
91 | | - -c|--cwd Use a working directory to launch the process. |
92 | | - -e|--env Use specific environment variables to start child processes. |
93 | | - -n|--nui Starts a separate window to run a specified program or command. |
94 | | - -H|--hide Hide child process window. not wait. (CREATE_NO_WINDOW) |
95 | | - -w|--wait Start application and wait for it to terminate. |
96 | | - -u|--user run as user (optional), support '-uX', '-u X', '--user=X', '--user X' |
97 | | - Supported user categories (Ignore case): |
98 | | - AppContainer MIC Basic |
99 | | - Standard Administrator System |
100 | | - TrustedInstaller |
101 | | -
|
102 | | - -x|--appx AppContainer AppManifest file path |
103 | | - -L|--lpac Less Privileged AppContainer mode. |
104 | | - --disable-alias Disable Privexec alias, By default, if Privexec exists alias, use it. |
105 | | - --appid Set AppContainer ID name (compatible --appname) |
106 | | -
|
107 | | -Select user can use the following flags: |
108 | | - -a|--appcontainer AppContainer |
109 | | - -M|--mic Mandatory Integrity Control |
110 | | - -B|--basic Basic execution, permission inheritance mode (default) |
111 | | - -U|--standard Standard user no elevated (UAC) |
112 | | - -A|--administrator Administrator |
113 | | - -S|--system System |
114 | | - -T|--ti TrustedInstaller |
115 | | -
|
116 | | -Example: |
117 | | - wsudo -A pwsh -NoProfile |
118 | | - wsudo -T cmd |
119 | | - wsudo -U -V -eCURL_SSL_BACKEND=schannel curl --verbose -I https://nghttp2.org |
120 | | - wsudo -U -V CURL_SSL_BACKEND=schannel curl --verbose -I https://nghttp2.org |
121 | | -
|
122 | | -Builtin 'alias' command: |
123 | | - wsudo alias add ehs "notepad %SYSTEMROOT%/System32/drivers/etc/hosts" "Edit Hosts" |
124 | | - wsudo alias delete ehs |
125 | | -
|
126 | | -``` |
127 | | - |
128 | | -When Privexec, AppExec, wsudo launch commands, the command line and launch directory support deduction via `ExpandEnvironmentString`. |
129 | | - |
130 | | - |
131 | | -## WSUDO Details |
132 | | - |
133 | | -The wsudo visible and wait related parameters are `--hide` `--wait` `--new-console`. The corresponding situation is as follows: |
134 | | - |
135 | | -|PE Subsystem|`No relevant parameters`|`--new-console`|`--hide`| |
136 | | -|---|---|---|--- |
137 | | -|Windows CUI|wait/Inheritance console|no wait/New console|no wait/No console| |
138 | | -|Windows GUI|no wait/New UI|no wait/New UI|no wait/No window| |
139 | | -|Windows CUI `-wait`|wait/Inheritance console|wait/New console|wait/No console| |
140 | | -|Windows GUI `-wait`|wait/New UI|wait/New UI|wait/No window| |
141 | | - |
142 | | -When 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. |
143 | | - |
144 | | -wsudo exec administrator process under mintty (Turn on ConPty): |
145 | | - |
146 | | - |
147 | | - |
148 | | -### WSUDO Environment |
149 | | - |
150 | | -wsudo support `-e/--env` to set environment. such as: |
151 | | - |
152 | | -```batch |
153 | | -::curl must enabled multiple SSL backends. |
154 | | -wsudo -U -V --env CURL_SSL_BACKEND=schannel curl --verbose -I https://nghttp2.org |
155 | | -``` |
156 | | -The environment variables will be deduced according to the Batch mechanism, that is, the environment variables are marked with matching `%`. |
157 | | - |
158 | | -```powershell |
159 | | -# powershell |
160 | | -.\bin\wsudo.exe -n -e 'PATH=%PATH%;%TEMP%' -U cmd |
161 | | -``` |
162 | | - |
163 | | -```batch |
164 | | -::cmd |
165 | | -wsudo -e "PATH=%PATH%;%TEMP%" -n -U cmd |
166 | | -``` |
167 | | - |
168 | | -## Changelog |
169 | | - |
170 | | -see: [changelog.md](./docs/changelog.md) |
171 | | - |
172 | 35 | ## LICENSE |
173 | 36 |
|
174 | | -This project use MIT License, and JSON use [https://github.com/nlohmann/json](https://github.com/nlohmann/json) , some API use NSudo, but rewrite it. |
| 37 | +This project use MIT License, and JSON use [https://github.com/nlohmann/json](https://github.com/nlohmann/json) , some API use NSudo, but rewrite it. |
0 commit comments