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

“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

Craig Wright Sentenced For Contempt Of Court

Suspended prison sentence for Craig Wright for “flagrant breach” of court order, after his false…

2 days ago

El Salvador To Sell Or Discontinue Bitcoin Wallet, After IMF Deal

Cash-strapped south American country agrees to sell or discontinue its national Bitcoin wallet after signing…

2 days ago

UK’s ICO Labels Google ‘Irresponsible’ For Tracking Change

Google's change will allow advertisers to track customers' digital “fingerprints”, but UK data protection watchdog…

2 days ago

EU Publishes iOS Interoperability Plans

European Commission publishes preliminary instructions to Apple on how to open up iOS to rivals,…

3 days ago

Momeni Convicted In Bob Lee Murder

San Francisco jury finds Nima Momeni guilty of second-degree murder of Cash App founder Bob…

3 days ago