Kaspersky Labs Identifies Mistakes In WannaCry That Can Be Exploited To Retrieve Data

WannaCry ransomware contains mistakes in its code that allow savvy IT workers and programmers to restore filed after a computer has been infected.

Cyber security firm Kaspersky Labs dug into the code of the ransomware that has wreaked havoc on a global scale, notably with NHS hospitals in the UK, and found that in some cases encrypted filed are deleted but can be recovered with data recovery software.

“If you were infected with WannaCry ransomware there is a good possibility that you will be able to restore a lot of the files on the affected computer. To restore files, you can use the free utilities available for file recovery,” Kaspersky Lab researchers explained.

WannaCry mistakes

WannaCry“If the file is in an ‘important’ folder (from the malware developers’ point of view – e.g. Desktop and Documents), then the original file will be overwritten with random data before removal. In this case, unfortunately, there is no way to restore the original file content,” the researchers noted for files located on a computer’s system drives.

“If the file is stored outside of ‘important’ folders, then the original file will be moved to %TEMP%\%d.WNCRYT (where %d denotes a numeric value). These files contain the original data and are not overwritten, they are simply deleted from the disk, which means there is a high chance it will be possible to restore them using data recovery software.”

For files located on other non-system drives, it would appear that getting around WannaCry is a matter of finding a hidden folder.

“Ransomware creates the “$RECYCLE” folder and sets hidden+system attributes to this folder. This makes this folder invisible in Windows File Explorer if it has a default configuration. The malware intends to move the original files into this directory after encryption,” the researchers wrote.

“However, because of synchronization errors in the ransomware code in many cases the original files stay in the same directory and are not moved into $RECYCLE. The original files are deleted in an unsecure way. This fact makes it possible to restore the deleted files using data recovery software.”

And the mistakes continue with ‘read-only’ files: “While analysing WannaCry, we also discovered that this ransomware has a bug in its read-only file processing.

“If there are such files on the infected machine, then the ransomware won’t encrypt them at all. It will only create an encrypted copy of each original file, while the original files themselves only get the ‘hidden’ attribute. When this happens, it is simple to find them and restore their normal attributes.”

So it would appear that people with the requisite skills and armed with this knowledge could overcome a WannaCry infection.

However, there is an argument to be had that they should have avoided being infected in the first place by having up-to-date systems and computers; though in a world where budgets are often thin, this is easier said than done.

Do you know all about security in 2017? Try our quiz!

Roland Moore-Colyer

As News Editor of Silicon UK, Roland keeps a keen eye on the daily tech news coverage for the site, while also focusing on stories around cyber security, public sector IT, innovation, AI, and gadgets.

Recent Posts

Tesla Recalls 46,000 Cybertrucks Over ‘Crash Risk’ Faulty Trim

All Cybertrucks manufactured between November 2023 and February 2025 recalled over trim that can fall…

23 hours ago

Elon Musk Issued Summons By SEC Over Failure To Disclose Twitter Stake

As Musk guts US federal agencies, SEC issues summons over Elon's failure to disclose ownership…

1 day ago

Alphabet Spins Out Taara To Challenge Musk’s Starlink

Moonshot project Taara spun out of Google, uses lasers and not satellites to provide internet…

1 day ago

Pebble Creator Debuts New Watches As ‘Labour Of Love’

Pebble creator launches two new PebbleOS-based smartwatches with 30-day battery life, e-ink screens after OS…

2 days ago

Amazon Loses Appeal To Record EU Privacy Fine

Amazon loses appeal in Luxembourg's administrative court over 746m euro GDPR fine related to use…

2 days ago

Nvidia, xAI Join BlackRock AI Infrastructure Project

Nvidia, xAI to participate in project backed by BlackRock, Microsoft to invest $100bn in AI…

2 days ago