WannaCry

WannaCry

One-liner: Global Ransomware outbreak in May 2017 that exploited EternalBlue to infect 300,000+ systems worldwide.

🎯 What Is It?

WannaCry (also WannaCrypt, WCry) was a ransomware cryptoworm that spread rapidly across the globe in May 2017, exploiting the EternalBlue vulnerability (CVE-2017-0144) in Microsoft's SMB protocol. It became one of the most infamous cyberattacks in history due to its speed, scale, and impact on critical infrastructure.

⏱️ Timeline: May 12-15, 2017

Day 1 (May 12)

08:00 UTC - Initial infections detected in Asia
10:00 UTC - Spreads to Europe
12:00 UTC - UK's National Health Service (NHS) crippled
         - 80+ NHS trusts affected
         - Ambulances diverted
         - Surgeries cancelled
15:00 UTC - 150+ countries infected
22:30 UTC - Marcus Hutchins discovers kill switch domain
         - Registers sinkhole domain
         - Slows infection spread

Days 2-3 (May 13-14)

Post-Attack

πŸ› Technical Details

Infection Vector

EternalBlue + DoublePulsar

1. Scan for vulnerable SMB (port 445)
2. Exploit CVE-2017-0144 (EternalBlue)
3. Install [[DoublePulsar]] backdoor
4. Drop WannaCry payload
5. Encrypt files
6. Propagate to other systems

Propagation (Worm Behavior)

# Pseudo-code
while True:
    scan_random_ips()  # Scan for port 445
    if smb_vulnerable(target):
        exploit_eternalblue(target)
        copy_self_to(target)
        encrypt_files(target)

Unlike typical ransomware, WannaCry was a cryptowormβ€”it self-replicated without user interaction.

Kill Switch

Domain: iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com

if resolve_domain(kill_switch_domain):
    exit()  # Stop execution
else:
    continue_infection()

How it worked:

Why include a kill switch?

Encryption

Ransom Demand

🎯 Impact by Sector

Healthcare (Most Visible)

Manufacturing

Transportation

Government

Total Damage

πŸ”’ The EternalBlue Connection

Origin: Leaked by Shadow Brokers (April 2017)

Why it spread so fast:

πŸ›‘οΈ Detection & Prevention

IOCs (Indicators of Compromise)

File Hashes:

SHA256: ed01ebfbc9eb5bbea545af4d01bf5f1071661840480439c6e5babe8e080e41aa
SHA256: 09a46b3e1be080745a6d8d88d6b5bd351b1c7586ae0dc94d0c238ee36421cafa

File Names:

Registry Keys:

HKLM\SOFTWARE\WanaCrypt0r
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\mssecsvc

Network:

Sysmon Detection

Process: mssecsvc.exe, tasksche.exe
Network: Outbound SMB (445) scanning
File Creation: Mass .WNCRY extensions
Registry: WanaCrypt0r key creation

Prevention

  1. Patch MS17-010 β€” CVE-2017-0144
  2. Disable SMBv1 β€” Legacy protocol
  3. Firewall rules β€” Block port 445 externally
  4. Backups β€” 3-2-1 rule
  5. Segment networks β€” Limit Lateral Movement

πŸ” Attribution

Lazarus Group (North Korea)

Evidence:

Motive:

🎯 Lessons Learned

1. Patch Management is Critical

2. Legacy Systems are Dangerous

3. Network Segmentation

4. Backups Save Lives (Literally)

5. Supply Chain Matters

πŸ”„ Variants

  1. WannaCry 1.0 β€” Original with kill switch
  2. WannaCry 2.0 β€” Kill switch removed
  3. WannaCry 3.0 β€” Additional obfuscation

All variants still exploited EternalBlue.

🎀 Interview Angles

Q: What made WannaCry so devastating?

Q: What was the kill switch and how did it work?

STAR Example:

Q: How would you prevent another WannaCry?

  1. Aggressive patch management β€” MS17-010 patch applied immediately
  2. Disable SMBv1 β€” Legacy, vulnerable protocol
  3. Firewall rules β€” Block external SMB (port 445)
  4. Network segmentation β€” Limit lateral spread
  5. EDR β€” Detect EternalBlue exploitation attempts
  6. Backups β€” Offline, tested regularly