So is North Korea seeking to boost its foreign currency reserves? Or is someone else conducting a false flag operation -- or just reusing old code?

The link between two pieces of malware used in attacks on Bangalore Bank and on a commercial bank in Vietnam is unambiguous. Shevchenko and Nish decompiled them and found that they used an identical function to wipe a file from an infected computer. The function first fills the file with random characters to ensure nothing can be recovered from the sectors it occupies on the disk, then changes the file's name to a random string before deleting it.

Intrigued by the thoroughness with which the malware pursued its purpose, the two hunted through an online malware database for other examples of the same file-wiping code.

They found one in a file called msoutc.exe, compiled on Oct. 24, 2014 and uploaded to the database by someone in the U.S. on March 4, 2016.

That executable begins its evil work by attempting to create a mutex, or lock flag, with the name "Global\FwtSqmSession106839323_S-1-5-20" to prevent multiple copies of the malware running on the same computer.

If the flag already exists, meaning another copy of the malware is already running, the new copy commits suicide by running a script to delete itself from the system, then quits, leaving the first copy intact.

Otherwise, it carries on, creating a log file and using the key "y@s!11yid60u7f!07ou74n001" to encrypt it.

The BAE researchers dug around, and found that key had already been used in a worm that spread through Windows SMB shares, discovered by PwC in 2015, although its mutex was slightly different. SMB is a Windows protocol used for sharing directories and printers.

The mutex in the worm found by PwC, in turn, was identical to one mentioned in a December 2014 US-CERT report on targeted destructive malware used to attack "a major entertainment company" widely believed to be Sony Pictures. The SMB worm described by US-CERT, however, had a different (although similar) encryption key.

To cap it all, Shevchenko and Nish found that the suicide script used by msoutc.exe was almost identical to scripts reported by analytics company Novetta as being characteristic of malware developed by the Lazarus Group. That's the group Novetta blamed for the Sony attack in its report "Operation Blockbuster."

So that's two banks attacked with malware containing a file deletion function identical to that used in a piece of malware called msoutc.exe. And there are strong similarities between the suicide script, encryption keys and mutex names used by msoutc.exe and those used by malware involved in the Sony attack.

It's still anybody's guess who's behind all these attacks: in Bangladesh, government officials are pointing the finger at SWIFT technicians who worked on the central bank's network last year, while the FBI says that attack was an inside job -- but blames the North Koreans for Sony.

Despite the connections between the attacks highlighted by Shevchenko and Nish, there's still a chance that someone else is as handy with the decompiler as they are, and reused the code -- and chose similar encryption keys -- to leave a false trail.

But the chances of that, the BAE researchers said, are slim.

"The overlaps between these samples provide strong links for the same coder being behind the recent bank heist cases and a wider known campaign stretching back almost a decade," they concluded.

To comment on this article and other PCWorld content, visit our Facebook page or our Twitter feed.