EternalBlue

On this page 7

EternalBlue is an exploit for CVE-2017-0144, a memory corruption flaw in the Server Message Block version 1 (SMBv1) driver of Microsoft Windows that lets an unauthenticated attacker run code with kernel privileges by sending crafted packets to TCP port 445. Among the named cases studied under vulnerabilities in cybersecurity, it is the reference example of how a single unpatched network service can turn an exploit into a self-propagating worm.

The exploit was developed by a United States intelligence agency, leaked by a group calling itself the Shadow Brokers in April 2017, and weaponized within weeks. Microsoft had already shipped the fix as security bulletin MS17-010 in March 2017, so the damage that followed was largely a story of delayed patching rather than a true zero-day.

How the EternalBlue exploit corrupts kernel memory

EternalBlue chains three separate bugs in the SMBv1 server driver srv.sys to achieve a controlled overwrite in the non-paged kernel pool. The central flaw sits in the routine that converts OS/2 extended attribute lists (FEA lists) into the native Windows NT format, where a size field is recalculated with a 16-bit versus 32-bit arithmetic error.

Because of that error, the driver allocates a buffer that is too small and then copies the full attacker-supplied list into it, producing a classic buffer overflow. A second bug lets the attacker send an oversized attribute list through a sequence of Trans2 secondary requests, and a third makes it possible to reserve kernel memory of a chosen size. Together they support heap grooming: the attacker fills the pool with predictable SMBv2 buffers so that the overflow lands on a structure whose pointer can be hijacked.

The table below summarizes the main stages an EternalBlue attack follows on the wire.

StageWhat the attacker sendsEffect on the target
ConnectionSMBv1 negotiation on port 445Anonymous session is established
GroomingMany SMBv2 packets of fixed sizeKernel pool layout becomes predictable
OverflowMalformed FEA list via Trans2 requestsAdjacent pool structure is overwritten
ExecutionShellcode reached through a hijacked pointerCode runs in ring 0 as SYSTEM
PersistencePayload such as a kernel backdoorAttacker can load further modules
Stages of a typical EternalBlue exploitation

In the original leaked toolkit, the payload was usually DoublePulsar, a memory-resident kernel implant that waits for further commands over SMB. Because the code runs before any authentication, no user interaction and no credentials are required, which classifies EternalBlue as a wormable remote code execution exploit.

The MS17-010 vulnerability family

EternalBlue is the best-known member of a cluster of six SMBv1 vulnerabilities fixed together in MS17-010. Several sibling exploits from the same leak target different bugs in that cluster, and defenders often treat them as one risk because a single update closes all of them.

Exploit namePrimary weakness usedTypical targets
EternalBlueFEA list size miscalculationWindows 7 and Server 2008 R2
EternalRomanceType confusion in transaction handlingWindows XP through Server 2012
EternalSynergyTransaction handling with info leakWindows 8 and Server 2012
EternalChampionRace condition in transactionsWindows 7 and earlier
Leaked exploits related to MS17-010

The CVE record assigns EternalBlue a high CVSS base score, but the score understates its practical impact. The flaw is in the CISA KEV catalog, has public Metasploit modules, and continues to receive a very high EPSS probability, which illustrates why exploit availability matters as much as the base score when prioritizing fixes.

Outbreaks that made EternalBlue famous

EternalBlue became a household name because criminal and state actors embedded it in self-spreading malware within weeks of the leak. Each campaign used the exploit to jump from one Windows host to the next across flat internal networks.

CampaignDateRole of EternalBlueConsequence
WannaCryMay 2017Worm propagation to random and local addressesHundreds of thousands of hosts encrypted
NotPetyaJune 2017Lateral movement alongside credential theftDestructive wiper disguised as ransomware
AdylkuzzSpring 2017Silent spread of a mining payloadCryptojacking on unpatched servers
Later botnets2018 onwardReused module for internal spreadingPersistent infections in legacy networks
Major campaigns that used EternalBlue

WannaCry stopped spreading mainly because a researcher registered a domain that served as an accidental kill switch, not because of patching. NotPetya was more damaging: it combined EternalBlue with credential harvesting, so even patched machines fell once a single administrator account was compromised. Microsoft took the rare step of releasing emergency patches for Windows XP and Server 2003, systems that were already out of support.

Detecting and mitigating EternalBlue exposure

The definitive defense is to install MS17-010 or any later cumulative update and then disable SMBv1 entirely, since modern Windows versions do not need it for normal file sharing. Network controls reduce the blast radius when legacy systems cannot be patched quickly.

MeasureWhat it preventsLimitation
Apply MS17-010Exploitation of all six SMBv1 bugsRequires reboot and change window
Disable SMBv1Any attack on the legacy protocolBreaks very old devices and printers
Block port 445 at the perimeterInternet-borne scanning and infectionNo protection inside the network
Segment internal networksRapid lateral worm spreadNeeds careful rule design
IDS signaturesUndetected exploitation attemptsAlerts only, does not block alone
Defensive measures and what each achieves

Detection relies on network signatures for malformed Trans2 and FEA traffic, on scanners that test for the MS17-010 patch state, and on endpoint telemetry that flags unexpected kernel threads. Vulnerability management teams usually find residual exposure in forgotten hosts: industrial workstations, medical devices and embedded Windows systems that sit outside the normal patch cycle.

Common misconceptions about EternalBlue

  • EternalBlue was not a zero-day at the time of WannaCry; the patch had been public for about two months, making it an N-day vulnerability in practice.
  • Blocking port 445 on the internet edge is not sufficient, because most real infections spread laterally inside corporate networks.
  • Windows 10 was also vulnerable before patching, although the public exploit was most reliable on Windows 7 and Server 2008 R2.
  • The exploit is not obsolete: scanners still find unpatched SMBv1 hosts years later, and security teams still see attempts in their logs.

In simple terms

EternalBlue is a master key for old Windows file sharing. Windows computers talk to each other through a service that shares files and printers. An older version of that service had a mistake in how it counted the size of certain messages, so a stranger could send a specially shaped message and take full control of the computer without a password.

The key was originally built by a government agency, then stolen and published online. Criminals copied it into programs that spread on their own from computer to computer. The fix already existed, so the lesson is simple: install updates promptly and switch off old features nobody uses.

A practical example

A regional hospital runs about 2,000 Windows workstations, plus several imaging stations on Windows 7 that the equipment vendor has not certified for updates. During a quarterly scan, the security team finds that 40 hosts still lack MS17-010 and still accept SMBv1 connections on port 445.

The team patches 32 office machines within a week and disables SMBv1 on them through group policy. The eight imaging stations cannot be updated, so engineers move them into an isolated network segment where only the archive server may reach them, and they add an intrusion detection rule for malformed Trans2 traffic.

Three months later, a contractor laptop infected with an old worm connects to the guest network and begins scanning for port 445. The detection rule fires, the segmentation blocks every attempt, and no clinical system is affected. The incident report recommends replacing the imaging stations, since isolation is a compensating control, not a fix.