# eSentire Threat Intelligence Malware Analysis: DoubleZero **[esentire.com/blog/esentire-threat-intelligence-malware-analysis-doublezero](https://www.esentire.com/blog/esentire-threat-intelligence-malware-analysis-doublezero)** DoubleZero is a newly emerging destructive malware targeting Ukrainian enterprises. The initial access vector is unknown, but eSentire Threat Intelligence assesses with medium confidence that the threat actor(s) was able to gain access to the infected machine(s) and escalate, or use, the existing administrative privileges to manually execute the malware. As the Russia-Ukraine crisis continues, we assess that destructive malware will continue to be actively deployed to disrupt the operations of Ukrainian infrastructure. **Key Takeaways:** DoubleZero is the fifth wiper malware targeting Ukrainian organizations (previously we have observed WhisperGate, HermeticWiper, IsaacWiper and CaddyWiper samples). The malware destroys the components responsible for Windows boot process and overwrites the files will null bytes. The compilation timestamp was changed by the threat actor(s) to confuse the researchers and make it harder to evaluate how long ago the malware sample was written. To achieve the full-scale disruption, the threat actor(s) would need to escalate their privileges or bypass the user account control (UAC) to fully compromise the system. eSentire Threat Intelligence team has observed that the malware fails to run on Windows Servers. ----- ## Case Study On March 22, 2022, the Computer Emergency Response Team of Ukraine (CERT-UA) released an advisory warning about the destructive DoubleZero malware found on March 17, 2022. The malicious activity is tracked under UAC-0088 and aimed to disrupt the operations of Ukrainian organizations. ## DoubleZero Analysis The ZIP archives are named “Вирус... крайне опасно!!!.zip” which means “Virus…extremely _dangerous!!!.zip” and csrss.zip. The archives contain two files:_ cpcrs.exe csrss.exe The 32-bit executables are compiled with .NET and both executables have the same impash, or import hash, 2916dda3c80b39a540b60c072a91a915 (the hash that is calculated based on the library/APIs used and their order within the executable file). It means that both files have the same functionality. The compilation timestamp dates to May 28, 2071, which is not valid. ### Obfuscation The .NET malware sample appears to be highly obfuscated (Exhibit 1). _Exhibit 1: Initial obfuscated .NET sample_ After the first round of de-obfuscation, we discovered that DoubleZero implements AES (block size 128-bit) encryption in EBC mode with PKCS padding, control flow and switch statements for additional code obfuscation as shown in Exhibit 2. ----- _Exhibit 2: Obfuscation algorithm_ ### Enumeration The sample enumerates the HKEY_CURRENT_USER, HKEY_USERS, _HKEY_LOCAL_MACHINE registry keys including HKEY_LOCAL_MACHINE\BCD00000000_ (the key contains the boot configuration data that is required to boot up the Windows system) and subkeys using GetSubKeyNames, Registry.LocalMachine and Registry.CurrentUser properties to remove them later. The malware also enumerates on the paths listed in Exhibit 3 using Regex to match as few characters as possible with (.*?), also known as lazy mode, and “.*” to match any character except for line terminators. **The paths queried:** _\\Users\\\\.*?\\\\Local Settings.*_ _\\Users\\\\.*?\\\\AppData\\\\Local\\\\Application Data.*_ _\\Users\\\\.*?\\\\Start Menu.*_ _\\Users\\\\.*?\\\\Application Data.*_ _\\ProgramData\\\\Microsoft.*_ _\\Users\\\\.*?\\\\AppData\\\\Local\\\\Microsoft.*_ _\\Users\\\\.*?\\\\AppData\\\\Roaming\\\\Microsoft.*_ ----- _Exhibit 3: Enumerating the folders using regex_ The following folders get concatenated together forming a path (Exhibit 4): _ProgramFiles(x86)\Documents and Settings_ _ProgramFiles(x86)\ProgramData\Application Data_ _ProgramFiles(x86)\Users\All Users_ _ProgramFiles(x86)\Users\Default User_ _Exhibit 4: Folder concatenation_ It is notable that the sample also enumerates through drivers (Exhibit 4) and _C:\Windows\NTDS path. The NTDS file contains a database that stores Active Directory data,_ including information groups, group membership and user objects. It also includes the password hashes for all users in the domain. eSentire Threat Intelligence team observed that the malware does not run on the Windows Server. ----- The malware gets the root drive of the infected device and Operating System information using _Environment.SystemDirectory and Environment.OSVersion properties (Exhibit 5)._ _Exhibit 5: Enumerating system directory and OS version_ DoubleZero attempts to get all logical drives on the infected computers (Exhibits 6-7). _Exhibit 6: GetLogicalDrives gets a bitmask representing the currently available disk drives_ _Exhibit 7: Checks if the drive name is valid_ ----- Three DLLs (Dynamic Link Library) will be used in this sample (Exhibit 8): ntdll.dll kernel32.dll user32.dll _Exhibit 8: DLLs used in DoubleZero_ In Exhibit 9, the variables highlighted in orange are some of the API calls available for use by DoubleZero: **NtOpenFile: this function opens an existing file, directory, device or volume then returns** a handle for the file object. **NtFsControlFile: sends a control code to the specified file system or driver to perform** specific action. **RtlNtStatusToDosError: returns the system error code.** **RtlAdjustPrivilege: disables or enables a privilege from the calling thread or process.** **[CloseHandle: closes handles to objects mention in Microsoft MSDN.](https://docs.microsoft.com/en-us/windows/win32/api/handleapi/nf-handleapi-closehandle)** **GetFileSizeEx: gets the size of a file.** **GetLastError: receives the calling thread's last-error code value.** **ExitWindowsEx: logs interactive user off, shuts down the system, or shuts down and** restarts the system. ----- _Exhibit 9: API calls via the appropriate DLLs_ In addition to the API calls, the malware attempts to set the appropriate access control or full access rights to the following files to fill them with zeroes (Exhibit 10): BOOTMGR (boot manager) including BCD (Boot Configuration Data) file, which are responsible for Windows startup process. BOOTSECT.BAK, which is a backup of the BOOTSECT.DOS. that is created by default by old Windows operating systems when any boot modifications take place. pagefile.sys, which supports system crash dumps and used to manage virtual memory. swapfile.sys, which is used in conjunction with pagefile.sys to free up the memory in RAM. _Exhibit 10: Modifying access control rights_ ### Data Destruction ----- The NtFsControlFile is responsible for zeroing the data out with the IOCTL code _FSCTL_SET_ZERO_DATA (0x980c8) if it was able to open the file with NtOpenFile API_ (Exhibit 11). The number of bytes to be zeroed out are equal to the size of the file. _Exhibit 11: API responsible for wiping the data_ After the sample finishes executing, the system will automatically restart, and the user will get a prompt that the BCD file is missing or corrupted (Exhibit 12). The executables need to be run as an Administrator for it to gain the full access to the system files and registry keys to proceed with deletion/wiping process. If the executables are opened as a user without UAC privilege elevation – the malware only wipes the files under C:\Users and the system shuts down after. _Exhibit 12: Missing \Boot\BCD file (error)_ ## What eSentire is doing about it Our Threat Response Unit (TRU) combines threat intelligence gleaned from research, security incidents, and the external threat landscape to create actionable outcomes for our customers. We are taking a holistic response approach to combat modern destructive malware by ----- deploying countermeasures, such as: Detections to identify and prevent Double Zero Wiper are in place across eSentire MDR for Endpoint and Log products Threat hunts have been performed for indicators associated with DoubleZero malware ## Recommendations from eSentire’s Threat Response Unit (TRU) We recommend implementing the following controls to help secure your organization against the DoubleZero malware: Confirm that all devices are protected with Endpoint Detection and Response (EDR) solutions Implement a Cyber Security Awareness Training Program that educates the employees about the threat landscape Ensure the role-based access control (RBAC) that restricts system access to authorized users is in place Implement a Vulnerability Management Program that helps identify and prioritize high severity vulnerabilities. Patch any external-facing applications and devices as well as enforce strong password policies While the Tactics, Techniques, and Procedures (TTPs) used by adversaries grow in sophistication, they lead to a limited set of choke points at which critical business decisions must be made. Intercepting the various attack paths utilized by the modern threat actor requires actively monitoring the threat landscape, developing, and deploying endpoint detection, and the ability to investigate logs & network data during active intrusions. eSentire’s Threat Response Unit (TRU) is a world-class team of threat researchers who develop new detections enriched by original threat intelligence and leverage new machine learning models that correlate multi-signal data and automate rapid response to advanced threats. If you’re not currently engaged with an MDR provider, eSentire MDR can help you reclaim the advantage and put your business ahead of disruption. Learn what it means to have an elite team of Threat Hunters and Researchers that works for you. [Connect with an eSentire Security Specialist.](https://www.esentire.com/get-started) ## Appendix ### Sources Indicators of Compromise ----- |Name|File Hash (SHA-256)| |---|---| |Вирус... крайне опасно!!!.zip|d897f07ae6f42de8f35e2b05f5ef5733d7ec599d5e786d3225e66ca605a48f53| |csrss.zip|8dd8b9bd94de1e72f0c400c5f32dcefc114cc0a5bf14b74ba6edc19fd4aeb2a5| |cpcrs.exe (DoubleZero)|3b2e708eaa4744c76a633391cf2c983f4a098b46436525619e5ea44e105355fe| |csrss.exe (DoubleZero)|30b3cbe8817ed75d8221059e4be35d5624bd6b5dc921d4991a7adc4c3eb5de4a| ### Yara Rules ``` import "pe" import "math" rule DoubleZero { meta: author = "eSentire TI" date = "03/24/2022" version = "1.0" strings: $file = "Microsoft.NET" wide fullword nocase // .NET binary $api1 = "NtFsControlFile" // send a control code to the file system $api2 = "CreateDecryptor" // create the AES decryptor $api3 = "set_UseShellExecute" // use OS shell to start the process $api4 = "FsctlSetZeroData" // zero out the data $access_api1 = "RtlAdjustPrivilege" // modify the privileges $access_api2 = "AddAccessRule" // add a rule to the list of rules within a FileSystemSecurity object condition: for any i in (0..pe.number_of_sections - 1): ( math.entropy(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) >=4 and pe.sections[i].name == ".text" ) and all of ($api*) and all of ($access_api*) and $file and (uint16(0) == 0x5A4D or uint32(0) == 0x4464c457f) and filesize < 500KB } ``` -----