Security researchers from antivirus vendor Kaspersky Labs have found evidence that the development teams behind the Flame and Stuxnet cyberespionage threats collaborated with each other.

The Kaspersky researchers determined that Flame, which is believed to have been created in 2008, and a 2009-version of Stuxnet shared one component that served the same purpose and had similar source code.

Back in October 2010, Kaspersky's researchers analyzed a sample that had been automatically classified as a Stuxnet variant by the company's automated systems. At the time, the researchers dismissed the detection as an error because the sample's code looked nothing like the code in Stuxnet.

However, after Flame was discovered at the end of May, the Kaspersky researchers searched their database for malware samples that might be related to the new threat and found that the sample detected as Stuxnet in 2010 was actually a Flame module. The module uses an autorun.inf trick to infect computers via USB drives.

Upon further research, the Kaspersky analysts determined that Stuxnet.A, which was created in early 2009, uses the same autorun.inf trick to spread via USB drives. In fact, the source code responsible for this is almost identical to the one in the Flame module.

"It looks like the Flame platform was used to kick start the Stuxnet platform," said Roel Schouwenberg, a senior researcher with Kaspersky Lab's global research and analysis team, during a conference call with the press.

Same Flaw Targeted

The Kaspersky researchers already knew that Stuxnet and Flame leveraged the same EoP vulnerability, but this wasn't conclusive proof that their developers collaborated. The exploit could have been created by a third-party that sold it to both teams, Schouwenberg said.

However, the new discovery suggests that the developers of the two malware threats actually shared source code, which is intellectual property and wouldn't normally be shared between unrelated teams. "We are now 100-percent sure that the Flame and Stuxnet groups worked together," Schouwenberg said.

The Kaspersky researchers discovered that the Flame module integrated into Stuxnet.A exploited a Windows elevation of privilege (EoP) vulnerability that wasn't known at the time of the malware's creation. This would be the fifth zero-day (previously unknown) vulnerability exploited by Stuxnet, Schouwenberg said.

The researchers believe that this vulnerability was one that Microsoft patched in June 2009, a few months after the creation of Stuxnet.A, but they are not yet certain and are still investigating.

Later Stuxnet versions stopped using the Flame module entirely and began exploiting a separate vulnerability that relied on malformed LNK (shortcut) files to propagate via USB drives.

Interestingly, the exploit code from Stuxnet.A's Flame-borrowed module is very similar to the exploit code for a different EoP vulnerability that's present in later Stuxnet versions. The researchers believe that both sections of code were written by the same programmer.

Same Source, Different Purposes

When Microsoft patched the EoP vulnerability in 2009 -- a few months after the creation of Stuxnet.A -- the Stuxnet developers stopped using the Flame module for propagation and began exploiting a new vulnerability, which relied on malformed LNK (shortcut) files.

The theory put forward by the Kaspersky researchers is that Flame and Stuxnet were created by two separate teams as part of two operations funded by the same nation state. Flame was probably used for espionage and Stuxnet used for sabotage, Schouwenberg said.

According to a recent New York Times report that quotes anonymous sources from the Obama administration, Stuxnet was created by the U.S. and Israeli governments as part of a secret operation called Olympic Games with the goal of crippling Iran's ability to produce weapon-grade nuclear fuel.

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