Attack encyclopedia
WannaCry - the ransomware that shut down hospitals
WannaCry - analysis of the global ransomware attack from May 2017. EternalBlue, NHS, Marcus Hutchins and the kill switch, Lazarus Group attribution. MITRE ATT&CK mapping (S0366).
Józef SulwińskiPublished 10 min read

Contents
Friday, 12 May 2017. 1:00 PM London time. In National Health Service hospitals across England and Scotland, computer screens start flashing red. A message appears on the monitors: “Ooops, your files have been encrypted!” - pay 300 dollars in bitcoin or lose your data forever. Within minutes, doctors lose access to patient records. MRI scanners stop working. Blood management systems go offline. Ambulances are diverted to other facilities. Patients waiting for urgent surgeries hear: “Please go home, we cannot admit you.”
This was not a disaster movie. This was WannaCry - the fastest-spreading ransomware attack in history, which within hours paralyzed over 200,000 computers in more than 150 countries. And it was stopped by a 22-year-old security researcher who spent 10 dollars and 69 cents to register a domain name.
A weapon that should not have existed - the story of EternalBlue
To understand WannaCry, you need to go back a few years - to the laboratories of Tailored Access Operations, the elite hacking unit of the United States National Security Agency (NSA). That is where an exploit codenamed EternalBlue was created - a tool that exploited a critical vulnerability in the SMBv1 (Server Message Block) protocol of Windows. The flaw allowed remote code execution on any unpatched computer - without any user interaction. All the machine needed was a network connection.
The NSA knew about this vulnerability for years, but instead of reporting it to Microsoft, they kept it as part of their offensive cyber arsenal. That decision had catastrophic consequences.
On 13 August 2016, a mysterious group called the Shadow Brokers announced they had stolen cyber weapons from the NSA’s arsenal. Over the following months they published successive batches of tools - first attempting to sell them at auction, then releasing them for free. On 14 April 2017 came the most dangerous leak: the full collection of Windows exploits, including EternalBlue.
One detail saves some honor: Microsoft released patch MS17-010 on 14 March 2017 - exactly one month before the Shadow Brokers leak. Someone - most likely the NSA itself - warned the company that a leak was inevitable. The problem was that millions of computers worldwide never installed that patch.
Attack timeline
| Date | Event |
|---|---|
| 2016 (August) | Shadow Brokers announce theft of NSA tools |
| 2017 (14 March) | Microsoft releases security patch MS17-010 |
| 2017 (14 April) | Shadow Brokers release EternalBlue publicly |
| 2017 (12 May, ~7:44 UTC) | First WannaCry infections recorded in Asia |
| 2017 (12 May, ~12:00 UTC) | Wave of attacks reaches Europe - NHS, Telefonica, Deutsche Bahn |
| 2017 (12 May, ~15:03 UTC) | Marcus Hutchins registers the kill switch domain - propagation stops |
| 2017 (15 May) | WannaCry variants without a kill switch appear (less effective) |
| 2017 (December) | US, UK, Australia, Canada, and New Zealand publicly attribute the attack to North Korea |
| 2018 (September) | DOJ indicts Park Jin Hyok of the Lazarus Group for involvement in the attack |
| 2021 (February) | DOJ expands indictment - three individuals from North Korean military intelligence |
Anatomy of a worm - how WannaCry spread
WannaCry was not ordinary ransomware. It was a worm - a self-propagating program that combined an encryption component with a spreading mechanism based on EternalBlue. This combination is what made it so destructive.
Infection mechanism
Once launched on the first machine, WannaCry executed the following sequence:
-
Kill switch check - the program sent a DNS query to the domain
iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com. If the domain responded, the program stopped. If it did not (and on 12 May it did not, because nobody had registered it), the attack continued. -
Network scanning - WannaCry generated random IP addresses and scanned port 445 (SMB) looking for vulnerable machines on both the local network and the internet.
-
EternalBlue exploitation - upon finding a vulnerable system, the worm used the EternalBlue exploit (CVE-2017-0144) for remote code execution, then the DoublePulsar backdoor to install a copy of itself.
-
File encryption - on the infected machine, WannaCry encrypted files using AES-128-CBC, with the AES key protected by RSA-2048 encryption. Victims saw a ransom demand: 300 USD in bitcoin, rising to 600 USD after three days.
-
Propagation - the cycle repeated automatically from each newly infected machine.
Scale of damage
Within a single afternoon, WannaCry infected over 200,000 computers in more than 150 countries. Among the victims were:
- NHS (United Kingdom) - 80 of 236 hospital trusts, 603 primary care organizations, including 595 GP practices. Up to 70,000 devices were infected - computers, MRI scanners, blood refrigerators, surgical equipment. Losses were estimated at 92 million pounds.
- Telefonica (Spain) - the telecommunications giant’s internal network was paralyzed.
- Deutsche Bahn (Germany) - information boards at train stations displayed the ransom demand instead of schedules.
- Renault (France) - production halted at several factories.
- PetroChina (China) - systems at over 20,000 petrol stations were shut down.
- Russian Ministry of Internal Affairs - over 1,000 computers infected.
The paradox: despite the global scale of the attack, the attackers collected only about 140,000 dollars in bitcoin - recorded across three hardcoded wallets. For a weapon capable of paralyzing healthcare systems, that is a laughably small sum. This suggests the goal of WannaCry may not have been enrichment, but causing chaos.
Marcus Hutchins - the man who stopped a pandemic
This is where the most remarkable part of the story begins.
On 12 May 2017, 22-year-old Marcus Hutchins - known online as MalwareTech - came back from lunch to his room in south-west England and noticed something strange happening on the network. As a security researcher specializing in malware analysis, he quickly obtained a WannaCry sample and began analyzing it.
In the worm’s code he noticed something peculiar. Before starting encryption, the program attempted to connect to an absurdly long domain: iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com. The domain did not exist - no server was answering queries. Hutchins thought it might be a communication mechanism with a Command & Control server, so he decided to register the domain to track the worm’s network traffic. Cost: 10 dollars and 69 cents.
At 15:03 UTC the domain started responding.
And then something happened that Hutchins did not expect. WannaCry stopped spreading.
It turned out the domain was not a C2 server address. It was a kill switch - an emergency shutoff built into the worm’s code. If the domain responded, WannaCry interpreted it as a signal that it was running in a sandbox (analysis) environment and halted its operation. The malware authors assumed that no “real” domain with such an absurd name would ever be registered.
Hutchins did not yet know what he had done. Only when a friend - another security researcher - messaged him: “I think you just stopped a global cyberattack” - did he begin to grasp the scale of his discovery. He then stayed awake for over 30 hours, maintaining the sinkhole infrastructure and monitoring traffic.
The next morning he woke up to find his face on the front pages of British tabloids. The media declared him “the hero who saved the internet.” Hutchins, an introverted researcher working from his bedroom, had suddenly become a public figure - and that was only the beginning of his turbulent story. In August 2017, returning from the DEF CON conference in Las Vegas, he was arrested by the FBI for creating the Kronos banking trojan in 2014 - a crime from when he was still a teenager. In July 2019, the court sentenced him to time served and one year of supervised release, acknowledging his subsequent contributions to cybersecurity.
North Korea and the Lazarus Group
Who was behind WannaCry? The trail leads to Pyongyang.
In December 2017, the United States, the United Kingdom, Australia, Canada, and New Zealand jointly identified North Korea as responsible for the attack. Technical analysis conducted by Symantec, Kaspersky Lab, and BAE Systems found links between WannaCry’s code and the tools of the Lazarus Group (MITRE ATT&CK: G0032) - an elite hacking unit under the Reconnaissance General Bureau (RGB), North Korea’s military intelligence agency.
In September 2018, the US Department of Justice indicted Park Jin Hyok - a member of the Lazarus Group - for involvement in creating WannaCry, as well as the Sony Pictures attack (2014) and the theft of 81 million dollars from the Central Bank of Bangladesh (2016). In February 2021, the indictment was expanded to include two additional agents: Jon Chang Hyok and Kim Il Park.
None of the accused has been apprehended.
MITRE ATT&CK - technique mapping (S0366)
WannaCry is catalogued in the MITRE ATT&CK framework as S0366. The framework maps 15 techniques across eight tactics:
| Tactic | Technique | ID | Description |
|---|---|---|---|
| Initial Access | Exploit Public-Facing Application | T1190 | Exploitation of the SMBv1 vulnerability via EternalBlue |
| Execution | Windows Service | T1543.003 | Installation as a system service |
| Persistence | Boot or Logon Autostart | T1547 | Mechanism to survive reboots |
| Discovery | File and Directory Discovery | T1083 | Searching for files to encrypt |
| Discovery | System Network Connections Discovery | T1049 | Scanning the network for vulnerable hosts |
| Lateral Movement | Exploitation of Remote Services | T1210 | Propagation via EternalBlue/DoublePulsar |
| Command and Control | Encrypted Channel | T1573.002 | Asymmetric encryption of communications (RSA) |
| Impact | Data Encrypted for Impact | T1486 | Encryption of victim files (AES-128-CBC + RSA-2048) |
| Impact | Service Stop | T1489 | Stopping system services before encryption |
Lessons that still apply
1. Patch management saves lives - literally
Patch MS17-010 had been available for two months before the attack. Had the NHS updated its systems, WannaCry would have had no way to spread. Most infected machines in hospitals were running Windows 7 with missing updates. The problem was not technical - it was organizational. Managing updates in large, distributed environments requires process, tooling, and discipline.
2. Network segmentation limits the blast radius
WannaCry spread at lightning speed because networks were flat - one segment, no barriers. Proper network segmentation - with dedicated zones for critical systems, workstations, and internet access - confines worm propagation to a single segment instead of the entire organization.
3. Ransomware is not just an IT problem
WannaCry proved that ransomware can paralyze critical infrastructure - hospitals, transport, energy. Today, eight years after the attack, the ransomware threat is even greater. Groups such as LockBit, BlackCat, and Cl0p target organizations in the OT and critical infrastructure sectors, where downtime means not financial losses but threats to human life and health.
4. An offensive arsenal is a double-edged sword
EternalBlue was created as an NSA tool. It ended with an intelligence agency’s weapon paralyzing hospitals in allied Britain. This story prompted a serious debate about responsible vulnerability disclosure (the Vulnerabilities Equities Process) - should government agencies stockpile security flaws, risking their leak?
5. A kill switch is a trap, not a safeguard
The kill switch in WannaCry was not a deliberate safety mechanism - it was an attempt to evade sandbox analysis. The fact that it worked as a brake was pure chance. The next generation of ransomware will not repeat that mistake - and has not.
Summary
WannaCry was a wake-up call. It showed what happens when military-grade exploits fall into criminal hands and organizations ignore the fundamentals of security hygiene. 200,000 infected computers, paralyzed hospitals, diverted ambulances - all because someone failed to install a patch that had been available for two months.
The story of Marcus Hutchins adds an almost cinematic twist - a 22-year-old who stopped a global digital pandemic for 10 dollars. But do not count on someone finding a kill switch next time.
Sources
- WannaCry ransomware attack - Wikipedia
- WannaCry, Software S0366 - MITRE ATT&CK
- Marcus Hutchins - Wikipedia
- The sinkhole that saved the internet - TechCrunch
- What Is EternalBlue and Why Is the MS17-010 Exploit Still Relevant? - Avast
- EternalBlue - Wikipedia
- Three North Korean Military Hackers Indicted - U.S. Department of Justice
- WannaCry ransomware used in widespread attacks all over the world - Kaspersky Securelist
- NHS ransomware attack spreads worldwide - PMC/NIH
- Lazarus Group - Wikipedia
- Mapping MITRE ATT&CK to the WannaCry Campaign - ReliaQuest
Need help in this area?
Our experts will help you assess the risk and plan next steps.