Shamoon Code 'Amateur' But Effective

Researchers drill down into Shamoon targeted malware and conclude it wasn't written by programmers as seasoned as those who created Stuxnet, Duqu, Flame

Dark Reading logo in a gray background | Dark Reading

The data-destroying malware Shamoon -- which has been tied to the recent attacks on Saudi Aramco that took down 30,000 workstations at the massive oil company and possibly other Middle East targets -- contains some sloppy code riddled with errors, new research shows.

Shamoon was first revealed by Symantec last month as a destructive targeted attacked aimed at a Middle East energy firm in the wake of reports that Saudi Aramco had been hit by a massive malware attack. Neither Symantec, Kaspersky Lab, AlienVault, nor Saudi Aramco will officially confirm that Shamoon was indeed the attack on Saudi Aramco, but one industry source with knowledge of the attacks told Dark Reading it was.

What set Shamoon apart from other targeted attacks was its main goal: total annihilation of data, rather than spying or stealing information. It basically wipes files and data, and cripples the infected machine. Liam O Murchu, manager of North American operations for Symantec Security Technology & Response, said last month that this brand of malicious attack hadn't been seen in 10 years, with the exception of the recent attack on the Iranian oil ministry.

Researchers at Kaspersky Lab and AlienVault Labs have picked apart Shamoon and found that it's not the same caliber of code as Stuxnet or Flame. The authors appear to be amateurs -- determined ones at that -- who may have political hacktivist motives, thanks to the discovery of a partially obscured photo of a burning American flag used to hide some of the code.

"We've got other clues that people behind creating the Shamoon malware are not high-profile programmers, and the nature of their mistakes suggests that they are amateurs, albeit skillful amateurs, as they did create a quite practicable piece of self-replicating destructive malware," says Dmitry Tarakanov, Kaspersky Lab Expert, in a new blog post today.

Jaime Blasco, manager of AlienVault Labs, says that, overall, the code is rudimentary. "From a technical point of view, the code is quite simple," Blasco says. But whether the writers were amateurs or pros all depends on how you define a professional malware operation. "Of course, [Shamoon] is not close to the complexity of Stuxnet, Duqu, or Flame, but I've seen other targeted attacks using less complex malware than Shamoon. Sometimes the attackers just want to accomplish the objective, so they don't require complex code, just the code that works for the target," he says. "And in the case of Shamoon, it seems it was able to accomplish the mission."

The most sophisticated part of the code: how the attackers employed a legitimate, digitally signed driver inside. "The only part of the system that can be mentioned is that they used a benign third-party driver -- signed -- to overwrite the files on the systems," Blasco says. That driver was signed by EldoS Corp., which provides security-related software components for software developers and the corporate market.

Among the errors in the code pinpointed by Kaspersky Lab was in Shamoon's communication module, which included a typo in the format string of the code that precludes the malware from executing other programs. "This shows at least lack of testing," Kaspersky's Tarakanov told Dark Reading.

Another error he found was a flawed dates-comparison routine, he says. "[An] experienced programmer would be ashamed [of] himself to leave the comparison code in that state as it has been done in Shamoon. There are additional conditions which cover special cases, but don't resolve the task fully. It was visible that author tried to accomplish that mission, but failed and stopped when it worked in [a] special case," he says.

The coding errors could mean lack of experience or inattention indicative of a younger coder, he says.

The fragment of a photo of a burning U.S. flag was used to overwrite the content of the files on the infected machines, says Blasco, whose firm also released new information on the malware (PDF) this month. "This can be interpreted as a message if it is confirmed that Islamic groups are behind the attack. Three different hacking groups have claimed responsibility of the attack," including the Arab Youth Group and the Cutting Sword of Justice, he says.

Kaspersky's Tarakanov concurs. "The fact that they used a picture of a fragment of a burning U.S. flag possibly shows that the motive of Shamoon's authors is to create and use malware in a politically driven way. Moreover, they wished that their protest, which was embedded into the malware, would not go unnoticed," Tarakanov says.

But the fragmented photo of the flag could also have been "just for trolling," he told Dark Reading.

And Shamoon was no Wiper, the targeted malware aimed at taking down machines in Iranian businesses, according to Kaspersky Lab. "By all appearances, the Shamoon author/s encountered the same issue like The Wiper authors. In the modern world, it's time-consuming to fill an entire disk even with fixed data. To have the wiping done a bit quicker but efficiently, it is not necessary to wipe all the data but to rewrite parts dispersively throughout the disk. The Wiper authors completed this task fairly smartly, whereas in Shamoon it's done rather crudely," Tarakanov wrote.

[ Oil company's revelation matches counts by hackers claiming responsibility and Shamoon connection. See 30,000 Machines Infected In Targeted Attack On Saudi Aramco. ]

Meanwhile, Saudi Aramco yesterday released a press statement that its network is back up and running after the massive virus attack it suffered last month, and that the company has beefed up its network security systems as well as other security features in its environment. Saudi Aramco also repeated its previous comment that none of its oil and gas operations were interrupted or affected by the virus.

"The virus, which only affected personal workstations in the company, had no significant impact on the company's administrative operations or the productivity of its employees. This was achieved through restoring the affected workstations in a fast and effective manner and in time for employees returning to work after the 'Id holiday. Internal email services were also restored in a timely manner by the company's experts," the statement said.

Have a comment on this story? Please click "Add Your Comment" below. If you'd like to contact Dark Reading's editors directly, send us a message.

About the Author

Kelly Jackson Higgins, Editor-in-Chief, Dark Reading

Kelly Jackson Higgins is the Editor-in-Chief of Dark Reading. She is an award-winning veteran technology and business journalist with more than two decades of experience in reporting and editing for various publications, including Network Computing, Secure Enterprise Magazine, Virginia Business magazine, and other major media properties. Jackson Higgins was recently selected as one of the Top 10 Cybersecurity Journalists in the US, and named as one of Folio's 2019 Top Women in Media. She began her career as a sports writer in the Washington, DC metropolitan area, and earned her BA at William & Mary. Follow her on Twitter @kjhiggins.

Keep up with the latest cybersecurity threats, newly discovered vulnerabilities, data breach information, and emerging trends. Delivered daily or weekly right to your email inbox.

You May Also Like


More Insights