This article aims to provide instructions on different methods on how to try and restore .WNCRY files encrypted by the second version of the WannaCry ransomware also known as Wana Decrypt0r 2.0, WanaCrypt0r 2.0 and WCry.
“EternalBlue” and “DoublePulsare” are the names of the exploits used by the organization spreading the .WNCRY file infection and what is worse is that they were leaked online somewhere around the Easter holidays by a hacking entity known as “The Shadow Brokers”. This exploit is primarily addressing issues in Windows systems so anyone who is still not infected with this virus is strongly advised to back up your system and then update it.
In case you have become a victim of this ransomware virus, we have created several methods that might prove to be useful in helping you recover your files. The methods are not guaranteed to work, but they are surely the closest you can get to restoring your files, so we advise you to follow them and ask us any questions on our Support Topic about WannaCry ransomware.
Update May 2017: Malware researchers are in progress of developing a decrypter for the WannaCry 2.0 ransomware virus. We have created decryption instructions which we will update as they progress on the development. So far there is a method to locate the private RSA keys. For more information, please follow the related article below:
→Related:Wana Decrypt0r 2.0 – Decrypt Encrypted Files
Method 1: Use Wireshark To Sniff Decryption Keys
It is very difficult to stay ahead of ransomware, like WannaCry, but despite all, we have decided to show you how to use Wireshark to your benefit and hopefully intercept HTTP traffic in the correct moment. However, bear in mind that these instructions are THEORETICAL, and there are a lot of factors that may prevent them from working in an actual situation. Still, it is better than not trying before paying the ransom, right?
Before downloading and using Wireshark – one of the most widely used network sniffers out there, you should have the malware’s executable on standby and infect your computer once again. However, bear in mind that some ransomware viruses perform new encryption every time a computer is restarted as well, so you should also configure Wireshark to run automatically on startup. Let’s begin!
Step 1: Download Wireshark on your computer by clicking on the following buttons( for your version of Windows)
Step 2: Run, configure and learn how to sniff packets with Wireshark. To learn how to start analyzing packets and check where your packets save the data, you should open Wireshark first and then choose your active network interface for analyzing packets. For most users, that would be the interface with traffic bouncing up and down on it’s right. You should choose it and click twice fast to start sniffing:
Step 3: Sniffing packets. Since ransomware viruses communicate via HTTP traffic, you should filter all the packets first. Here is how the packets look initially after you choose your interface and sniff traffic from it:
To intercept only HTTP traffic, you should type the following into the display filter bar:
→ http.request – to intercept the requested traffic
Once filtered it should look like this:
You can also filter the source and destination IP addresses by scrolling up and down and choosing one address, then right clicking on it and navigating to the following feature:
Step 4: Configure Wireshark to run automatically. To do this, first, you should go to the command prompt of your computer by typing cmd on your Windows search and running it. From there, type the following command with capital “-D” setting to get the unique key for your interface. The keys should look like the following:
Step 5: Copy the key for your active connection and create a New Text Document and in it write the following code:
→ wireshark -i 13MD2812-7212-3F21-4723-923F9G239F823(<= Your copied key) –k
You can additionally modify the command by adding the –w letter and creating a name for the file that will save it onto your computer, allowing you to analyze the packets. The result should look similarly to this one:
Step 6: Save the newly created text document as a .bat file, by going to File>Save As… and choosing All Files after which typing .BAT as a file extension, like the picture below shows. Make sure the name of the file and the location where you save it are easy to find:
Step 7: Paste the .bat file in the Windows startup folder. The original location of the folder is:
→ C:\Users\Username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup,/p>
To easily access it, press Windows Button + R key combination and in the Window box type – shell:startup, like the picture below shows and click OK:
After your computer is restarted, if the ransomware virus encrypts your files after which generates a key and sends it to the cyber-criminals’ servers, you should be able to intercept the communication packets and analyze them.
Step 8: How to analyze the traffic?
To analyze the traffic of a given packet, simply right-click it and then click on the following to intercept the traffic:
After doing this, a Window will appear with the information. Make sure to inspect the information carefully and look for keywords that give away the encryption keys, like encrypted, RSA, AES, etc. Take your time and check the packets’ size, make sure that they are similar to the size of a key file.
Method 2: Using Python in Ubuntu
The second method by which you may want to try and recover your files is also not guaranteed to work, but you may succeed in the event that this WannaCry ransomware variant is using the RSA (Rivest-Shamir-Adleman) encryption to generate unique keys for the files. The factorization script was originally designed for CryptoWall ransomware, but it may be useful for this infection as well. Either way, we urge you to be careful and create copies of the encrypted files when following the instructions below:
For this particular tutorial, we have used extension files from another virus, called Bitcrypt. We have also used Ubuntu version 14.04 which assisted us in using special software appropriate for this distribution. You can get it from their website’s download page and you can either:
- Install it along with your operating system by booting a live USB drive.
- Install it on a virtual drive (Recommended).
Here we have brief tutorials for both:
Installation of Ubuntu on your machine:
Step1: Get a USB flash drive that has above 2GB of space.
Step2: Download the free software, called Rufus and install it on your windows.
Step3: Configure Rufus by choosing NTFS as a system and selecting the USB drive as the one to be created as a bootable USB. After that boot the Linux image from the following button:
Make sure you locate it and select it from where you downloaded it.
Step4: After the flash drive is ready, restart your computer, and it should run the Ubuntu installation. If it does not, you should go to the BIOS menu by pressing the BIOS hotkey on startup for your PC (Usually it is F1) and from there select the first boot option to be the USB bootable drive or CD/DVD in case you have burnt Ubuntu on such.
Installation Of Ubuntu on your Virtual Drive
For this installation, you need to download VMware Workstation from their download page or any other Virtual Drive Management program. After installed you should:
Step1: Create a new virtual drive.
Step2: Set the drive size. Make sure you have a minimum of 20 gigabytes of free space fro Ubuntu on your computer. Also choose ‘Run as a single drive’.
Step 3: Select the ISO image. For this option, you should know where it is.
Step 4: After that play the Virtual Machine and it will install automatically.
File Decryption
Once you have Ubuntu or any other Linux distribution on your computer open the terminal by doing the following:
Then update your Linux and install greater version than Python 3.2 by typing the following in the terminal:
→sudo apt-get update
sudo apt-get install python3.2
Also, if your Linux does not have sqlite3 module, install it by typing:
→sudo apt-get install sqlite3 libsqlite3-dev
sudo gem install sqlite3-ruby
Now after we have Python installed, we need to download a script created by 2014 Airbus Defence and Space Cybersecurity. To do this click on this link. Download the file in your ‘Home’ folder after it prompts you where to save it. Keep this as decrypt.py in case it is not saved in this format.
Now that we have Python and the script, it is time to find out the key of the .bytrcypt encrypted file. To do this move your encrypted files ot the home folder by using the file manager:
After you located all of the encrypted files there along with the “decrypt.py” file type the following into the terminal to initiate the script:
→python ./decrypt.py “Your_Encrypted_Document_Name_and_Format”
It will show an error, and this is entirely normal as long as you see this code:
This is the RSA code for this file. Now, we need to decrypt it, and we are halfway there. To do this download a program called cado-nfs2.0.tar.gz from their download page here. We recommend the 2.0 version. However, the newest version is also on a good level.
It will download a .tar archive file (.tar files are very similar to .rar or .zip files). Simply open it and click on the Extract button on top and choose the ‘Home’ folder. It should look like this:
After the we have all the files extracted in the ‘Home’ folder, we need to compile cado-nfs. To do this, open another terminal and type:
→cd cado-nfs-2.0
make
After this is set, it is time to run the key cracker. Important – this process can take from several hours to days to be finished. To begin the process type in your cd cado-nfs terminal:
→./factor.sh YOUR_UNIQUE_KEY_WHICH_IS_LETTERS_OR_NUMBERS_HERE -s 4 -t 6
After the process completes, you should see the following:
→Info:Complete Factorization: Total cpu/real-time for everything: hhhh/dddd
LongNumber1 LongNumber2
After we have the decrypted key, we need to insert in the “decrypt.py” script. Do this by opening decrypt.py in a text editor and finding this part of it:
→known_keys = { many long numbers }
We need to add before the second bracket (“}”) these lines:
The Previous Key, a column, opened parenthesis, LongNumber1, Comma, LongNumber2, closed parenthesis. It should look like this:
→The Previous Key:(LongNumber1,LongNumber2)
Be advised that you should do this only one time. After this it is time to decode the files. To do this type:
→python ./decrypt.py “Your_Encrypted_Document.docx.bitcrypt”
Executing this command will make a file that is called “Your_Encrypted_Document.docx.bitcrypt.CLEAR”
Just rename the file by removing the .clear extension and you should be all set. Repeat the process for your other files as well. But remember that first you should find out their initial keys to decrypt them. You should be able to open them now. We hope this works for you.
Method 3: Using .VHD File Types and Data Recovery Software
This method is likely to bring back the most files of the methods illustrated above, purely because it does not seek a direct solution to decrypt the encrypted files which is impossible if you do not have the keys. Instead it uses different algorithms to recover the files, treating them as if they are deleted. One of the many algorithms used by different data recovery programs is known to be based on branch predictors.
The reason we decided to bring up this method is that many victims of recent ransomware outbreak of Dharma ransomware, another undecryptable virus, were actually able to restore over 90% of their files using this method.
Its primary core competence is that it takes advantage by converting the files into a .VHD file type which is basically a virtual drive partition on your PC. So it treats your encrypted file as a partition. Then, this drive can be booted and you can try to scan the partition itself using data recovery software. The method may not be 100% guarantee, but some users have reported it to be most successful of the ones above. Here are the instructions for it:
Step 1: Make sure to make copies of the .onion encrypted files on another drive or PC:
Step 2: After creating the copies, download a tool that converts files in .VHD format. One good tool is Microsoft’s VHD conversion software. You can download it, by clicking on the button below:
Step 3: Now, make sure to rename a file that you want to recover in the .VHD file extension. For example, if the file is test.onion, it should be test.vhd
Step 4: Now you need to run the VHDTOOL you previously downloaded from Windows Command Prompt. To do this, run Windows Command Prompt as an administrator by typing “cmd” in Windows Search and right-clicking after which choosing “Run as administrator”.
Then type the following commands exactly as it they are:
→ cd {The location of the file, for example C:\Users\Lenovo\Desktop}
vhdtool.exe /convert “{the location of your file and the name goes here}“
The final result should look like the following image:
Step 5: After you convert the drive into VHD, make sure to mount it on your computer. To do this:
Right-click on My Computer or This PC and then click on “Manage”
Then right-click on Disk Management after which click on Attach VHD
Then click on the Browse button in order to locate and open the .vhd file
After this, to initialize the disk, right-click on it and click New Simple Volume. After this click on Next and set it up:
At the end, the volume should appear like the following:
Step 6: Download and recover the .VHD image using data recovery software. The data recovery software you should download has to support the option “Partition Recovery”. Here is a comprehensive list of multiple data recovery programs that are able to recover partitions:
Wana Decrypt0r 2.0 Conclusion and Removal
Whatever the case may be, we will keep looking into this virus and update with any new instructions that are available for it. Keep following our blog posts, Twitter and Google Plus for new updates on this threat. Also, make sure to remove this virus in case you have tried the methods above to restore files encrypted by it. You can do this by checking out our instructional video on how to remove WannaCry. They also include some additional methods for file restoration. Bear in mind that these are not direct solutions to the issue and this is why we advise you to try all of the methods illustrated in this article and video at your own risk.
For most effective removal, malware researchers strongly advise victims to use an advanced anti-malware software. It will make sure that the Wana Decrypt0r 2.0 threat is completely removed and all the damage done by it is reverted. Installing such software on your computer greatly increases the real-time protection against such threats in the future.
It is highly recommended to run a scan before purchasing the full version of the software to make sure that the current version of the malware can be detected by SpyHunter.
- Step 1
- Step 2
- Step 3
- Step 4
- Step 5
Step 1: Scan for WannaCry with SpyHunter Anti-Malware Tool
Ransomware Automatic Removal - Video Guide
Step 2: Uninstall WannaCry and related malware from Windows
Here is a method in few easy steps that should be able to uninstall most programs. No matter if you are using Windows 10, 8, 7, Vista or XP, those steps will get the job done. Dragging the program or its folder to the recycle bin can be a very bad decision. If you do that, bits and pieces of the program are left behind, and that can lead to unstable work of your PC, errors with the file type associations and other unpleasant activities. The proper way to get a program off your computer is to Uninstall it. To do that:
Step 3: Clean any registries, created by WannaCry on your computer.
The usually targeted registries of Windows machines are the following:
- HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
- HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
- HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce
- HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce
You can access them by opening the Windows registry editor and deleting any values, created by WannaCry there. This can happen by following the steps underneath:
Before starting "Step 4", please boot back into Normal mode, in case you are currently in Safe Mode.
This will enable you to install and use SpyHunter 5 successfully.
Step 4: Boot Your PC In Safe Mode to isolate and remove WannaCry
Step 5: Try to Restore Files Encrypted by WannaCry.
Method 1: Use STOP Decrypter by Emsisoft.
Not all variants of this ransomware can be decrypted for free, but we have added the decryptor used by researchers that is often updated with the variants which become eventually decrypted. You can try and decrypt your files using the instructions below, but if they do not work, then unfortunately your variant of the ransomware virus is not decryptable.
Follow the instructions below to use the Emsisoft decrypter and decrypt your files for free. You can download the Emsisoft decryption tool linked here and then follow the steps provided below:
1 Right-click on the decrypter and click on Run as Administrator as shown below:
2. Agree with the license terms:
3. Click on "Add Folder" and then add the folders where you want files decrypted as shown underneath:
4. Click on "Decrypt" and wait for your files to be decoded.
Note: Credit for the decryptor goes to Emsisoft researchers who have made the breakthrough with this virus.
Method 2: Use data recovery software
Ransomware infections and WannaCry aim to encrypt your files using an encryption algorithm which may be very difficult to decrypt. This is why we have suggested a data recovery method that may help you go around direct decryption and try to restore your files. Bear in mind that this method may not be 100% effective but may also help you a little or a lot in different situations.
Simply click on the link and on the website menus on the top, choose Data Recovery - Data Recovery Wizard for Windows or Mac (depending on your OS), and then download and run the tool.
WannaCry-FAQ
What is WannaCry Ransomware?
WannaCry is a ransomware infection - the malicious software that enters your computer silently and blocks either access to the computer itself or encrypt your files.
Many ransomware viruses use sophisticated encryption algorithms to make your files inaccessible. The goal of ransomware infections is to demand that you pay a ransom payment to get access to your files back.
What Does WannaCry Ransomware Do?
Ransomware in general is a malicious software that is designed to block access to your computer or files until a ransom is paid.
Ransomware viruses can also damage your system, corrupt data and delete files, resulting in the permanent loss of important files.
How Does WannaCry Infect?
Via several ways.WannaCry Ransomware infects computers by being sent via phishing emails, containing virus attachment. This attachment is usually masked as an important document, like an invoice, bank document or even a plane ticket and it looks very convincing to users.
Another way you may become a victim of WannaCry is if you download a fake installer, crack or patch from a low reputation website or if you click on a virus link. Many users report getting a ransomware infection by downloading torrents.
How to Open .WannaCry files?
You can't without a decryptor. At this point, the .WannaCry files are encrypted. You can only open them once they are decrypted using a specific decryption key for the particular algorithm.
What to Do If a Decryptor Does Not Work?
Do not panic, and backup the files. If a decryptor did not decrypt your .WannaCry files successfully, then do not despair, because this virus is still new.
Can I Restore ".WannaCry" Files?
Yes, sometimes files can be restored. We have suggested several file recovery methods that could work if you want to restore .WannaCry files.
These methods are in no way 100% guaranteed that you will be able to get your files back. But if you have a backup, your chances of success are much greater.
How To Get Rid of WannaCry Virus?
The safest way and the most efficient one for the removal of this ransomware infection is the use a professional anti-malware program.
It will scan for and locate WannaCry ransomware and then remove it without causing any additional harm to your important .WannaCry files.
Can I Report Ransomware to Authorities?
In case your computer got infected with a ransomware infection, you can report it to the local Police departments. It can help authorities worldwide track and determine the perpetrators behind the virus that has infected your computer.
Below, we have prepared a list with government websites, where you can file a report in case you are a victim of a cybercrime:
Cyber-security authorities, responsible for handling ransomware attack reports in different regions all over the world:
Germany - Offizielles Portal der deutschen Polizei
United States - IC3 Internet Crime Complaint Centre
United Kingdom - Action Fraud Police
France - Ministère de l'Intérieur
Italy - Polizia Di Stato
Spain - Policía Nacional
Netherlands - Politie
Poland - Policja
Portugal - Polícia Judiciária
Greece - Cyber Crime Unit (Hellenic Police)
India - Mumbai Police - CyberCrime Investigation Cell
Australia - Australian High Tech Crime Center
Reports may be responded to in different timeframes, depending on your local authorities.
Can You Stop Ransomware from Encrypting Your Files?
Yes, you can prevent ransomware. The best way to do this is to ensure your computer system is updated with the latest security patches, use a reputable anti-malware program and firewall, backup your important files frequently, and avoid clicking on malicious links or downloading unknown files.
Can WannaCry Ransomware Steal Your Data?
Yes, in most cases ransomware will steal your information. It is a form of malware that steals data from a user's computer, encrypts it, and then demands a ransom in order to decrypt it.
In many cases, the malware authors or attackers will threaten to delete the data or publish it online unless the ransom is paid.
Can Ransomware Infect WiFi?
Yes, ransomware can infect WiFi networks, as malicious actors can use it to gain control of the network, steal confidential data, and lock out users. If a ransomware attack is successful, it could lead to a loss of service and/or data, and in some cases, financial losses.
Should I Pay Ransomware?
No, you should not pay ransomware extortionists. Paying them only encourages criminals and does not guarantee that the files or data will be restored. The better approach is to have a secure backup of important data and be vigilant about security in the first place.
What Happens If I Don't Pay Ransom?
If you don't pay the ransom, the hackers may still have access to your computer, data, or files and may continue to threaten to expose or delete them, or even use them to commit cybercrimes. In some cases, they may even continue to demand additional ransom payments.
Can a Ransomware Attack Be Detected?
Yes, ransomware can be detected. Anti-malware software and other advanced security tools can detect ransomware and alert the user when it is present on a machine.
It is important to stay up-to-date on the latest security measures and to keep security software updated to ensure ransomware can be detected and prevented.
Do Ransomware Criminals Get Caught?
Yes, ransomware criminals do get caught. Law enforcement agencies, such as the FBI, Interpol and others have been successful in tracking down and prosecuting ransomware criminals in the US and other countries. As ransomware threats continue to increase, so does the enforcement activity.
About the WannaCry Research
The content we publish on SensorsTechForum.com, this WannaCry how-to removal guide included, is the outcome of extensive research, hard work and our team’s devotion to help you remove the specific malware and restore your encrypted files.
How did we conduct the research on this ransomware?
Our research is based on an independent investigation. We are in contact with independent security researchers, and as such, we receive daily updates on the latest malware and ransomware definitions.
Furthermore, the research behind the WannaCry ransomware threat is backed with VirusTotal and the NoMoreRansom project.
To better understand the ransomware threat, please refer to the following articles which provide knowledgeable details.
As a site that has been dedicated to providing free removal instructions for ransomware and malware since 2014, SensorsTechForum’s recommendation is to only pay attention to trustworthy sources.
How to recognize trustworthy sources:
- Always check "About Us" web page.
- Profile of the content creator.
- Make sure that real people are behind the site and not fake names and profiles.
- Verify Facebook, LinkedIn and Twitter personal profiles.
Sinffer won’t help if the malware is using asymmetric keys for Encrypt/Decrypt.
first, u need to place your prompt on the files container folder, second… i don’t mind if commas are really needed.
share your experience!
basically, to activate python you need to place the software and the
programs in the Home folder if you are about to type the command this
way : )
also, i’ll have you know that the script in this article was originally designed for other viruses using the same RSA combination, meaning the decrypt.py script is designed for RSA only. Then this key can be used to try and decrypt the AES files somehow. If you get the key, please respond back and we will try to assist the best way we can.
PS: Google .decrypt.py scripts for python for decryption, there are a lot of scripts for different RSA strenghts. The RSA encryption used by this virus is in 2048 bit strenght which is unfortunately, the strongest stable
Hi
Thanks your article is excellent!
I have tried to reproduce the Method 1 of your article but unfortunately I have only the encryption piece of the ransom or a variant. Would you mind to share it in some way I can test it? (I dont know how/where to contact you so I am posting here..) many thanks