Wannakey Decrypted: How to Recover Files Without Paying

Written by

in

Wannakey is a free, open-source cybersecurity decryption tool developed to help victims recover data locked by the global WannaCry ransomware attack. Created by French security researcher Adrien Guinet from Quarkslab, the tool was released on GitHub shortly after the massive May 2017 cyberattack. It allows users to bypass the cybercriminals’ ransom demands—which ranged from \(300 to \)600 in Bitcoin—by rebuilding the decryption key directly from the computer’s memory. How Wannakey Works

WannaCry uses a dual-key system: a public key to encrypt the user’s files and a private key required to decrypt them. Normally, the ransomware completely erases or encrypts this private key to force a payout.

However, Guinet discovered a significant vulnerability in how the ransomware interacted with older Windows operating systems:

The Windows Crypto API Flaw: When WannaCry calls the Microsoft-designed key deletion functions (CryptDestroyKey and CryptReleaseContext), the operating system frees up the memory slot but does not erase the actual raw data.

Extracting Prime Numbers: The tool scans the active memory of the ransomware process (wcry.exe or wnry.exe) to locate the two large prime numbers used to generate the RSA private key.

Rebuilding the Key: Once Wannakey finds these prime numbers, they can be recomputed into the master decryption key, allowing users to safely click the “Decrypt” button in the ransomware interface to unlock their data. Strict Limitations and Caveats

While Wannakey was highly praised, it came with very specific technical constraints that meant it could not save every infected device:

No Reboots Allowed: The computer must not have been restarted or shut down after the infection. Rebooting completely clears the volatile RAM, permanently erasing the prime numbers needed for recovery.

Operating System Constraints: Wannakey was strictly designed for Windows XP. Newer systems like Windows 10 properly scrub keys from memory upon context release, leaving no remnants for the tool to find.

The “Luck” Factor: Users had to act quickly before the operational memory was overwritten by other background programs or system processes. The Legacy: Evolution into Wanakiwi

Wannakey’s proof of concept laid the groundwork for an even more effective tool called Wanakiwi. Developed by researchers Matt Suiche and Benjamin Delpy, Wanakiwi automated Guinet’s methodology and expanded compatibility to support Windows Vista, Windows 7, Windows Server 2003, and Server 2008, ultimately saving organizations millions of dollars in potential data loss.

If you are dealing with a ransomware incident or researching mitigation strategies, please tell me: The exact operating system of the affected machine.

Whether the computer has been rebooted or turned off since the incident. If you have any offline backups available.

I can guide you through the safest recovery options or direct you to modern, free decryption resources like the Emsisoft Ransomware Decryption Tools or the No More Ransom initiative.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *