Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

WannaCry Ransomware: Why It Persists and How to Stop It

· 7 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

WannaCry persists because it targets a fundamental vulnerability in the Server Message Block (SMB) protocol that remains unpatched on legacy systems and improperly configured networks. To stop it, you must disable SMBv1, apply the MS17-010 security update, and ensure all devices on your local network are fully patched, as the malware spreads laterally without requiring user interaction.

What You'll Need

  • Administrative access to the Windows operating system on all affected or at-risk machines.
  • An active internet connection to download official security updates from Microsoft.
  • Access to the router or firewall settings for the local network.
  • A current backup of critical data stored on an external, disconnected drive.

Step-by-Step

  1. Identify Vulnerable Systems: Start by auditing your network for any machines running outdated versions of Windows, specifically Windows XP, Windows Vista, or Windows 7. These systems are the primary targets because they often lack the modern security defaults found in Windows 10 and 11. Check the system properties to verify the OS version.
  2. Install the MS17-010 Security Update: The core of WannaCry's ability to spread is a vulnerability addressed in the MS17-010 patch. Open the Windows Update menu and check for all available critical updates. If you are managing a legacy system that no longer receives automatic updates, visit the official Microsoft Update Catalog to manually search for and download the security update corresponding to your specific OS version and architecture (x86 or x64).
  3. Disable SMBv1 Protocol: WannaCry uses the SMBv1 protocol to move from one computer to another across a network. Since SMBv1 is obsolete and insecure, it should be disabled. In Windows, open the Control Panel, navigate to Programs > Programs and Features, and select "Turn Windows features on or off" from the left-hand sidebar. Scroll down to find "SMB 1.0/CIFS File Sharing Support," uncheck the box, and click OK. You will be prompted to restart your computer to apply the changes. Note that labels may differ slightly depending on your Windows version or region.
  4. Configure the Hardware Firewall: Prevent the malware from entering your network from the internet by blocking the ports it uses for propagation. Access your router's administrative interface via your web browser. Locate the port forwarding or firewall settings and ensure that TCP port 445 and UDP ports 137 and 138 are blocked from external (WAN) traffic. This prevents the "worm" component of the ransomware from scanning your network from the outside.
  5. Implement Network Segmentation: To prevent a single infected device from compromising the entire office or home, divide your network into smaller segments. Use Virtual Local Area Networks (VLANs) if your hardware supports it. By isolating guest devices or IoT hardware from your primary data servers, you limit the lateral movement capabilities of ransomware.
  6. Enable Controlled Folder Access: For users on modern Windows versions, use the built-in ransomware protection. Open the Windows Security app, go to Virus & threat protection > Manage ransomware protection, and toggle "Controlled folder access" to On. This prevents unauthorized applications from modifying files in protected folders, which is exactly how ransomware encrypts your data.
  7. Verify Backup Integrity: Ransomware is only effective if you do not have a way to recover your data. Connect an external hard drive, copy your most important documents, and then physically disconnect the drive from the computer. A backup that remains plugged into the machine during an attack will be encrypted along with the rest of the system.

Common Mistakes

One of the most frequent mistakes is assuming that having an antivirus installed is sufficient protection. While antivirus software can detect the WannaCry executable, the worm component exploits a system-level vulnerability. If the OS is not patched, the malware can sometimes bypass traditional antivirus signatures by exploiting the kernel directly. Another common error is updating only the primary workstation while ignoring "headless" devices, such as old network-attached storage (NAS) units or legacy print servers, which often run outdated Linux or Windows kernels that are still vulnerable to SMB exploits.

Users also frequently mistake "disabling file sharing" for "disabling SMBv1." Simply turning off the "File and Printer Sharing" toggle in the network settings does not always disable the underlying SMBv1 protocol at the system level. The protocol may still be active and listening for connections, leaving the door open for the exploit. Finally, many people fail to restart their machines after applying the MS17-010 patch. Because this update modifies core system files, the vulnerability remains open until a full system reboot is completed.

Tips

To maintain a long-term defense, adopt a "Least Privilege" model for your user accounts. Do not use an account with Administrative privileges for daily tasks like web browsing or checking email. If a user is logged in as a Standard User, many ransomware strains struggle to gain the permissions necessary to disable security software or encrypt system-level directories.

Regularly audit your network using a vulnerability scanner. There are official tools and reputable security scanners that can check if port 445 is open and if the MS17-010 vulnerability is present on your local IP addresses. This allows you to find the "forgotten" laptop in the attic or the old server in the closet that is creating a security hole for the rest of your network. Additionally, keep your browser and PDF readers updated, as these are common entry points for the initial payload before the worm begins to spread.

Troubleshooting

If you find that you cannot disable SMBv1 through the Control Panel, you may need to use the Command Prompt. Right-click the Start button and select "Command Prompt (Admin)" or "Windows PowerShell (Admin)." Type the command Disable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol and press Enter. If this returns an error, ensure you are running the prompt with full administrative rights.

If your network printer or an old file server stops working after you disable SMBv1, it is likely because that device is too old to support SMBv2 or SMBv3. The safest solution is to replace the hardware. If replacement is impossible, isolate that specific device on its own VLAN so it cannot communicate with your modern PCs, and only allow specific, monitored traffic to reach it. Never re-enable SMBv1 on your primary workstations just to support one old printer, as this re-opens the vulnerability to WannaCry and similar exploits.

If you suspect a machine is already infected, immediately disconnect it from the Wi-Fi or unplug the Ethernet cable. Do not shut the computer down immediately if you intend to seek professional data recovery, as some decryption tools rely on keys that may be stored in the system's volatile RAM. Isolate the machine first, then use a clean device to research the specific variant of the ransomware to see if a public decryptor has been released.

Frequently Asked Questions

Can WannaCry infect Mac or Linux systems?

The primary WannaCry payload is designed for Windows. However, the underlying SMB vulnerability can exist in some Linux distributions (via Samba). While the encryption payload typically doesn't run on macOS or Linux, these systems could potentially act as carriers or be affected by different variants of the same exploit.

Will a firewall stop the spread of WannaCry?

A firewall can stop the initial entry if it blocks port 445 from the internet. However, if one device inside your network is already infected (e.g., via a USB drive), a perimeter firewall will not stop the malware from spreading to other unpatched devices on the same local network.

Is it safe to pay the ransom?

Security experts and law enforcement strongly advise against paying. There is no guarantee that the attackers will provide the decryption key, and paying funds further criminal activity. Often, the decryption software provided by attackers is buggy and may permanently corrupt your files during the process.

Does Windows 10 and 11 have this vulnerability?

Modern versions of Windows have SMBv1 disabled by default and include the MS17-010 patches. However, if a user manually enables SMBv1 for compatibility with old hardware, they may re-introduce the vulnerability. Always keep your OS updated to the latest build.

Can I recover files without a backup?

Recovery without a backup is very difficult. You should check official repositories like "No More Ransom," a project by Europol and security firms, to see if a decryption tool exists for your specific version of the malware. If no tool exists, the only option is to wait for a leak of the master keys.