{"id":18430,"date":"2022-03-04T10:10:23","date_gmt":"2022-03-04T18:10:23","guid":{"rendered":"http:\/\/www.palada.net\/index.php\/2022\/03\/04\/news-12163\/"},"modified":"2022-03-04T10:10:23","modified_gmt":"2022-03-04T18:10:23","slug":"news-12163","status":"publish","type":"post","link":"http:\/\/www.palada.net\/index.php\/2022\/03\/04\/news-12163\/","title":{"rendered":"HermeticWiper: A detailed analysis of the destructive malware that targeted Ukraine"},"content":{"rendered":"<p><strong>Credit to Author: Threat Intelligence Team| Date: Fri, 04 Mar 2022 17:18:26 +0000<\/strong><\/p>\n<p><em>This blog post was authored by Hasherezade, Ankur Saini and Roberto Santos<\/em><\/p>\n<p>Disk wipers are one particular type of malware often used against Ukraine. The implementation and quality of those wipers vary, and may suggest different hired developers.<\/p>\n<p>The day before the invasion of Ukraine by Russian forces on February 24, a <a href=\"https:\/\/twitter.com\/ESETresearch\/status\/1496581903205511181?s=20&amp;t=5Zz6kStjdzGh2bRaH32DCA\" target=\"_blank\" rel=\"noreferrer noopener\">new data wiper<\/a> was unleashed against a number of Ukrainian entities. This malware was given the name &#8220;HermeticWiper&#8221; based on a stolen digital certificate from a company called Hermetica Digital Ltd.<\/p>\n<p>This wiper is remarkable for its ability to bypass Windows security features and gain write access to many low-level data-structures on the disk. In addition, the attackers wanted to fragment files on disk and overwrite them to make recovery almost impossible.<\/p>\n<p>As we were analyzing this data wiper, <a href=\"https:\/\/www.welivesecurity.com\/2022\/03\/01\/isaacwiper-hermeticwizard-wiper-worm-targeting-ukraine\/\" target=\"_blank\" rel=\"noreferrer noopener\">other research<\/a> has come out detailing additional components were used in this campaign, including a worm and typical ransomware thankfully <a href=\"https:\/\/www.crowdstrike.com\/blog\/how-to-decrypt-the-partyticket-ransomware-targeting-ukraine\/\" target=\"_blank\" rel=\"noreferrer noopener\">poorly implemented<\/a> and decryptable.<\/p>\n<p>We obtained <a rel=\"noreferrer noopener\" href=\"https:\/\/samples.vx-underground.org\/APTs\/2022\/2022.02.23(2)\/Samples\/\" target=\"_blank\">samples<\/a> and in this post we will take apart this new malware.<\/p>\n<h2 id=\"behavioral-analysis\">Behavioral analysis<\/h2>\n<p>First, what we see is a 32 bit Windows executable with an icon resembling a gift. It is not a cynical joke of the attackers, but just a standard icon for a Visual Studio GUI project.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img decoding=\"async\" data-attachment-id=\"54711\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/sample\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/sample.png\" data-orig-size=\"98,111\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"sample\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/sample.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/sample.png\" loading=\"lazy\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/sample.png\" alt=\"Icon used by HermeticWiper\" class=\"wp-image-54711\" width=\"97\" height=\"110\" \/><figcaption><em>Icon used by HermeticWiper<\/em><\/figcaption><\/figure>\n<\/div>\n<p>It has to be run as Administrator in order to work, and does not involve any UAC bypass techniques. As we will later find out, the name of the sample also (slightly) affects its functionality;  if the name starts with &#8220;c&#8221; (or &#8220;C&#8221;, as it is automatically converted to lowercase) the system will also reboot after execution.<\/p>\n<p>Once run, the sample works silently in the background. For several minutes we may not notice anything suspicious. <\/p>\n<p>Only if we watch the sample using tools like Process Explorer, we can notice some unusual actions. It calls various IOCTLs, related to retrieving details about the disks:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/create_and_delete.png\" data-rel=\"lightbox-image-0\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54709\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/create_and_delete\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/create_and_delete.png\" data-orig-size=\"1079,346\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"create_and_delete\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/create_and_delete-300x96.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/create_and_delete-600x192.png\" loading=\"lazy\" width=\"1079\" height=\"346\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/create_and_delete.png\" alt=\"Example of actions performed by HermeticWiper, seen in ProcessMonitor\" class=\"wp-image-54709\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/create_and_delete.png 1079w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/create_and_delete-300x96.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/create_and_delete-600x192.png 600w\" sizes=\"auto, (max-width: 1079px) 100vw, 1079px\" \/><\/a><figcaption><em>Example of actions performed by HermeticWiper, seen in ProcessMonitor<\/em><\/figcaption><\/figure>\n<\/div>\n<p>&#8230;including <code><a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/api\/winioctl\/ni-winioctl-fsctl_get_retrieval_pointers\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"has-inline-color has-vivid-purple-color\">FSCTL_GET_RETRIEVAL_POINTERS<\/span><\/a><\/code> and <code><a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/api\/winioctl\/ni-winioctl-fsctl_move_file\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"has-inline-color has-vivid-purple-color\">FSCTL_MOVE_FILE<\/span><\/a><\/code> which can <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/fileio\/defragmenting-files\" target=\"_blank\" rel=\"noreferrer noopener\">remind of files defragmentation<\/a>*. <\/p>\n<p>[<em>*] Note, that at the low-level, files may not be kept in a filesystem in one continuous chunk (as we see them at high-level), but in multiple chunks, stored in the various sectors of the disk. Defragmentation is related to consolidating those chunks, and fragmentation &#8211; to splitting them.<\/em><\/p>\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/ioctls_content.png\" data-rel=\"lightbox-image-1\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54710\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/ioctls_content\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/ioctls_content.png\" data-orig-size=\"1328,200\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"ioctls_content\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/ioctls_content-300x45.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/ioctls_content-600x90.png\" loading=\"lazy\" width=\"1328\" height=\"200\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/ioctls_content.png\" alt=\"\" class=\"wp-image-54710\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/ioctls_content.png 1328w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/ioctls_content-300x45.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/ioctls_content-600x90.png 600w\" sizes=\"auto, (max-width: 1328px) 100vw, 1328px\" \/><\/a><\/figure>\n<p>However, further examination has shown that the effect here is the opposite of defragmentation. In fact, the data gets more fragmented as a result of the malware execution.<\/p>\n<p>The disk status regarding data fragmentation, before and after the malware execution, can be checked in the following images:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" data-attachment-id=\"54811\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/image-1-5\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-1.png\" data-orig-size=\"1055,500\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-1\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-1-300x142.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-1-600x284.png\" loading=\"lazy\" width=\"1055\" height=\"500\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-1.png\" alt=\"\" class=\"wp-image-54811\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-1.png 1055w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-1-300x142.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-1-600x284.png 600w\" sizes=\"auto, (max-width: 1055px) 100vw, 1055px\" \/><figcaption><em>Disk status before fragmentation<\/em><\/figcaption><\/figure>\n<\/div>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" data-attachment-id=\"54813\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/image-2-5\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-2.png\" data-orig-size=\"1149,546\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-2\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-2-300x143.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-2-600x285.png\" loading=\"lazy\" width=\"1149\" height=\"546\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-2.png\" alt=\"Disk status after fragmentation\" class=\"wp-image-54813\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-2.png 1149w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-2-300x143.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-2-600x285.png 600w\" sizes=\"auto, (max-width: 1149px) 100vw, 1149px\" \/><figcaption><em>Disk status after fragmentation<\/em><\/figcaption><\/figure>\n<\/div>\n<p>This is probably made in order to escalate the created damage: the more fragmented the file is, the more difficult it is to carve it out from the raw disk image, and reconstruct it forensically.<\/p>\n<p>As the execution progresses, at some point, we may realize that some applications stopped working. It is because of the fact that some files, including system DLLs, have been overwritten with random data.<\/p>\n<p>Example: an application failed to run because of a system DLL being trashed:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/bad_image_error.png\" data-rel=\"lightbox-image-2\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54699\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/bad_image_error\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/bad_image_error.png\" data-orig-size=\"512,235\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"bad_image_error\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/bad_image_error-300x138.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/bad_image_error.png\" loading=\"lazy\" width=\"512\" height=\"235\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/bad_image_error.png\" alt=\"Example of an error caused by the wiper\" class=\"wp-image-54699\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/bad_image_error.png 512w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/bad_image_error-300x138.png 300w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><\/a><figcaption><em>Example of an error caused by the wiper<\/em><\/figcaption><\/figure>\n<\/div>\n<p>If we now view the raw image of the disk (i.e. using HxD), we can notice that some sectors have been also overwritten with random data:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/overwrtitten_disk.png\" data-rel=\"lightbox-image-3\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54701\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/overwrtitten_disk\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/overwrtitten_disk.png\" data-orig-size=\"774,338\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"overwrtitten_disk\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/overwrtitten_disk-300x131.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/overwrtitten_disk-600x262.png\" loading=\"lazy\" width=\"774\" height=\"338\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/overwrtitten_disk.png\" alt=\"Sector overwritten by HermeticWiper, seen in HxD\" class=\"wp-image-54701\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/overwrtitten_disk.png 774w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/overwrtitten_disk-300x131.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/overwrtitten_disk-600x262.png 600w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/overwrtitten_disk-195x85.png 195w\" sizes=\"auto, (max-width: 774px) 100vw, 774px\" \/><\/a><figcaption><em>Sector overwritten by HermeticWiper, seen in HxD<\/em><\/figcaption><\/figure>\n<\/div>\n<p>Not surprisingly, on reboot our Windows OS will no longer work:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/os_missing.png\" data-rel=\"lightbox-image-4\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54702\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/os_missing\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/os_missing.png\" data-orig-size=\"728,407\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"os_missing\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/os_missing-300x168.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/os_missing-600x335.png\" loading=\"lazy\" width=\"728\" height=\"407\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/os_missing.png\" alt=\"Message shown to the user after corruption of data\" class=\"wp-image-54702\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/os_missing.png 728w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/os_missing-300x168.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/os_missing-600x335.png 600w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/os_missing-400x225.png 400w\" sizes=\"auto, (max-width: 728px) 100vw, 728px\" \/><\/a><figcaption><em>Message shown to the user after corruption of data<\/em><\/figcaption><\/figure>\n<\/div>\n<p>But what exactly happened underneath? Let\u2019s have a closer look\u2026<\/p>\n<h2>Used components<\/h2>\n<p>The initial sample: <a rel=\"noreferrer noopener\" href=\"https:\/\/www.virustotal.com\/gui\/file\/1bc44eef75779e3ca1eefb8ff5a64807dbc942b1e4a2672d77b9f6928d292591\" target=\"_blank\">1bc44eef75779e3ca1eefb8ff5a64807dbc942b1e4a2672d77b9f6928d292591<\/a> &#8211; comes with several PE files in its resources:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/drivers_in_resources.png\" data-rel=\"lightbox-image-5\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54703\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/drivers_in_resources\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/drivers_in_resources.png\" data-orig-size=\"1212,395\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"drivers_in_resources\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/drivers_in_resources-300x98.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/drivers_in_resources-600x196.png\" loading=\"lazy\" width=\"600\" height=\"196\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/drivers_in_resources-600x196.png\" alt=\"Resources of the malware\" class=\"wp-image-54703\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/drivers_in_resources-600x196.png 600w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/drivers_in_resources-300x98.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/drivers_in_resources.png 1212w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><figcaption><em>Resources of the malware<\/em><\/figcaption><\/figure>\n<\/div>\n<p>The names chosen for the resources (<code>DRV_X64<\/code>, <code>DRV_X86<\/code>, <code>DRV_XP_X86<\/code>, <code>DRV_XP_X64<\/code>) suggest that they are a version of the same driver, dedicated to different versions of Windows: appropriately 32 or 64 bit version, or a legacy version for Windows XP. Each of them is in compressed form. By checking the dumped files by the Linux <code>file<\/code> command, we can see the following output:<\/p>\n<pre class=\"wp-block-preformatted\">file DRV_XP_X86<strong> DRV_XP_X86: MS Compress archive data, SZDD variant, original size: 13896 bytes<\/strong><\/pre>\n<p>To find out how they are loaded, we need to have a look at the sample that carries them.<\/p>\n<p>Fortunately, the sample is not obfuscated. We can easily find the fragment that is responsible for finding the appropriate version of the driver:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/searching_driver_res.png\" data-rel=\"lightbox-image-6\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54704\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/searching_driver_res\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/searching_driver_res.png\" data-orig-size=\"517,497\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"searching_driver_res\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/searching_driver_res-300x288.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/searching_driver_res.png\" loading=\"lazy\" width=\"517\" height=\"497\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/searching_driver_res.png\" alt=\"HermeticWiper selecting which driver will load\" class=\"wp-image-54704\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/searching_driver_res.png 517w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/searching_driver_res-300x288.png 300w\" sizes=\"auto, (max-width: 517px) 100vw, 517px\" \/><\/a><figcaption><em>HermeticWiper selecting which driver will load<\/em><\/figcaption><\/figure>\n<\/div>\n<p>The buffers are then decompressed with the help of the LZMA algorithm:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/lzma_dec.png\" data-rel=\"lightbox-image-7\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54706\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/lzma_dec\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/lzma_dec.png\" data-orig-size=\"686,513\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"lzma_dec\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/lzma_dec-300x224.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/lzma_dec-600x449.png\" loading=\"lazy\" width=\"686\" height=\"513\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/lzma_dec.png\" alt=\"Code responsible of decompress drivers compressed by LZMA algorithm and driver installation\" class=\"wp-image-54706\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/lzma_dec.png 686w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/lzma_dec-300x224.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/lzma_dec-600x449.png 600w\" sizes=\"auto, (max-width: 686px) 100vw, 686px\" \/><\/a><figcaption><em>Code responsible of decompress drivers compressed by LZMA algorithm and driver installation<\/em><\/figcaption><\/figure>\n<\/div>\n<p>This format of compression is supported by a popular extraction tool, 7zip. We can also make our own decoding tool, basing on the malware code (<a href=\"https:\/\/gist.github.com\/hasherezade\/2c7837874f7adf0f73192f4d861d83c6\" target=\"_blank\" rel=\"noreferrer noopener\">example<\/a>).<\/p>\n<p>As a result we get 4 versions of legitimate drivers from the EaseUS Partition Master \u2013 just as reported by ESET (<a href=\"https:\/\/twitter.com\/ESETresearch\/status\/1496581912940396551?s=20&amp;t=wAz5sfT7pTIN-F0aqFaXTg\" target=\"_blank\" rel=\"noreferrer noopener\">source<\/a>).<\/p>\n<ul>\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/www.virustotal.com\/gui\/file\/2c7732da3dcfc82f60f063f2ec9fa09f9d38d5cfbe80c850ded44de43bdb666d\" target=\"_blank\">2c7732da3dcfc82f60f063f2ec9fa09f9d38d5cfbe80c850ded44de43bdb666d<\/a><\/li>\n<li><a href=\"https:\/\/www.virustotal.com\/gui\/file\/23ef301ddba39bb00f0819d2061c9c14d17dc30f780a945920a51bc3ba0198a4\">23ef301ddba39bb00f0819d2061c9c14d17dc30f780a945920a51bc3ba0198a4<\/a><\/li>\n<li><a href=\"https:\/\/www.virustotal.com\/gui\/file\/8c614cf476f871274aa06153224e8f7354bf5e23e6853358591bf35a381fb75b\">8c614cf476f871274aa06153224e8f7354bf5e23e6853358591bf35a381fb75b<\/a><\/li>\n<li><a href=\"https:\/\/www.virustotal.com\/gui\/file\/96b77284744f8761c4f2558388e0aee2140618b484ff53fa8b222b340d2a9c84\">96b77284744f8761c4f2558388e0aee2140618b484ff53fa8b222b340d2a9c84<\/a><\/li>\n<\/ul>\n<p>Based on the timestamps in the PE headers, the builds of the drivers are pretty old. Probably they have been stolen by the attackers from an original, legitimate software bundle. Each of them comes with a Debug directory, including a PDB path. Example:<\/p>\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/driver_pdb.png\" data-rel=\"lightbox-image-8\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54707\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/driver_pdb\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/driver_pdb.png\" data-orig-size=\"918,372\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"driver_pdb\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/driver_pdb-300x122.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/driver_pdb-600x243.png\" loading=\"lazy\" width=\"918\" height=\"372\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/driver_pdb.png\" alt=\"\" class=\"wp-image-54707\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/driver_pdb.png 918w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/driver_pdb-300x122.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/driver_pdb-600x243.png 600w\" sizes=\"auto, (max-width: 918px) 100vw, 918px\" \/><\/a><\/figure>\n<h2>Driver overview<\/h2>\n<p>The drivers leveraged by HermeticWiper are part of the Suite from EaseUS, a legitimate software that brings to the user disk functionalities like partitioning and resizing. As told, this tool is legitimate so no one was detecting the sample in VirusTotal at the time of the attack:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/4a614eb6-82c9-4e6f-b5b4-bd27fef1759b.png\" data-rel=\"lightbox-image-9\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54749\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/4a614eb6-82c9-4e6f-b5b4-bd27fef1759b\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/4a614eb6-82c9-4e6f-b5b4-bd27fef1759b.png\" data-orig-size=\"800,371\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"4a614eb6-82c9-4e6f-b5b4-bd27fef1759b\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/4a614eb6-82c9-4e6f-b5b4-bd27fef1759b-300x139.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/4a614eb6-82c9-4e6f-b5b4-bd27fef1759b-600x278.png\" loading=\"lazy\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/4a614eb6-82c9-4e6f-b5b4-bd27fef1759b.png\" alt=\"VirusTotal showed 0 detections for used drivers\" class=\"wp-image-54749\" width=\"839\" height=\"389\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/4a614eb6-82c9-4e6f-b5b4-bd27fef1759b.png 800w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/4a614eb6-82c9-4e6f-b5b4-bd27fef1759b-300x139.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/4a614eb6-82c9-4e6f-b5b4-bd27fef1759b-600x278.png 600w\" sizes=\"auto, (max-width: 839px) 100vw, 839px\" \/><\/a><figcaption><em>VirusTotal showed 0 detections for used drivers<\/em><\/figcaption><\/figure>\n<\/div>\n<p>Looking inside the driver, we can see typical functions. The driver creates the required device and establishes some Dispatch Routines, as can be seen in the following image:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/c50cd22f-cee1-46b4-8028-92c6a1d671d4.png\" data-rel=\"lightbox-image-10\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54751\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/c50cd22f-cee1-46b4-8028-92c6a1d671d4\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/c50cd22f-cee1-46b4-8028-92c6a1d671d4.png\" data-orig-size=\"800,725\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"c50cd22f-cee1-46b4-8028-92c6a1d671d4\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/c50cd22f-cee1-46b4-8028-92c6a1d671d4-300x272.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/c50cd22f-cee1-46b4-8028-92c6a1d671d4-600x544.png\" loading=\"lazy\" width=\"800\" height=\"725\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/c50cd22f-cee1-46b4-8028-92c6a1d671d4.png\" alt=\"DriverEntry routine\" class=\"wp-image-54751\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/c50cd22f-cee1-46b4-8028-92c6a1d671d4.png 800w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/c50cd22f-cee1-46b4-8028-92c6a1d671d4-300x272.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/c50cd22f-cee1-46b4-8028-92c6a1d671d4-600x544.png 600w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><figcaption><em>DriverEntry routine<\/em><\/figcaption><\/figure>\n<\/div>\n<p>The internals of the driver are quite straightforward. In order to access the driver from usermode we need to use <code><span class=\"has-inline-color has-vivid-purple-color\">CreateFile<\/span><\/code> API function and the name of the device under which the driver was installed (<code>\\.EPMNTDRV<\/code>) along with the partition ID. Example shown below:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/a7acf8e2-6209-4b56-bcb5-3a89ad8bab0d.png\" data-rel=\"lightbox-image-11\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54752\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/a7acf8e2-6209-4b56-bcb5-3a89ad8bab0d\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/a7acf8e2-6209-4b56-bcb5-3a89ad8bab0d.png\" data-orig-size=\"800,212\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"a7acf8e2-6209-4b56-bcb5-3a89ad8bab0d\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/a7acf8e2-6209-4b56-bcb5-3a89ad8bab0d-300x80.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/a7acf8e2-6209-4b56-bcb5-3a89ad8bab0d-600x159.png\" loading=\"lazy\" width=\"800\" height=\"212\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/a7acf8e2-6209-4b56-bcb5-3a89ad8bab0d.png\" alt=\"Usermode artifact opening building the string that will be used to open a HANDLE to the device\" class=\"wp-image-54752\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/a7acf8e2-6209-4b56-bcb5-3a89ad8bab0d.png 800w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/a7acf8e2-6209-4b56-bcb5-3a89ad8bab0d-300x80.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/a7acf8e2-6209-4b56-bcb5-3a89ad8bab0d-600x159.png 600w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><figcaption><em>Usermode component, building the string that will be used to open a HANDLE to the device<\/em><\/figcaption><\/figure>\n<\/div>\n<p>This string is important to understand the driver capabilities. As you can see, this drivers code will convert this sent string from usermode to integer and will use that integer as an input to the `saveReferenceHardDisk` helper function. As it can be extracted from the images, this helper function will save a reference to the physical disk (<em><span class=\"has-inline-color has-vivid-green-cyan-color\">DeviceHarddisk[num]Partition0<\/span><\/em>) in FsContext attribute: <\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-16-edited.png\" data-rel=\"lightbox-image-12\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54870\" data-permalink=\"https:\/\/blog.malwarebytes.com\/image-16-2\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-16-edited.png\" data-orig-size=\"1653,513\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-16\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-16-edited-300x93.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-16-edited-600x186.png\" loading=\"lazy\" width=\"1653\" height=\"513\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-16-edited.png\" alt=\"IRP_MJ_CREATE function\" class=\"wp-image-54870\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-16-edited.png 1653w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-16-edited-300x93.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-16-edited-600x186.png 600w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-16-edited-1536x477.png 1536w\" sizes=\"auto, (max-width: 1653px) 100vw, 1653px\" \/><\/a><figcaption>IRP_MJ_CREATE function<\/figcaption><\/figure>\n<\/div>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-19.png\" data-rel=\"lightbox-image-13\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54871\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/image-19\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-19.png\" data-orig-size=\"800,319\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-19\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-19-300x120.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-19-600x239.png\" loading=\"lazy\" width=\"800\" height=\"319\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-19.png\" alt=\"\" class=\"wp-image-54871\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-19.png 800w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-19-300x120.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-19-600x239.png 600w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><figcaption>Detail of helper function<\/figcaption><\/figure>\n<\/div>\n<p>This behaviour can has been tested also in real time. We can see how the leading backslash&nbsp;is removed prior to convert this value to integer type:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/0087f1d7-33b0-41ca-a0b5-7636e7f6d978.png\" data-rel=\"lightbox-image-14\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54754\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/0087f1d7-33b0-41ca-a0b5-7636e7f6d978\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/0087f1d7-33b0-41ca-a0b5-7636e7f6d978.png\" data-orig-size=\"800,131\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"0087f1d7-33b0-41ca-a0b5-7636e7f6d978\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/0087f1d7-33b0-41ca-a0b5-7636e7f6d978-300x49.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/0087f1d7-33b0-41ca-a0b5-7636e7f6d978-600x98.png\" loading=\"lazy\" width=\"800\" height=\"131\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/0087f1d7-33b0-41ca-a0b5-7636e7f6d978.png\" alt=\"\" class=\"wp-image-54754\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/0087f1d7-33b0-41ca-a0b5-7636e7f6d978.png 800w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/0087f1d7-33b0-41ca-a0b5-7636e7f6d978-300x49.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/0087f1d7-33b0-41ca-a0b5-7636e7f6d978-600x98.png 600w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><figcaption><em>Parameter handling shown in a kernelmode live debugging session<\/em><\/figcaption><\/figure>\n<\/div>\n<p>IRP_MJ_CREATE function will save a Device Object pointer for the hard disk in FsContext2 attribute, returned by getDeviceObject helper function. The DeviceObject pointer in getDeviceObject is used to find IRP_MJ_CREATE function will save a Device Object pointer for the hard disk in FsContext2 attribute, returned by getDeviceObject helper function. The DeviceObject pointer in getDeviceObject is used to find the disk.sys associated device object by traversing to the lowest device object leveraging IoGetLowerDeviceObject function. To confirm that the lower device object is indeed the one we are looking for we check the ServiceKeyName of the object with &#8220;Disk&#8221; which indicates that its looking for the disk.sys object as the ServiceKeyName for that object is &#8220;Disk&#8221;. These objects will be used later in read and write operations. That means that, when different operations are requested to the driver from usermode, the real operation will be performed over the machine physical disks.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-20.png\" data-rel=\"lightbox-image-15\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54878\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/image-20\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-20.png\" data-orig-size=\"1720,806\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-20\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-20-300x141.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-20-600x281.png\" loading=\"lazy\" width=\"1720\" height=\"806\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-20.png\" alt=\"\" class=\"wp-image-54878\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-20.png 1720w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-20-300x141.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-20-600x281.png 600w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-20-1536x720.png 1536w\" sizes=\"auto, (max-width: 1720px) 100vw, 1720px\" \/><\/a><figcaption>Detail of getDiskDeviceObject helper function<\/figcaption><\/figure>\n<\/div>\n<p>Next images show how the driver builds the incoming requests and forwards them to the lower level devices:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/e53f1404-490b-4649-b625-1591428b4a32.png\" data-rel=\"lightbox-image-16\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54756\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/e53f1404-490b-4649-b625-1591428b4a32\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/e53f1404-490b-4649-b625-1591428b4a32.png\" data-orig-size=\"800,426\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"e53f1404-490b-4649-b625-1591428b4a32\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/e53f1404-490b-4649-b625-1591428b4a32-300x160.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/e53f1404-490b-4649-b625-1591428b4a32-600x320.png\" loading=\"lazy\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/e53f1404-490b-4649-b625-1591428b4a32.png\" alt=\"\" class=\"wp-image-54756\" width=\"787\" height=\"419\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/e53f1404-490b-4649-b625-1591428b4a32.png 800w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/e53f1404-490b-4649-b625-1591428b4a32-300x160.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/e53f1404-490b-4649-b625-1591428b4a32-600x320.png 600w\" sizes=\"auto, (max-width: 787px) 100vw, 787px\" \/><\/a><figcaption><em>Example of EaseUS driver handling IOCTL requests<\/em><\/figcaption><\/figure>\n<\/div>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" data-attachment-id=\"54758\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/d1c66602-9fc8-4a58-a1c6-03624eb42e84\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/d1c66602-9fc8-4a58-a1c6-03624eb42e84.png\" data-orig-size=\"800,319\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"d1c66602-9fc8-4a58-a1c6-03624eb42e84\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/d1c66602-9fc8-4a58-a1c6-03624eb42e84-300x120.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/d1c66602-9fc8-4a58-a1c6-03624eb42e84-600x239.png\" loading=\"lazy\" width=\"800\" height=\"319\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/d1c66602-9fc8-4a58-a1c6-03624eb42e84.png\" alt=\"\" class=\"wp-image-54758\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/d1c66602-9fc8-4a58-a1c6-03624eb42e84.png 800w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/d1c66602-9fc8-4a58-a1c6-03624eb42e84-300x120.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/d1c66602-9fc8-4a58-a1c6-03624eb42e84-600x239.png 600w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption><em>Example of EaseUS driver handling read operations<\/em><\/figcaption><\/figure>\n<\/div>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" data-attachment-id=\"54759\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/e0ec8d30-c66d-497d-bbc3-ce731018ec1e\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/e0ec8d30-c66d-497d-bbc3-ce731018ec1e.png\" data-orig-size=\"800,304\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"e0ec8d30-c66d-497d-bbc3-ce731018ec1e\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/e0ec8d30-c66d-497d-bbc3-ce731018ec1e-300x114.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/e0ec8d30-c66d-497d-bbc3-ce731018ec1e-600x228.png\" loading=\"lazy\" width=\"800\" height=\"304\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/e0ec8d30-c66d-497d-bbc3-ce731018ec1e.png\" alt=\"\" class=\"wp-image-54759\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/e0ec8d30-c66d-497d-bbc3-ce731018ec1e.png 800w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/e0ec8d30-c66d-497d-bbc3-ce731018ec1e-300x114.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/e0ec8d30-c66d-497d-bbc3-ce731018ec1e-600x228.png 600w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption><em>Example of EaseUS driver handling IOCTL write operations<\/em><\/figcaption><\/figure>\n<\/div>\n<p>By using FsContext2 field saved by a <span class=\"has-inline-color has-vivid-purple-color\">CreateFile<\/span> operation performed from usermode, this driver could be seen as <strong>a proxy <\/strong>driver where IRPs are handled by underlying devices. In a nutshell, this <em>legitimate<\/em> driver lets the attackers bypass some windows security mechanisms which would ideally be forbidden from usermode such as writing to certain sectors of the raw disk.<\/p>\n<h2 id=\"implementation-of-the-wiper\">Implementation of the Wiper<\/h2>\n<p>This malware is designed to maximize damage done to the system. It does not only overwrite the MBR, but goes further: walking through many structures of the filesystem and corrupting all of them, also trashing individual files.<\/p>\n<p>We know that this executable is going to somehow abuse those drivers in order to implement the wiper functionality. Yet, the question arises, how exactly is it implemented?<\/p>\n<p>It is worth to note that Windows (since Vista) introduced limitations, thanks to which only the sectors at the beginning of the disk can be written to from usermode (with the help of the standard windows drivers). If we want to write to further sectors, i.e. overwrite MFT (Master File Table) we need some custom workarounds. (More explanation given <a href=\"https:\/\/community.osr.com\/discussion\/101522\/vista-rtm-writing-to-raw-disk-sectors\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.)<\/p>\n<p><a href=\"https:\/\/blog.malwarebytes.com\/threat-analysis\/2016\/04\/petya-ransomware\/\" target=\"_blank\" rel=\"noreferrer noopener\">In case of Petya<\/a> (as well as NotPetya, which used the same component), this workaround was implemented by an alternative \u201ckernel\u201d that was booting (instead of Windows) on machine restart, and doing the overwrite. In case of the HermeticWiper, the authors decided for an easier way: they used another driver, that was able to do such overwrites.<\/p>\n<p>First, the malware parses NTFS structures, and stores information about them in the internal structures. For implementing the reads, standard system devices being used. After the needed data is collected, the additional (EaseUS) driver comes into play: it is used as a proxy to <strong>write<\/strong> into the collected sectors.<\/p>\n<p>The attack can be divided into several phases:<\/p>\n<ol>\n<li>Preparation, including:\n<ul>\n<li>Installation of the additional driver (EaseUS)<\/li>\n<li>Disabling system features that may help in recovery, or in noticing of the attack<\/li>\n<\/ul>\n<\/li>\n<li>Data collection: walking through NTFS structure, collecting sectors and files that are going to be overwritten. Also, the random data of appropriate size is generated for the further overwrite.<\/li>\n<li>Trashing (at this stage the EaseUS driver is utilized): the collected sectors are being overwritten by the previously generated random data<\/li>\n<\/ol>\n<p>At the end, the system may be automatically rebooted.<\/p>\n<h2>Execution flow<\/h2>\n<p>Let&#8217;s now have a look at the malware sample, to see how those phases are implemented in detail.<\/p>\n<h3>Preparations<\/h3>\n<p>First the sample parses command line arguments. They will have minor impact on the execution &#8211; may just alter how long the sample is going to sleep between the execution of the particular phases.<\/p>\n<p>Then, the sample proceeds to set privileges that are needed in order to execute the actions that are going to be performed. Two privileges are being set in the main function of the malware: <code>SeShutdownPrivilege<\/code> (that allows to reboot the system) and <code>SeBackupPrivilege<\/code> (that allows to manipulate system backups):<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/privileges1.png\" data-rel=\"lightbox-image-17\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54712\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/privileges1\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/privileges1.png\" data-orig-size=\"805,585\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"privileges1\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/privileges1-300x218.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/privileges1-600x436.png\" loading=\"lazy\" width=\"805\" height=\"585\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/privileges1.png\" alt=\"Hermetic Wiper adjusting required privileges\" class=\"wp-image-54712\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/privileges1.png 805w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/privileges1-300x218.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/privileges1-600x436.png 600w\" sizes=\"auto, (max-width: 805px) 100vw, 805px\" \/><\/a><figcaption><em>Hermetic Wiper adjusting required privileges<\/em><\/figcaption><\/figure>\n<\/div>\n<p>Here comes and interesting twist: the string defining <code>SeShutDownPrivilege<\/code> is composed on the stack, and one chunk in between is missing:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" data-attachment-id=\"54801\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/missing_part-2\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/missing_part.png\" data-orig-size=\"953,384\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"missing_part\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/missing_part-300x121.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/missing_part-600x242.png\" loading=\"lazy\" width=\"953\" height=\"384\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/missing_part.png\" alt=\"Detail of uncompleted SeShutdownPrivilege string\" class=\"wp-image-54801\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/missing_part.png 953w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/missing_part-300x121.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/missing_part-600x242.png 600w\" sizes=\"auto, (max-width: 953px) 100vw, 953px\" \/><figcaption><em>Detail of uncompleted SeShutdownPrivilege string<\/em><\/figcaption><\/figure>\n<\/div>\n<p>This missing chunk <code>wnPr<\/code> is then being filled at the position that is calculated depending on the first character of the current executable name. Due to this, the string becomes complete (and the privilege is set properly) only in the case if the sample has a name starting from &#8220;c&#8221;. <\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" data-attachment-id=\"54802\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/chunk_filled\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/chunk_filled.png\" data-orig-size=\"946,351\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"chunk_filled\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/chunk_filled-300x111.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/chunk_filled-600x223.png\" loading=\"lazy\" width=\"946\" height=\"351\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/chunk_filled.png\" alt=\"SeShutdownPrivilege completed completed in later steps\" class=\"wp-image-54802\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/chunk_filled.png 946w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/chunk_filled-300x111.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/chunk_filled-600x223.png 600w\" sizes=\"auto, (max-width: 946px) 100vw, 946px\" \/><figcaption><em>SeShutdownPrivilege completed completed in later steps<\/em><\/figcaption><\/figure>\n<\/div>\n<p>The reason why the authors decided for such unusual alteration of the flow is not sure. It may be just to obfuscate this particular, suspicious string. It is also common for malware authors to use a name check as an anti-sandbox technique (since sandboxes may assign to samples some predictable names: in the case if such name was detected, sample may exit, so that its behavior cannot be tracked by the Sandbox). However, here the change in the sample behavior is very minor &#8211; it affects only the reboot functionality, not the main mission of the malware.<\/p>\n<h4>Driver Installation<\/h4>\n<p>If the privilege setting was successful, the malware proceeds to the installation of the driver:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/unpack_drivers.png\" data-rel=\"lightbox-image-18\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54713\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/unpack_drivers\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/unpack_drivers.png\" data-orig-size=\"803,112\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"unpack_drivers\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/unpack_drivers-300x42.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/unpack_drivers-600x84.png\" loading=\"lazy\" width=\"803\" height=\"112\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/unpack_drivers.png\" alt=\"\" class=\"wp-image-54713\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/unpack_drivers.png 803w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/unpack_drivers-300x42.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/unpack_drivers-600x84.png 600w\" sizes=\"auto, (max-width: 803px) 100vw, 803px\" \/><\/a><figcaption><em>Driver installation<\/em><\/figcaption><\/figure>\n<\/div>\n<p>The installation function takes several steps.<\/p>\n<p>First, the system is fingerprinted, so that the malware can select the most appropriate version of the driver to be used. Depending on the Windows version, and the bitness (32 or 64 bit), the resource is selected.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/select_resource.png\" data-rel=\"lightbox-image-19\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54714\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/select_resource\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/select_resource.png\" data-orig-size=\"627,617\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"select_resource\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/select_resource-300x295.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/select_resource-600x590.png\" loading=\"lazy\" width=\"627\" height=\"617\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/select_resource.png\" alt=\"Different drivers available to load\" class=\"wp-image-54714\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/select_resource.png 627w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/select_resource-300x295.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/select_resource-600x590.png 600w\" sizes=\"auto, (max-width: 627px) 100vw, 627px\" \/><\/a><figcaption><em>Different drivers available to load<\/em><\/figcaption><\/figure>\n<\/div>\n<p>Before installing the driver, the crash dump mechanism is being disabled:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/crash_dump_disable.png\" data-rel=\"lightbox-image-20\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54715\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/crash_dump_disable\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/crash_dump_disable.png\" data-orig-size=\"780,110\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"crash_dump_disable\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/crash_dump_disable-300x42.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/crash_dump_disable-600x85.png\" loading=\"lazy\" width=\"780\" height=\"110\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/crash_dump_disable.png\" alt=\"HermeticWiper disabling Crash Dumps\" class=\"wp-image-54715\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/crash_dump_disable.png 780w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/crash_dump_disable-300x42.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/crash_dump_disable-600x85.png 600w\" sizes=\"auto, (max-width: 780px) 100vw, 780px\" \/><\/a><figcaption><em>HermeticWiper disabling Crash Dumps<\/em><\/figcaption><\/figure>\n<\/div>\n<p>Crash Dumps are usually being made if the full system crashes, possibly because of a bug\/instability in a driver. They contain information about the full status of the system, and on what exactly happen, in order to help debugging. Disabling crashes before the installation suggests that the authors of the malware have some level of distrust in the used drivers, or believe that the executed operation posses some risk of crashing the system. That&#8217;s why they want to be extra sure that if it eventually happens, the Administrators will have a harder time to find the reason. <\/p>\n<p>Then, they check if the driver is already installed. They do it by sending there and IOCTL, that is supposed to retrieve information about the drive geometry. If this operation has failed, it means the driver is not there, and they can proceed with the installation.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/check_if_install.png\" data-rel=\"lightbox-image-21\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54716\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/check_if_install\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/check_if_install.png\" data-orig-size=\"670,64\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"check_if_install\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/check_if_install-300x29.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/check_if_install-600x57.png\" loading=\"lazy\" width=\"670\" height=\"64\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/check_if_install.png\" alt=\"EaseUs device object reference\" class=\"wp-image-54716\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/check_if_install.png 670w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/check_if_install-300x29.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/check_if_install-600x57.png 600w\" sizes=\"auto, (max-width: 670px) 100vw, 670px\" \/><\/a><figcaption><em>EaseUS device object reference<\/em><\/figcaption><\/figure>\n<\/div>\n<p>The installation is done by first generating a pseudorandom, 4-character long name for the driver, from the hardcoded charset. The function also makes sure that the file with the generated name does not exist yet.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/make_name.png\" data-rel=\"lightbox-image-22\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54717\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/make_name\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/make_name.png\" data-orig-size=\"801,261\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"make_name\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/make_name-300x98.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/make_name-600x196.png\" loading=\"lazy\" width=\"801\" height=\"261\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/make_name.png\" alt=\"Generation of driver name\" class=\"wp-image-54717\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/make_name.png 801w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/make_name-300x98.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/make_name-600x196.png 600w\" sizes=\"auto, (max-width: 801px) 100vw, 801px\" \/><\/a><figcaption><em>Generation of driver name<\/em><\/figcaption><\/figure>\n<\/div>\n<p>Then, the compressed version of the file is being dropped. And finally, the driver is decompressed from it.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" data-attachment-id=\"54718\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/dropped_files-10\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/dropped_files.png\" data-orig-size=\"495,146\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"dropped_files\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/dropped_files-300x88.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/dropped_files.png\" loading=\"lazy\" width=\"495\" height=\"146\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/dropped_files.png\" alt=\"Dropped EaseUS driver shown in explorer\" class=\"wp-image-54718\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/dropped_files.png 495w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/dropped_files-300x88.png 300w\" sizes=\"auto, (max-width: 495px) 100vw, 495px\" \/><figcaption><em>Dropped EaseUS driver shown in explorer<\/em><\/figcaption><\/figure>\n<\/div>\n<p>The decompressed driver is installed as a service:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/decompress_and_install.png\" data-rel=\"lightbox-image-23\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54719\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/decompress_and_install\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/decompress_and_install.png\" data-orig-size=\"687,440\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"decompress_and_install\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/decompress_and_install-300x192.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/decompress_and_install-600x384.png\" loading=\"lazy\" width=\"687\" height=\"440\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/decompress_and_install.png\" alt=\"EasyUs driver installation \" class=\"wp-image-54719\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/decompress_and_install.png 687w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/decompress_and_install-300x192.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/decompress_and_install-600x384.png 600w\" sizes=\"auto, (max-width: 687px) 100vw, 687px\" \/><\/a><figcaption><em>EasyUs driver installation <\/em><\/figcaption><\/figure>\n<\/div>\n<p><em>At this point, the newly dropped files are also added to the structures that will be further passed to the wiping functions &#8211; so that the files can be overwritten at low level. More about it is described in section &#8220;Data collection&#8221;.<\/em><\/p>\n<p>The installation function (denoted as <code>create_driver_svc<\/code>) first enables yet another privilege: <code>SeLoadDriverPrivilege<\/code> (which is required to allow loading drivers):<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/enable_driver_load.png\" data-rel=\"lightbox-image-24\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54721\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/enable_driver_load\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/enable_driver_load.png\" data-orig-size=\"656,150\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"enable_driver_load\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/enable_driver_load-300x69.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/enable_driver_load-600x137.png\" loading=\"lazy\" width=\"656\" height=\"150\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/enable_driver_load.png\" alt=\"SeLoadDriverPrivilege\" class=\"wp-image-54721\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/enable_driver_load.png 656w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/enable_driver_load-300x69.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/enable_driver_load-600x137.png 600w\" sizes=\"auto, (max-width: 656px) 100vw, 656px\" \/><\/a><figcaption><em>SeLoadDriverPrivilege<\/em><\/figcaption><\/figure>\n<\/div>\n<p>Then the driver is added as a system service, and started:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/add_and_start.png\" data-rel=\"lightbox-image-25\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54722\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/add_and_start\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/add_and_start.png\" data-orig-size=\"409,407\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"add_and_start\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/add_and_start-300x300.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/add_and_start.png\" loading=\"lazy\" width=\"409\" height=\"407\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/add_and_start.png\" alt=\"Detail driver service being created\" class=\"wp-image-54722\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/add_and_start.png 409w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/add_and_start-300x300.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/add_and_start-150x150.png 150w\" sizes=\"auto, (max-width: 409px) 100vw, 409px\" \/><\/a><figcaption><em>Detail driver service being created<\/em><\/figcaption><\/figure>\n<\/div>\n<p>This triggers execution of the <code>DriverEntry<\/code> function, and since that point, the driver is residing in memory.<\/p>\n<p>After the successful installation, the registry keys related to the service, as well as the dropped files, are deleted, to make the new driver more difficult to spot:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/delete_both_files.png\" data-rel=\"lightbox-image-26\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54720\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/delete_both_files\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/delete_both_files.png\" data-orig-size=\"379,107\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"delete_both_files\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/delete_both_files-300x85.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/delete_both_files.png\" loading=\"lazy\" width=\"379\" height=\"107\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/delete_both_files.png\" alt=\"Deletion of dropped files\" class=\"wp-image-54720\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/delete_both_files.png 379w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/delete_both_files-300x85.png 300w\" sizes=\"auto, (max-width: 379px) 100vw, 379px\" \/><\/a><figcaption><em>Deletion of dropped files<\/em><\/figcaption><\/figure>\n<\/div>\n<p>We must note, that file deletion does not interfere in the functionality of the driver. It is still loaded in memory (till the next reboot) and will be available for the further use.<\/p>\n<h3>Disabling shadow copies<\/h3>\n<p>It is a common action done by ransomware to delete shadow copies. It is supposed to destroy system backups, and paralyze the recovery. In this case, we can see the sample disabling the Shadow copy Service:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/disabling_shadow_copies.png\" data-rel=\"lightbox-image-27\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54723\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/disabling_shadow_copies\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/disabling_shadow_copies.png\" data-orig-size=\"735,411\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"disabling_shadow_copies\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/disabling_shadow_copies-300x168.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/disabling_shadow_copies-600x336.png\" loading=\"lazy\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/disabling_shadow_copies.png\" alt=\"Shadow Copies being disabled\" class=\"wp-image-54723\" width=\"735\" height=\"411\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/disabling_shadow_copies.png 735w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/disabling_shadow_copies-300x168.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/disabling_shadow_copies-600x336.png 600w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/disabling_shadow_copies-400x225.png 400w\" sizes=\"auto, (max-width: 735px) 100vw, 735px\" \/><\/a><figcaption><em>Shadow Copies being disabled<\/em><\/figcaption><\/figure>\n<\/div>\n<h2>Data Fragmentation<\/h2>\n<p>During our analysis, we noticed that the malware fragments the files present on the disk (as opposite of defragmentation).<\/p>\n<p>Before the fragmentation routine, it changes some settings related to explorer:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/disabling_in_explorer.png\" data-rel=\"lightbox-image-28\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54732\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/disabling_in_explorer\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/disabling_in_explorer.png\" data-orig-size=\"1037,393\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"disabling_in_explorer\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/disabling_in_explorer-300x114.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/disabling_in_explorer-600x227.png\" loading=\"lazy\" width=\"1037\" height=\"393\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/disabling_in_explorer.png\" alt=\"Changes made to registry in order to not show some changes regarding NTFS\" class=\"wp-image-54732\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/disabling_in_explorer.png 1037w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/disabling_in_explorer-300x114.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/disabling_in_explorer-600x227.png 600w\" sizes=\"auto, (max-width: 1037px) 100vw, 1037px\" \/><\/a><figcaption><em>Registry changes to make it harder to spot NTFS operations<\/em><\/figcaption><\/figure>\n<\/div>\n<p>This is probably to hide the information about the file status to the user, to keep them in blind for as long time as possible.<\/p>\n<p>Below function shows how the fragmentation routine is executed:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image.png\" data-rel=\"lightbox-image-29\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54763\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/image-12\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image.png\" data-orig-size=\"899,195\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-300x65.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-600x130.png\" loading=\"lazy\" width=\"899\" height=\"195\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image.png\" alt=\"Wrapper function used for fragmentation purposes\" class=\"wp-image-54763\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image.png 899w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-300x65.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-600x130.png 600w\" sizes=\"auto, (max-width: 899px) 100vw, 899px\" \/><\/a><figcaption><em>Wrapper function used for fragmentation purposes<\/em><\/figcaption><\/figure>\n<\/div>\n<p>The standard windows directories are being excluded:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" data-attachment-id=\"54735\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/exclude_file\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/exclude_file.png\" data-orig-size=\"734,288\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"exclude_file\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/exclude_file-300x118.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/exclude_file-600x235.png\" loading=\"lazy\" width=\"734\" height=\"288\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/exclude_file.png\" alt=\"Folder list that will be skipped\" class=\"wp-image-54735\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/exclude_file.png 734w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/exclude_file-300x118.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/exclude_file-600x235.png 600w\" sizes=\"auto, (max-width: 734px) 100vw, 734px\" \/><figcaption><em>Folder list that will be skipped<\/em><\/figcaption><\/figure>\n<\/div>\n<p>This can be done both to save time (by not corrupting standard files), and to avoid the interference with system stability.<\/p>\n<p>The file fragmentation process can be seen in next images:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/fragment_revieval_points.png\" data-rel=\"lightbox-image-30\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54736\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/fragment_revieval_points\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/fragment_revieval_points.png\" data-orig-size=\"842,228\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"fragment_revieval_points\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/fragment_revieval_points-300x81.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/fragment_revieval_points-600x162.png\" loading=\"lazy\" width=\"842\" height=\"228\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/fragment_revieval_points.png\" alt=\"\" class=\"wp-image-54736\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/fragment_revieval_points.png 842w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/fragment_revieval_points-300x81.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/fragment_revieval_points-600x162.png 600w\" sizes=\"auto, (max-width: 842px) 100vw, 842px\" \/><\/a><figcaption><em>Fragmentation detail (1)<\/em><\/figcaption><\/figure>\n<\/div>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/fragment_move.png\" data-rel=\"lightbox-image-31\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54737\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/fragment_move\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/fragment_move.png\" data-orig-size=\"789,648\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"fragment_move\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/fragment_move-300x246.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/fragment_move-600x493.png\" loading=\"lazy\" width=\"789\" height=\"648\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/fragment_move.png\" alt=\"\" class=\"wp-image-54737\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/fragment_move.png 789w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/fragment_move-300x246.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/fragment_move-600x493.png 600w\" sizes=\"auto, (max-width: 789px) 100vw, 789px\" \/><\/a><figcaption><em>Fragmentation detail (2)<\/em><\/figcaption><\/figure>\n<\/div>\n<p>The fragmentation algorithm implementation is achieved by using different IOCTL_CODES (FSCTL) as FSCTL_GET_RETRIEVAL_POINTERS and FSCTL_GET_MOVE_FILES. The code looks pretty similar to a defragmentation code. But in this case, is being modified in order to fragment, where file chunks are splitted and moved to free clusters in the disk.<\/p>\n<h2>Data collection<\/h2>\n<p>After those preparations, malware enters the second stage of the execution: data collection. In casual ransomware cases, we may see sometimes that prior to the encryption, malware iterates through various directories,  and makes a list of files that it is going to attack. This case is analogous, but much more interesting, because the authors iterate not through directories (at high level, using windows API), but at low level, through NTFS file system, reading various structures and parsing them manually. To enumerate them, they send IOCTLs through standard Windows devices (the newly installed driver is not used yet).<\/p>\n<h3>Data storage<\/h3>\n<p>The output of this parsing is stored in custom structures which we managed to reconstruct, and defined in the following way:<\/p>\n<pre class=\"wp-block-preformatted\">struct elemStr {   elemStr *fLink;   elemStr *bLink;   chunkStr *chunkPtr;   DWORD diskNumber;   BYTE *randomBufToWrite;   DWORD sizeBuffer; };  struct chunkStr {   partitionStr *fLink;   partitionStr *bLink;   LARGE_INTEGER offset;   QWORD chunk_size; };<\/pre>\n<p>They both are linked lists.<\/p>\n<p>The first one <code>elemStr<\/code> defines the element that will be overwritten.  Its size is retrieved, and the random buffer dedicated for its overwrite is generated:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/generate_random_buf.png\" data-rel=\"lightbox-image-32\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54726\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/generate_random_buf-2\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/generate_random_buf.png\" data-orig-size=\"596,499\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"generate_random_buf\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/generate_random_buf-300x251.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/generate_random_buf.png\" loading=\"lazy\" width=\"596\" height=\"499\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/generate_random_buf.png\" alt=\"Random data being generated for later trashing action\" class=\"wp-image-54726\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/generate_random_buf.png 596w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/generate_random_buf-300x251.png 300w\" sizes=\"auto, (max-width: 596px) 100vw, 596px\" \/><\/a><figcaption><em>Random data being generated for later trashing action<\/em><\/figcaption><\/figure>\n<\/div>\n<p>The &#8220;chunk&#8221; represents a continuous block of physical addresses to be overwritten. <\/p>\n<p>So in general, the malware will use these structures in a 2 step process. First step will collect all the data. The second step will wipe this data, using the previous created structure.<\/p>\n<h3>Collected elements<\/h3>\n<p>As seen before, these structures will be sent to functions that will perform the data corruption, at a very low level. The structures that are collected for later destruction are presented below.<\/p>\n<h4><em>Own executable and the dropped drivers<\/em><\/h4>\n<p>We have seen that the attackers were interested in cleaning their trace. To accomplish that, they will delete their own executable from disk, even tough the binary itself keeps running and in memory. As any other task performed in the filesystem by HermeticWiper, the way of deleting their binary is slightly different as other malwares do. The attackers first manage to find which offset the binary occupies in raw, and finally they will overwrite that specific offset.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" data-attachment-id=\"54837\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/image-15\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-15.png\" data-orig-size=\"835,66\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-15\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-15-300x24.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-15-600x47.png\" loading=\"lazy\" width=\"835\" height=\"66\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-15.png\" alt=\"\" class=\"wp-image-54837\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-15.png 835w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-15-300x24.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-15-600x47.png 600w\" sizes=\"auto, (max-width: 835px) 100vw, 835px\" \/><figcaption><em>HermeticWiper file will be destroyed, along with other elements<\/em><\/figcaption><\/figure>\n<\/div>\n<p>The dropped files (compressed and uncompressed driver) were added to the same  structure, just after the the installation.<\/p>\n<h4><em>The Boot Sector<\/em><\/h4>\n<p>One of the attackers motivation is making devices incapable of loading the OS. The first step followed is enumerating all physical devices, as well as partitions. For that, a simple loop is used that tries to open a handle to HardDisk[num], where num is iterated from 0 to 100:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" data-attachment-id=\"54912\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/fill_partitions_info-1\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/fill_partitions_info-1.png\" data-orig-size=\"598,43\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"fill_partitions_info-1\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/fill_partitions_info-1-300x22.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/fill_partitions_info-1.png\" loading=\"lazy\" width=\"598\" height=\"43\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/fill_partitions_info-1.png\" alt=\"\" class=\"wp-image-54912\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/fill_partitions_info-1.png 598w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/fill_partitions_info-1-300x22.png 300w\" sizes=\"auto, (max-width: 598px) 100vw, 598px\" \/><figcaption><em>Loop showing how attackers will iterate through HardDisk0 to HardDisk100<\/em><\/figcaption><\/figure>\n<\/div>\n<p>All this information is then stored into a diskStruct structure that contains data as the disk number. In this case, chunkElement will describe raw addresses of boot sectors. In that regard, an especial mention is made to <code>C:System Volume Information<\/code>. The attackers will add to boot_sectors structure this folder contents:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/891d661c-e093-4bb3-aa62-dd81025a58cd.png\" data-rel=\"lightbox-image-33\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54765\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/891d661c-e093-4bb3-aa62-dd81025a58cd\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/891d661c-e093-4bb3-aa62-dd81025a58cd.png\" data-orig-size=\"800,323\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"891d661c-e093-4bb3-aa62-dd81025a58cd\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/891d661c-e093-4bb3-aa62-dd81025a58cd-300x121.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/891d661c-e093-4bb3-aa62-dd81025a58cd-600x242.png\" loading=\"lazy\" width=\"800\" height=\"323\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/891d661c-e093-4bb3-aa62-dd81025a58cd.png\" alt=\"\" class=\"wp-image-54765\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/891d661c-e093-4bb3-aa62-dd81025a58cd.png 800w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/891d661c-e093-4bb3-aa62-dd81025a58cd-300x121.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/891d661c-e093-4bb3-aa62-dd81025a58cd-600x242.png 600w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><figcaption><em>Calls to parse_NTFS_AND_execute_callback function<\/em><\/figcaption><\/figure>\n<\/div>\n<p>According to Microsoft, &#8220;<em>The Mount Manager maintains the Mount Manager remote database on every NTFS volume in which the Mount Manager records any mount points defined for that volume. The database file resides in the directory System Volume Information on the NTFS volume<\/em>&#8221; (Windows Internals, 6th edition). So this technique is also created for increasing damage. Finally, all these collected offsets will be overwritten as the malicious binary was, leveraging the EasyUS driver.<\/p>\n<h4><em>Reserved Sectors and MFT<\/em><\/h4>\n<p>As before, the malware will brute-force again against the PhysicalDrive ID to find valid drive IDs. Then it uses IOCTL_DISK_GET_DRIVE_LAYOUT_EX to retrieve information about all the primary partitions present on the drive and reads the first sector from that partition. Other information required to read one sector from the disk is retrieved by using the IOCTL_DISK_GET_DRIVE_GEOMETRY_EX. <\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/disk_one_by_one.png\" data-rel=\"lightbox-image-34\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54913\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/disk_one_by_one\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/disk_one_by_one.png\" data-orig-size=\"794,571\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"disk_one_by_one\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/disk_one_by_one-300x216.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/disk_one_by_one-600x431.png\" loading=\"lazy\" width=\"600\" height=\"431\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/disk_one_by_one-600x431.png\" alt=\"\" class=\"wp-image-54913\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/disk_one_by_one-600x431.png 600w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/disk_one_by_one-300x216.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/disk_one_by_one.png 794w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><figcaption><em>Retrieving information about each disk<\/em><\/figcaption><\/figure>\n<\/div>\n<p>Once the first sector of a partition is read then the callback function passed by the malware is invoked on this sector. <\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/process_partitions-2.png\" data-rel=\"lightbox-image-35\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54919\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/process_partitions-2\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/process_partitions-2.png\" data-orig-size=\"833,903\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"process_partitions-2\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/process_partitions-2-277x300.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/process_partitions-2-553x600.png\" loading=\"lazy\" width=\"553\" height=\"600\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/process_partitions-2-553x600.png\" alt=\"\" class=\"wp-image-54919\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/process_partitions-2-553x600.png 553w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/process_partitions-2-277x300.png 277w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/process_partitions-2.png 833w\" sizes=\"auto, (max-width: 553px) 100vw, 553px\" \/><\/a><\/figure>\n<\/div>\n<p>Depending on the filesystem type if its FAT then it wipes all the Reserved Sectors, the boot record sectors in FAT filesystem are part of Reserved Sectors. In case of NTFS the malware wipes the MFT and MFTMirror (backup MFT) present on the disk, the purpose of which is to make the recovery of the data harder.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/b50111ec-f377-4b7f-9b91-a4019bd5c370.png\" data-rel=\"lightbox-image-36\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54766\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/b50111ec-f377-4b7f-9b91-a4019bd5c370\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/b50111ec-f377-4b7f-9b91-a4019bd5c370.png\" data-orig-size=\"800,217\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"b50111ec-f377-4b7f-9b91-a4019bd5c370\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/b50111ec-f377-4b7f-9b91-a4019bd5c370-300x81.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/b50111ec-f377-4b7f-9b91-a4019bd5c370-600x163.png\" loading=\"lazy\" width=\"800\" height=\"217\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/b50111ec-f377-4b7f-9b91-a4019bd5c370.png\" alt=\"\" class=\"wp-image-54766\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/b50111ec-f377-4b7f-9b91-a4019bd5c370.png 800w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/b50111ec-f377-4b7f-9b91-a4019bd5c370-300x81.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/b50111ec-f377-4b7f-9b91-a4019bd5c370-600x163.png 600w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><figcaption><em>Routine for FAT filesystem<\/em><\/figcaption><\/figure>\n<\/div>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" data-attachment-id=\"54767\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/dced0d2c-9ae1-4663-8e38-350fff2fa032\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/dced0d2c-9ae1-4663-8e38-350fff2fa032.png\" data-orig-size=\"800,304\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"dced0d2c-9ae1-4663-8e38-350fff2fa032\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/dced0d2c-9ae1-4663-8e38-350fff2fa032-300x114.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/dced0d2c-9ae1-4663-8e38-350fff2fa032-600x228.png\" loading=\"lazy\" width=\"800\" height=\"304\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/dced0d2c-9ae1-4663-8e38-350fff2fa032.png\" alt=\"\" class=\"wp-image-54767\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/dced0d2c-9ae1-4663-8e38-350fff2fa032.png 800w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/dced0d2c-9ae1-4663-8e38-350fff2fa032-300x114.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/dced0d2c-9ae1-4663-8e38-350fff2fa032-600x228.png 600w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption><em>Routine for NTFS filesystem<\/em><\/figcaption><\/figure>\n<\/div>\n<p>Each file on an NTFS volume is represented by a record in a special file called the master file table (MFT). In case the MFT becomes corruptible then MFT mirror is read in an attempt to recover the original MFT, whose first record is identical to the first record of the MFT. MFT table is the index on which the filesystem relies, having information like where a file resides. Without MFT, the system will be unable to know were folders and files are, or modification dates, etc.&nbsp;<\/p>\n<h4><em>Bitmap and LogFile<\/em><\/h4>\n<p>In an attempt to hinder the recovery, Bitmap and LogFile are overwritten as well for all the logical drives present on the system. The logical drives are retrieved by GetLogicalDriveStringsW in this case. These structures are also important when doing recovery and postmortem investigation. $Bitmap contains information about free and occupied clusters and $Logfile contains a log of transactions that happened in the filesystem.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" data-attachment-id=\"54769\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/c6f61d31-fed1-4cd3-8215-10e231305093\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/c6f61d31-fed1-4cd3-8215-10e231305093.png\" data-orig-size=\"636,399\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"c6f61d31-fed1-4cd3-8215-10e231305093\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/c6f61d31-fed1-4cd3-8215-10e231305093-300x188.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/c6f61d31-fed1-4cd3-8215-10e231305093-600x376.png\" loading=\"lazy\" width=\"636\" height=\"399\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/c6f61d31-fed1-4cd3-8215-10e231305093.png\" alt=\"\" class=\"wp-image-54769\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/c6f61d31-fed1-4cd3-8215-10e231305093.png 636w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/c6f61d31-fed1-4cd3-8215-10e231305093-300x188.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/c6f61d31-fed1-4cd3-8215-10e231305093-600x376.png 600w\" sizes=\"auto, (max-width: 636px) 100vw, 636px\" \/><\/figure>\n<\/div>\n<p>Also user files will be impacted by data destruction. We have discovered that the malware will overwrite as well almost everything inside C:\/Documents and settings. In modern Windows, Documents and Settings will point to C:\/Users. This folder contains users data folders (for example, My Documents or Desktop are located in these folders). Some files are skipped in this process, as the ones under APPDATA but in general, every file that is contained under these folders will be overwritten.<\/p>\n<h4><em>Collecting clusters to erase the whole disk<\/em><\/h4>\n<p>The final part of the data collection is to get information required to wipe all the occupied clusters on the disk. To get this information the malware uses FSCTL_GET_VOLUME_BITMAP IOCTL which gives us information about all the occupied and free clusters on the disk. The malware traverses all the logical disks and uses FSCTL_GET_VOLUME_BITMAP to retrieve the bitmap, every bit denotes a cluster in the bitmap, a value of 1 implying that the cluster is occupied and 0 meaning that the cluster is free. The bitmap retrieved with the IOCTL is traversed bit by bit and all the occupied clusters are added to the wiping structure which is described above in the post, one thing to note here is that malware combines all the contiguous clusters and these contiguous multiple clusters are denoted by a single chunk structure opposed to earlier usages where one chunk structure denoted a single cluster.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/clusters.png\" data-rel=\"lightbox-image-37\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54804\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/clusters\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/clusters.png\" data-orig-size=\"1806,1146\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"clusters\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/clusters-300x190.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/clusters-600x381.png\" loading=\"lazy\" width=\"1806\" height=\"1146\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/clusters.png\" alt=\"Finally, all occupied clusters will be collected in a diskStr typed structure for its destruction\" class=\"wp-image-54804\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/clusters.png 1806w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/clusters-300x190.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/clusters-600x381.png 600w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/clusters-1536x975.png 1536w\" sizes=\"auto, (max-width: 1806px) 100vw, 1806px\" \/><\/a><\/figure>\n<\/div>\n<p>Finally, all occupied clusters will be collected in a diskStr typed structure for its destruction<\/p>\n<h3>How is this all performed?<\/h3>\n<p>Through the entire post its been told that some NTFS properties (like attributes, indexes, etc) are being used in order to collect data, that will be wiped after. We will like to show an example of how attackers implemented that functionalityn and show the level of sophistication.<\/p>\n<p>For that, we will take as example the code responsible in collecting the Windows log files:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-3.png\" data-rel=\"lightbox-image-38\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54819\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/image-3-2\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-3.png\" data-orig-size=\"876,97\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-3\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-3-300x33.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-3-600x66.png\" loading=\"lazy\" width=\"876\" height=\"97\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-3.png\" alt=\"Code responsible in collecting the Windows log files\" class=\"wp-image-54819\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-3.png 876w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-3-300x33.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-3-600x66.png 600w\" sizes=\"auto, (max-width: 876px) 100vw, 876px\" \/><\/a><figcaption><em>Code responsible in collecting Windows log files<\/em><\/figcaption><\/figure>\n<\/div>\n<p>After this call, some data structures are filled, containing data regarding physical disk properties and the folder name itself. Our first reference to the NTFS filesystem is found in the way that the HANDLE is retrieved. This folder is oppened as a NTFS stream:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-4.png\" data-rel=\"lightbox-image-39\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54820\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/image-4-3\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-4.png\" data-orig-size=\"1121,97\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-4\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-4-300x26.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-4-600x52.png\" loading=\"lazy\" width=\"1121\" height=\"97\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-4.png\" alt=\"\" class=\"wp-image-54820\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-4.png 1121w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-4-300x26.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-4-600x52.png 600w\" sizes=\"auto, (max-width: 1121px) 100vw, 1121px\" \/><\/a><figcaption><em>HANDLE to the default directory stream<\/em><\/figcaption><\/figure>\n<\/div>\n<p>Eventually, the code will reach the following point. The first call will parse $INDEX_ROOT attribute, and the functionality is relatively similar and simpler than the second one, where $INDEX_ALLOCATION attribute is used. Additional information about these NTFS attributes can be found <a href=\"http:\/\/inform.pucp.edu.pe\/~inf232\/Ntfs\/ntfs_doc_v0.5\/attributes\/\">here<\/a>. We will assume that the list of elements is long enough to have an $INDEX_ALLOCATION and we will deep into this call:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" data-attachment-id=\"54821\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/image-5-3\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-5.png\" data-orig-size=\"849,306\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-5\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-5-300x108.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-5-600x216.png\" loading=\"lazy\" width=\"849\" height=\"306\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-5.png\" alt=\"\" class=\"wp-image-54821\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-5.png 849w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-5-300x108.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-5-600x216.png 600w\" sizes=\"auto, (max-width: 849px) 100vw, 849px\" \/><figcaption><em>NTFS wrapping callback functions<\/em><\/figcaption><\/figure>\n<\/div>\n<p>It is important to have in mind the parameters sent for a better understanding of the whole process. First two parameters (nFileIndexLow and nFileIndexHigh) are used for calling the function <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/api\/winioctl\/ni-winioctl-fsctl_get_ntfs_file_record\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"has-inline-color has-vivid-purple-color\">FSCTL_GET_NTFS_FILE_RECORD<\/span><\/a>, which will retrieve a NTFS record. After some checks (for example, the magic value), we will pop out in a function that we have called <em>callback_when_attribute_is_found<\/em>. Note that the first parameter sent to this function will be the $INDEX_ALLOCATION (0x20) value that was previously sent:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" data-attachment-id=\"54823\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/image-6-3\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-6.png\" data-orig-size=\"655,187\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-6\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-6-300x86.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-6-600x171.png\" loading=\"lazy\" width=\"600\" height=\"171\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-6-600x171.png\" alt=\"\" class=\"wp-image-54823\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-6-600x171.png 600w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-6-300x86.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-6.png 655w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><figcaption><em>Call to callback_when_attribute_is_found function<\/em><\/figcaption><\/figure>\n<\/div>\n<p>What this function will do is to iterate through all NTFS attributes that are part of the record. To do that, the code will have to find the offset to the first attribute. This offset is just 2 bytes long, as is relative to the structure. The layout of the header is demonstrated below:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" data-attachment-id=\"54824\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/image-7-2\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-7.png\" data-orig-size=\"397,379\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-7\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-7-300x286.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-7.png\" loading=\"lazy\" width=\"397\" height=\"379\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-7.png\" alt=\"\" class=\"wp-image-54824\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-7.png 397w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-7-300x286.png 300w\" sizes=\"auto, (max-width: 397px) 100vw, 397px\" \/><figcaption><em>NTFS RECORD HEADER layout &#8211; <a href=\"http:\/\/inform.pucp.edu.pe\/\" target=\"_blank\" rel=\"noreferrer noopener\">source<\/a><\/em><\/figcaption><\/figure>\n<\/div>\n<p>A NTFS File record will follow this structure:<\/p>\n<figure class=\"wp-block-table\">\n<table>\n<tbody>\n<tr>\n<td>Record Header<\/td>\n<\/tr>\n<tr>\n<td>Attribute<\/td>\n<\/tr>\n<tr>\n<td>Attribute<\/td>\n<\/tr>\n<tr>\n<td>Attribute<\/td>\n<\/tr>\n<\/tbody>\n<\/table><figcaption>NTFS record layout<\/figcaption><\/figure>\n<p>If we still remember the $INDEX_ALLOCATION (0x20), it becomes handy now. Attributes will start with a specific TypeCode, as $INDEX_ALLOCATION is. So, if one of the attributes matches the selected type that was required, the first callback function (the one sent steps before as a parameter) will be triggered:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" data-attachment-id=\"54827\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/image-8-2\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-8.png\" data-orig-size=\"763,405\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-8\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-8-300x159.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-8-600x318.png\" loading=\"lazy\" width=\"763\" height=\"405\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-8.png\" alt=\"\" class=\"wp-image-54827\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-8.png 763w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-8-300x159.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-8-600x318.png 600w\" sizes=\"auto, (max-width: 763px) 100vw, 763px\" \/><figcaption><em>Code showing matching attribute and callback<\/em><\/figcaption><\/figure>\n<\/div>\n<p><em>I<span style=\"font-size: revert;color: initial;, sans-serif\">n the case there is not matching TypeCode but an $ATTRIBUTE_LIST is found, that will mean that exists more attributes, but these cannot fit into $MFT table. In this rare case, the malware will continue processing these extra attributes and will call recursively the first function.<\/span><\/em><\/p>\n<p>Lets check what this callback will do. Remember that this callback function, in our case is <em>indexAllocation_Callback_CollectAllfiles<\/em>. The first step will be recovering the stream that this attribute points to. As $INDEX_ALLOCATION is an attribute meant for directories, makes sense this stream being an index array (block indexes):<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" data-attachment-id=\"54828\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/image-9-2\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-9.png\" data-orig-size=\"763,164\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-9\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-9-300x64.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-9-600x129.png\" loading=\"lazy\" width=\"763\" height=\"164\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-9.png\" alt=\"\" class=\"wp-image-54828\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-9.png 763w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-9-300x64.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-9-600x129.png 600w\" sizes=\"auto, (max-width: 763px) 100vw, 763px\" \/><figcaption><em>Block Indexes array being recovered using raw disk offsets<\/em><\/figcaption><\/figure>\n<\/div>\n<p>As this is an index array, these indexes will point to something. This something is, as you would imagine, NTFS records. In raw disk, these type of indexes look like that:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" data-attachment-id=\"54829\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/image-10-2\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-10.png\" data-orig-size=\"1068,300\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-10\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-10-300x84.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-10-600x169.png\" loading=\"lazy\" width=\"1068\" height=\"300\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-10.png\" alt=\"Example of an index block found in a raw disk image file \" class=\"wp-image-54829\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-10.png 1068w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-10-300x84.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-10-600x169.png 600w\" sizes=\"auto, (max-width: 1068px) 100vw, 1068px\" \/><figcaption><em>Example of an index block found in a raw disk image file <\/em><\/figcaption><\/figure>\n<\/div>\n<p>As indexes point to records, all of these records will be sent, recursively, once more to the initial function. But this time the callback function will be different, also the typecode:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" data-attachment-id=\"54832\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/image-13\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-13.png\" data-orig-size=\"626,243\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-13\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-13-300x116.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-13-600x233.png\" loading=\"lazy\" width=\"600\" height=\"233\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-13-600x233.png\" alt=\"\" class=\"wp-image-54832\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-13-600x233.png 600w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-13-300x116.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-13.png 626w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><figcaption><em>$DATA callback function call<\/em><\/figcaption><\/figure>\n<\/div>\n<p>So this time, every record sent will behave differently. $DATA attributes will be looked for instead of $INDEX_ALLOCATION ($DATA contains file data). Also, the executed callback function will be different (named now <em>dataExecuting<\/em>). By using the disk properties that were sent in the first call combined with information gathered from indexes, this callback will locate the exact location of the file in disk. The last step for these files, as for all the ones that we have summarized in this report is being added as a member to a <code>elemStr<\/code>* structure. The offsets contained in this structures, as stated, will be overwritten by the malware in the last steps:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" data-attachment-id=\"54833\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/image-14\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-14.png\" data-orig-size=\"835,248\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-14\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-14-300x89.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-14-600x178.png\" loading=\"lazy\" width=\"835\" height=\"248\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-14.png\" alt=\"\" class=\"wp-image-54833\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-14.png 835w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-14-300x89.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-14-600x178.png 600w\" sizes=\"auto, (max-width: 835px) 100vw, 835px\" \/><figcaption><em>Call to the function that will add the file&#8217;s offset to a elemStr typed structure, for later data destruction<\/em><\/figcaption><\/figure>\n<\/div>\n<h2>Data overwriting<\/h2>\n<p>Finally, after all data is collected, the malware starts overwriting. The <code>elemStr<\/code> structure is passed into the function, and all the elements on the linked list are being processed:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/overwrite_loop.png\" data-rel=\"lightbox-image-40\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54727\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/overwrite_loop\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/overwrite_loop.png\" data-orig-size=\"596,430\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"overwrite_loop\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/overwrite_loop-300x216.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/overwrite_loop.png\" loading=\"lazy\" width=\"596\" height=\"430\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/overwrite_loop.png\" alt=\"to_overwrite_collected_sectors function overview\" class=\"wp-image-54727\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/overwrite_loop.png 596w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/overwrite_loop-300x216.png 300w\" sizes=\"auto, (max-width: 596px) 100vw, 596px\" \/><\/a><figcaption><em>to_overwrite_collected_sectors function overview<\/em><\/figcaption><\/figure>\n<\/div>\n<p>The overwriting function uses the installed driver in order to gain the write access to the sectors. It opens the device, and then walks through all the collected chunks, by their offsets. It uses <code>WriteFile<\/code> to fill it with the previously prepared, random data.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/overwriting_func.png\" data-rel=\"lightbox-image-41\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54728\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/overwriting_func\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/overwriting_func.png\" data-orig-size=\"841,770\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"overwriting_func\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/overwriting_func-300x275.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/overwriting_func-600x549.png\" loading=\"lazy\" width=\"841\" height=\"770\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/overwriting_func.png\" alt=\"Final detail of data destruction\" class=\"wp-image-54728\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/overwriting_func.png 841w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/overwriting_func-300x275.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/overwriting_func-600x549.png 600w\" sizes=\"auto, (max-width: 841px) 100vw, 841px\" \/><\/a><figcaption><em>Final detail of data destruction<\/em><\/figcaption><\/figure>\n<\/div>\n<p>Example below shows a fragment of a log from our experiments, when we dumped the content of particular structures during malware execution: first data collection, and then usage of the filled structures to wipe out the sectors on the disk:<\/p>\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/chunks_listing.png\" data-rel=\"lightbox-image-42\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"54906\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/chunks_listing\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/chunks_listing.png\" data-orig-size=\"1363,301\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"chunks_listing\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/chunks_listing-300x66.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/chunks_listing-600x133.png\" loading=\"lazy\" width=\"1363\" height=\"301\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/chunks_listing.png\" alt=\"\" class=\"wp-image-54906\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/chunks_listing.png 1363w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/chunks_listing-300x66.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/chunks_listing-600x133.png 600w\" sizes=\"auto, (max-width: 1363px) 100vw, 1363px\" \/><\/a><\/figure>\n<h2>Conclusion<\/h2>\n<p>As can be seen, by leveraging legitimate but flawless signed code, the attackers are capable of bypassing some Windows security mechanisms. This is extremely harmful because user applications are not meant to have this level of control in kernel space, for security reasons.<\/p>\n<p>Also, we would like to state that recovery in this case is complicated. The attackers first fragment files on disk, and finally, will overwrite all of these fragments. Even without the last step (indiscriminate disk trashing), the combination of fragmentation and wiping of required structures (like $MFT) would be enough to make recovery almost impossible.<\/p>\n<p>Our final thoughts are about the special focus that cybercriminals put in hiding their tracks. Maybe, that part is the final stage of a bigger operation. In fact, ESET recently described other related artifacts <a href=\"https:\/\/www.welivesecurity.com\/2022\/03\/01\/isaacwiper-hermeticwizard-wiper-worm-targeting-ukraine\/\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>, and they connect them to the same actor and campaign. Being part of a bigger picture can explain why attackers are so interesting in corrupting files like $LogFile and Windows events.<\/p>\n<p>Malwarebytes detects this disk wiper as Trojan.HermeticWiper.<\/p>\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" data-attachment-id=\"54882\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/attachment\/image-21\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-21.png\" data-orig-size=\"1463,890\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-21\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-21-300x183.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-21-600x365.png\" loading=\"lazy\" width=\"600\" height=\"365\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-21-600x365.png\" alt=\"Malwarebytes users are protected against this attack\" class=\"wp-image-54882\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-21-600x365.png 600w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-21-300x183.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/03\/image-21.png 1463w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/figure>\n<p>The post <a rel=\"nofollow\" href=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/\">HermeticWiper: A detailed analysis of the destructive malware that targeted Ukraine<\/a> appeared first on <a rel=\"nofollow\" href=\"https:\/\/blog.malwarebytes.com\">Malwarebytes Labs<\/a>.<\/p>\n<p><a href=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/\" target=\"bwo\" >https:\/\/blog.malwarebytes.com\/feed\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><strong>Credit to Author: Threat Intelligence Team| Date: Fri, 04 Mar 2022 17:18:26 +0000<\/strong><\/p>\n<p>Hours before the invasion of Ukraine by Russian forces, a new piece of malware was launched at Ukrainian targets. In this blog post, we take apart its components and highlight its capabilities.<\/p>\n<p>The post <a rel=\"nofollow\" href=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/03\/hermeticwiper-a-detailed-analysis-of-the-destructive-malware-that-targeted-ukraine\/\">HermeticWiper: A detailed analysis of the destructive malware that targeted Ukraine<\/a> appeared first on <a rel=\"nofollow\" href=\"https:\/\/blog.malwarebytes.com\">Malwarebytes Labs<\/a>.<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[10488,10378],"tags":[25145,3765,12040,16068],"class_list":["post-18430","post","type-post","status-publish","format-standard","hentry","category-malwarebytes","category-security","tag-hermeticwiper","tag-ransomware","tag-threat-intelligence","tag-wiper"],"_links":{"self":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/18430","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/comments?post=18430"}],"version-history":[{"count":0,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/18430\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/media?parent=18430"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/categories?post=18430"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/tags?post=18430"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}