Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/documentation/modules/exploit/windows/local/bypassuac_silentcleanup.md
Views: 11789
Introduction
This module will bypass UAC on any Windows installation with Powershell installed.
There's a task in Windows Task Scheduler called "SilentCleanup" which, while it's executed as Users, automatically runs with elevated privileges. When it runs, it executes the file %windir%\system32\cleanmgr.exe. Since it runs as Users, and we can control user's environment variables, %windir% (normally pointing to C:\Windows) can be changed to point to whatever we want, and it'll run as admin. In order to work, the code must be saved in a script file somewhere, it cannot be run directly from powershell or from the run dialog.
Usage
Create a session on the target system under the context of a local administrative user.
Begin interacting with the module:
use exploit/windows/local/bypassuac_silentcleanup
.Set the
PAYLOAD
and configure it correctly, making sure the architecture is correct.If an existing handler is configured to receive the elevated session, then the module's handler should be disabled:
set DisablePayloadHandler true
.Make sure that the
SESSION
value is set to the existing session identifier.Invoke the module:
run
.