Skip to content

wiztree: ask for admin once, through Explorer when UAC cannot raise it - #146

Open
Tkyoxx wants to merge 1 commit into
Lemxy:mainfrom
Tkyoxx:pr/14-disk-admin-once
Open

Tkyoxx wants to merge 1 commit into
Lemxy:mainfrom
Tkyoxx:pr/14-disk-admin-once

Conversation

@Tkyoxx

@Tkyoxx Tkyoxx commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

What

A copy without admin rights asked for them and quit, with no limit. The bar, reshell and rs-launcher run with the runas /trustlevel:0x20000 token the installer gives them (common::launch::program), and so does what they open, e.g. rust-explorer from Win+E. UAC cannot raise that token (derived from an elevated one, it even reports TokenElevationTypeFull); on a PC set to elevate without prompting (ConsentPromptBehaviorAdmin = 0) each request quietly started another copy without rights, about one a second, forever: the busy cursor never stopped. Found through rust-explorer's "Analyze disk".

  • A token that is not the split one Explorer has (type 3) goes through Explorer when Explorer is the shell: explorer.exe wiztree.exe, with the arguments in a note (%LOCALAPPDATA%\WinRust\disk-start.txt, read within 30 s and deleted) since Explorer starts programs without any.
  • At most one UAC request (--elevated); a copy started for it that is still not admin says so in a message box and stops.

#142 fixes the token itself; this keeps WinRust Disk from looping whatever token it is started with. The message has no Spanish text here so this stands on main; it comes with #144 (or I add it to whichever lands second).

Test

On a PC with ConsentPromptBehaviorAdmin = 0, from an elevated shell: runas /trustlevel:0x20000 "C:\Program Files\wiztree\wiztree.exe". Before: a new process every second. After: one window with admin rights (seen: the copy Explorer started asks, the third one opens).

A copy that was not admin asked for it and quit, with no limit. Started
from the bar, the search or a file manager they opened (WinRust gives
those the runas /trustlevel "basic user" token), UAC cannot raise the
token: on a PC set to elevate without prompting each request quietly
started another copy without rights, about one a second, forever (the
busy cursor never stopped).
- That token goes through Explorer instead (the shell's own token can be
  raised); the arguments wait in a note Explorer's copy picks up.
- One request at most: a copy started for it and still not admin says
  so and stops.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant