Recent reports of electricity outages across the Ukraine has led to significant speculation regarding the specific malware that was used to disrupt supplies. McAfee’s approach in understanding this event included making contact with the impacted organization to offer our support and, where possible, retrieving data in order to analyze the true nature of the threat. In this case the impacted organization allowed us to publicly share our findings to benefit the entire industry. Researchers from the Advanced Programs Group (APG) team within mcAfee were able to analyze multiple samples that were used in an attack, raising questions regarding the role of BlackEnergy in disrupting the supply of electricity. We would also like to acknowledge the support we were provided in the technical investigation of our partner BAKOTECH Group.
This post builds upon our initial blog posting that detailed the historical evolution of BlackEnergy.
It begins with a phish
Our malware “zoo” within McAfee Labs contains a wealth of data that can be used to identify the reuse of tools in a particular attack. In this instance we cross-referenced the initial dropper and collected samples that were used by infected systems. This was absolutely necessary because the criminal infrastructure used to host the second malware instance was offline when our analysis began. As we began, we identified a number of similarities with previous campaigns that targeted the energy sector.
In March 2015, an email appearing to be from the Supreme Council of Ukraine (Verkhovna Rada of Ukraine) was sent to multiple state institutions in the country. One of the targets in this campaign was a power company situated in the western part of the Ukraine. The spear-phishing email contained an XLS attachment with a macro in it.
Once the document was opened, a macro was executed, the BlackEnergy dropper was created, and the dropper started to download the final BlackEnergy 2/3 version.
One of the interesting email artifacts was a part of the SMTP header that pointed into an IP address and name of the mail server used to spread the spear-phishing emails.
We received information that, once the attackers were in the network, they compromised a web server and used it as a beachhead for entering a segment of the company’s network. The attackers were using tools that are freely available on the Internet for download, including web shells, tunneling tools, and SSH server tools.
If we compare the previous attack with the BlackEnergy attack on the grid reported in December, we can recognize a number of similarities. First, the attack vector is exactly the same, namely a spear-phishing campaign. An example of the content of the email follows:
The attachment was a weaponized Excel worksheet containing a dropper. Once launched, the payload was downloaded from a site hosted in the Ukraine.
We investigated the SMTP headers in this case and found that the attack in December leveraged a mail server with the same IP address and name as a server used in the previously described campaign in March. The energy sector was one of the targets in both campaigns.
Besides these files, we received also a package of suspicious files for analysis. These files were part of a web template system called Synio. The Synio template is part of the LiveStreet Content Management System (CMS). Livestreet is a Russian site that allows for the free download of engines for blogging and social networking. We do not know whether these files were related to the spear-phishing campaign or part of lateral movement. However, we noticed references to the Synio template being used on the server that hosted the payload for the dropper: “8080/templates/compiled/synio/…” One of the files in the templates was definitely not part of normal content management.
After analysis of this php file, we determined that it was a php web shell.
These WSO web shells are often used after compromising a server to maintain access. They usually support multiple modules with a variety of features. In this case the shell included the following modules:
- SQL Manager
- Support for Windows and Linux OS
- Server information
- File manager
- Editing, modifying files
- SQL console
- PHP console
- Network analysis tools
Access to the web shell was secured with an easy-to-crack MD5 password.
One interesting feature was the “search for hash option”—in which discovered hashes could be sent to certain sites that might have cracked the value for these hashes:
For both the March and December attacks, there are some similarities:
- Spear phishing using weaponized Office documents.
- Email sender is using a valid “info” addressee in the Ukraine.
- Same mail provider and server used.
- The usage of common backdoor tools.
- Sophistication of attacks was low.
The use of BlackEnergy for espionage is not new, but prior to the December attack, there has been no evidence that prior campaigns used BlackEnergy for more than stealing confidential information from a victim organization. Although the latest attack included a wiper component, we did not find any evidence that this malware specifically targeted SCADA systems. Therefore, it appears unlikely that the BlackEnergy malware was the direct cause of the outage. It is unclear if a single actor both controlled BlackEnergy and also issued a coordinated shutdown of the electrical system.
Meanwhile, the spear-phishing campaigns in Ukraine appear to have continued into January 2016, using Word documents instead of Excel. Although our information does not yet point to a clear cause, additional details are emerging and our analysis is ongoing. We have greater confidence that the follow-up phishes were from the same group, than that this group was responsible for the availability disruption. Not only does this attack show the same modus operandi but is more aligned with the level of technical sophistication that we have seen with BlackEnergy. We are continuing our analysis as we receive more samples and will provide more detail in due course.