Shamoon


Shamoon, also known as W32.DistTrack, is a modular computer virus that was discovered in 2012, targeting then-recent 32-bit NT kernel versions of Microsoft Windows. The virus was notable due to the destructive nature of the attack and the cost of recovery. Shamoon can spread from an infected machine to other computers on the network. Once a system is infected, the virus continues to compile a list of files from specific locations on the system, upload them to the attacker, and erase them. Finally the virus overwrites the master boot record of the infected computer, making it unusable.
The virus was used for cyberwarfare against national oil companies including Saudi Arabia's Saudi Aramco and Qatar's RasGas. A group named "Cutting Sword of Justice" claimed responsibility for an attack on 35,000 Saudi Aramco workstations, causing the company to spend more than a week restoring their services. The group later indicated that the Shamoon virus had been used in the attack. Computer systems at RasGas were also knocked offline by an unidentified computer virus, with some security experts attributing the damage to Shamoon. It was later described as the "biggest hack in history."
Symantec, Kaspersky Lab, and Seculert announced discovery of the malware on 16 August 2012. Kaspersky Lab and Seculert found similarities between Shamoon and the Flame malware. Shamoon made a surprise comeback in November 2016 according to Symantec, and it was involved in a new attack on 23 January 2017.

Design

Shamoon was designed to erase and overwrite hard drive data with a corrupted image and report the addresses of infected computers back to the computer inside the company's network. The malware had a logic bomb which triggered the master boot record and data wiping payload at 11:08am local time on Wednesday, August, 15. The attack occurred during the month of Ramadan in 2012. It would appear that the attack was timed to occur after most staff had gone on holiday reducing the chance of discovery before maximum damage could be caused, hampering recovery.
The virus consisted of three components, the Dropper, the Wiper and the Reporter. The Dropper, the source of the infection, creates a service with the name 'NtsSrv' that enables it to remain persistent on the infected computer. The Dropper was built in 32-bit and 64-bit versions. If the 32-bit dropper detects a 64-bit architecture, it drops the 64-bit version. This component drops the Wiper and the Reporter onto the infected computer and executes itself. It spreads across a local network by copying itself to network shares and on to other computers.
The Wiper component utilizes an Eldos-produced driver known as RawDisk to achieve direct user-mode access to a hard drive without using Windows APIs. It identifies the locations of all files on the infected computers and erases them. It sends information about the files destroyed to the attacker and then overwrites the erased files with corrupted data so they cannot be recovered. The component used portions of an image. In the 2012 attack it used an image of a burning U.S. flag; in the 2016 attack it used a photo of the body of Alan Kurdi.

Before the attack

The malware was unique, used to target the Saudi government by causing destruction to the state owned national oil company Saudi Aramco. The attackers posted a pastie on PasteBin.com hours prior to the wiper logic bomb occurring, citing oppression and the Al-Saud regime as a reason behind the attack. According to Chris Kubecka, a security advisor to Saudi Aramco after the attack and group leader of security for Aramco Overseas, the attack was well-staged. It was initiated by a phishing email attack that an unnamed Saudi Aramco Information Technology employee opened, giving the group entry into the company's network around mid-2012.
Kubecka described in a Black Hat USA talk that Saudi Aramco placed the majority of their security budget on the ICS control network, leaving the business network at risk for a major incident.

During the attack

On 15 August at 11:08 am local time, over 30,000 Windows based systems began to be overwritten. Symantec found some of the affected systems showed an image of an American flag while their data was being deleted and overwritten. Saudi Aramco announced the attack on their Facebook page and went offline again until a company statement was issued on 25 August 2012. The statement falsely reported normal business was resumed on 25 August 2012. However a Middle Eastern journalist leaked photographs taken on 1 September 2012 showing kilometers of petrol trucks unable to be loaded due to backed business systems still inoperable.
"Saudi Aramco has restored all its main internal network services that were impacted on August 15, 2012, by a malicious virus that originated from external sources and affected about 30,000 workstations. The workstations have since been cleaned and restored to service. As a precaution, remote Internet access to online resources was restricted. Saudi Aramco employees returned to work August 25, 2012, following the Eid holidays, resuming normal business. The company confirmed that its primary enterprise systems of hydrocarbon exploration and production were unaffected as they operate on isolated network systems. Production plants were also fully operational as these control systems are also isolated."
On August 29, 2012 the same attackers behind Shamoon posted another pastie on PasteBin.com, taunting Saudi Aramco with proof they still retained access to the company network. The post contained the username and password on security and network equipment and the new password for Aramco CEO Khalid Al-Falih The attackers also referenced a portion of the Shamoon malware as further proof in the pastie:
According to Kubecka, in order to restore operations, Saudi Aramco used its large private fleet of aircraft and available funds to purchase much of the world's hard drives, driving the price up. New hard drives were required as quickly as possible so oil prices were not affected by speculation. By September 1, 2012 gasoline resources were dwindling for the public of Saudi Arabia 17 days after the August 15th attack. RasGas was also affected by a different variant, crippling them in a similar manner.
It is unclear why the attacker may have an interest in actually destroying the infected PC. Kaspersky Labs hinted that the 900 KB malware could be related to Wiper, that was used in a cyber attack on Iran in April. After a 2-day analysis, the company erroneously concluded that the malware is more likely to come from "scriptkiddies" who were inspired by Wiper. Later, in a blog post, Eugene Kaspersky clarified the use of Shamoon categorizing as cyberwarfare.