{"id":18133,"date":"2022-02-02T11:10:02","date_gmt":"2022-02-02T19:10:02","guid":{"rendered":"https:\/\/www.palada.net\/index.php\/2022\/02\/02\/news-11866\/"},"modified":"2022-02-02T11:10:02","modified_gmt":"2022-02-02T19:10:02","slug":"news-11866","status":"publish","type":"post","link":"https:\/\/www.palada.net\/index.php\/2022\/02\/02\/news-11866\/","title":{"rendered":"KONNI evolves into stealthier RAT"},"content":{"rendered":"<p><strong>Credit to Author: Threat Intelligence Team| Date: Wed, 26 Jan 2022 18:47:58 +0000<\/strong><\/p>\n<p><em>This blog post was authored by Roberto Santos<\/em><\/p>\n<p>KONNI is a Remote Administration Tool that has being used for at least 8 years. The North Korean threat actor that is using this piece of malware has being identified <a href=\"https:\/\/www.proofpoint.com\/sites\/default\/files\/threat-reports\/pfpt-us-tr-threat-insight-paper-triple-threat-N-Korea-aligned-TA406-steals-scams-spies.pdf\" target=\"_blank\" rel=\"noreferrer noopener\">under the Kimsuky umbrella<\/a>. This group has been very busy, attacking political institutions located in Russia and South Korea. The last known attack where KONNI Rat was used was described <a href=\"https:\/\/blog.lumen.com\/new-konni-campaign-targeting-russian-ministry-of-foreign-affairs\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n<p>We found that KONNI Rat is being actively developed, and new samples are now including significant updates. In this blog post, we will cover some of the major changes and explain why the security community should keep a close eye on it.<\/p>\n<h2>Simplified Attack Chain<\/h2>\n<p>The attack usually starts leveraging a malicious Office document. When this document is opened by the victim, a multistage attack is started, involving various steps. But these steps are just the way that the attackers manage to accomplish tasks to elevate privileges, evade detection and deploy required files. As we described in a <a href=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2021\/08\/new-variant-of-konni-malware-used-in-campaign-targetting-russia\/\" target=\"_blank\" rel=\"noreferrer noopener\">previous blog post<\/a>, the attack chain could be summarized in the following diagram:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/attackchain.drawio.png\" data-rel=\"lightbox-image-0\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"53645\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/01\/konni-evolves-into-stealthier-rat\/attachment\/attackchain-drawio\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/attackchain.drawio.png\" data-orig-size=\"601,282\" data-comments-opened=\"1\" 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=\"attackchain.drawio\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/attackchain.drawio-300x141.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/attackchain.drawio.png\" loading=\"lazy\" width=\"601\" height=\"282\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/attackchain.drawio.png\" alt=\"\" class=\"wp-image-53645\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/attackchain.drawio.png 601w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/attackchain.drawio-300x141.png 300w\" sizes=\"auto, (max-width: 601px) 100vw, 601px\" \/><\/a><figcaption>Simplified attack chain<\/figcaption><\/figure>\n<\/div>\n<p>The attack usually starts leveraging a malicious Office document. When this document is opened by the victim, a multistage attack is started, involving various steps. But these steps are just the way that the attackers manage to accomplish tasks to elevate privileges, evade detection and deploy required files.<\/p>\n<p>The final goal of the attack is installing what is called KONNI Rat, which is a .dll file supported by an .ini file. In a nutshell, the .dll file contains the functionality of the RAT, and the .ini file contains the address of the first C&amp;C server. KONNI Rat&#8217;s general behavior remains almost the same as previous versions, but there are changes we will cover below.<\/p>\n<h2>Rundll no longer supported<\/h2>\n<p>In previous KONNI Rat samples there were two branches. One handles if the malware was launched using a Windows service, and the other handles the execution through rundll. The next image shows these two old branches, with the strings svchost.exe and rundll32.exe visible:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-2.png\" data-rel=\"lightbox-image-1\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"53622\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/01\/konni-evolves-into-stealthier-rat\/attachment\/untitled-2-2\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-2.png\" data-orig-size=\"824,294\" data-comments-opened=\"1\" 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=\"Untitled-2\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-2-300x107.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-2-600x214.png\" loading=\"lazy\" width=\"824\" height=\"294\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-2.png\" alt=\"\" class=\"wp-image-53622\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-2.png 824w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-2-300x107.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-2-600x214.png 600w\" sizes=\"auto, (max-width: 824px) 100vw, 824px\" \/><\/a><figcaption>Old main function showing svchost.exe and rundll32.exe strings<\/figcaption><\/figure>\n<\/div>\n<p>However, new samples will not show these strings. In fact, <strong>rundll is no longer a valid way to execute the sample<\/strong>. Instead, when an execution attempt occurs using rundll, an exception is thrown in the early stages.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-3.png\" data-rel=\"lightbox-image-2\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"53623\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/01\/konni-evolves-into-stealthier-rat\/attachment\/untitled-3\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-3.png\" data-orig-size=\"785,440\" data-comments-opened=\"1\" 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=\"Untitled-3\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-3-300x168.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-3-600x336.png\" loading=\"lazy\" width=\"785\" height=\"440\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-3.png\" alt=\"\" class=\"wp-image-53623\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-3.png 785w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-3-300x168.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-3-600x336.png 600w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-3-400x225.png 400w\" sizes=\"auto, (max-width: 785px) 100vw, 785px\" \/><\/a><figcaption>Exception produced by a rundll execution<\/figcaption><\/figure>\n<\/div>\n<p>In early stages of our analysis, we thought that they were using the classic process name check, or any other usual technique. The reality is far simpler and brilliant; the actual export just implements the SvcMain prototype so the program will break at some point when accessing one of the arguments.<\/p>\n<p>In the previous image we see the state of the machine at the moment that this exception is thrown. RDI at that point should contain a pointer to the service name. The exception happens because the Service Main function meets one prototype and rundll32 will expect another different prototype:<\/p>\n<p class=\"has-black-color has-text-color\">VOID WINAPI <strong><span class=\"has-inline-color has-vivid-cyan-blue-color\">SvcMain<\/span><\/strong>( DWORD dwArgc, LPTSTR *lpszArgv )<\/p>\n<p>VOID WINAPI <span class=\"has-inline-color has-vivid-cyan-blue-color\"><strong>runnableExport<\/strong><\/span>(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine, int nCmdShow)<\/p>\n<p>Basically, at some point of the execution, hinst will be treated as lspzArgv, causing the exception. But why did the attackers delete that functionality? There are multiple benefits.<\/p>\n<p>First of all, we have not seen any recent attack that used rundll. In fact, the only way that the attackers launched KONNI Rat in recent campaigns involves registering a Windows service. So the rundll32 branch wasn\u2019t being used in real world attacks.<\/p>\n<p>But there is another big reason in how sandboxes will fail in collecting the real behavior of the sample, as it just cannot execute that way.<\/p>\n<h2>Strings are now protected using AES<\/h2>\n<p>Multiple malware families protect their strings in order to defeat most basic string analysis. KONNI wasn\u2019t an exception, and also used this technique. Old samples were using base64 for obfuscation means. Also, they were using a custom alphabet. This custom alphabet was changed from time to time in order to make the decoding task more difficult:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-4.png\" data-rel=\"lightbox-image-3\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"53636\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/01\/konni-evolves-into-stealthier-rat\/attachment\/untitled-4-2\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-4.png\" data-orig-size=\"804,360\" data-comments-opened=\"1\" 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=\"Untitled-4\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-4-300x134.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-4-600x269.png\" loading=\"lazy\" width=\"804\" height=\"360\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-4.png\" alt=\"\" class=\"wp-image-53636\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-4.png 804w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-4-300x134.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-4-600x269.png 600w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-4-604x270.png 604w\" sizes=\"auto, (max-width: 804px) 100vw, 804px\" \/><\/a><figcaption>Old Konni samples included their custom base64 alphabet followed by the obfuscated strings<\/figcaption><\/figure>\n<\/div>\n<p>Now, the attackers made a major change in that regard by protecting the strings using AES encryption. The algorithm followed by new Konni RAT samples could be represented as follows:<\/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\/01\/encryption.drawio.png\" data-rel=\"lightbox-image-4\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"53639\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/01\/konni-evolves-into-stealthier-rat\/attachment\/encryption-drawio\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/encryption.drawio.png\" data-orig-size=\"680,352\" data-comments-opened=\"1\" 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=\"encryption.drawio\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/encryption.drawio-300x155.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/encryption.drawio-600x311.png\" loading=\"lazy\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/encryption.drawio.png\" alt=\"\" class=\"wp-image-53639\" width=\"680\" height=\"352\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/encryption.drawio.png 680w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/encryption.drawio-300x155.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/encryption.drawio-600x311.png 600w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/a><figcaption>New KONNI samples now uses AES encryption for string protection<\/figcaption><\/figure>\n<\/div>\n<p>The reason behind that change is clear. As the key used for decryption is the service name, samples run by different service names will not work properly. Moreover, having only the sample <strong>without knowing the service name becomes useless<\/strong>, as these strings contain core information about the sample behavior. <\/p>\n<h2>Files are also protected using AES<\/h2>\n<p>KONNI Rat makes use of various support files when it is executed. One of these files is the .ini file, which contains the primary C&amp;C server, but there are others like the .dat file that is supposed to be dropped eventually, and temporal files that are used to send some basic information about the computer.<\/p>\n<p>Our tests reveal that all of these files are dropped and protected using AES. Cleverly, they reused the algorithm used for string protection, making the file layout identical to the protected strings layout, as they appear in raw memory:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/filelayout.drawio.png\" data-rel=\"lightbox-image-5\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"53640\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/01\/konni-evolves-into-stealthier-rat\/attachment\/filelayout-drawio\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/filelayout.drawio.png\" data-orig-size=\"592,143\" data-comments-opened=\"1\" 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=\"filelayout.drawio\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/filelayout.drawio-300x72.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/filelayout.drawio.png\" loading=\"lazy\" width=\"592\" height=\"143\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/filelayout.drawio.png\" alt=\"\" class=\"wp-image-53640\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/filelayout.drawio.png 592w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/filelayout.drawio-300x72.png 300w\" sizes=\"auto, (max-width: 592px) 100vw, 592px\" \/><\/a><figcaption>New KONNI samples now uses AES encryption also for file protection<\/figcaption><\/figure>\n<\/div>\n<p>As can be seen from the diagram, the file itself contains the IV and the encrypted data. The key used is extracted from its original filename. In some cases, the names match with the service name, so the keys used in the .ini and the .dat files are the result of applying a SHA256 to the service name as well.<\/p>\n<p>Also, files sent to the C&amp;C server are protected using AES. The IV is generated using a QueryPerformanceCounter API CALL. Filenames are generated concatenating 2 letters that represent the data with the current timestamp, followed by the extension. Furthermore, they will use this newly generated name as AES key, so they send this name through the request to the C&amp;C server.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-25.png\" data-rel=\"lightbox-image-6\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"53642\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/01\/konni-evolves-into-stealthier-rat\/attachment\/untitled-25\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-25.png\" data-orig-size=\"754,79\" data-comments-opened=\"1\" 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=\"Untitled-25\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-25-300x31.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-25-600x63.png\" loading=\"lazy\" width=\"754\" height=\"79\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-25.png\" alt=\"\" class=\"wp-image-53642\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-25.png 754w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-25-300x31.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-25-600x63.png 600w\" sizes=\"auto, (max-width: 754px) 100vw, 754px\" \/><\/a><figcaption>Fragment of request about to be sent to the server<\/figcaption><\/figure>\n<\/div>\n<p>In that regard, as the filename is generated automatically using the timestamp, identical files will produce different request contents, as they were encrypted using that filename. <strong>Network signatures could also fail<\/strong> to detect the malicious activity, due to that.<\/p>\n<h2>Other obfuscation techniques<\/h2>\n<p>As we found some samples that were protected <em>just<\/em> by the means that we described before, we also have found others that were making use of an unidentified packer. We would like to share some of our notes regarding that packer, as others could find it useful in identification and attribution tasks.<\/p>\n<h3>Contiguous instruction obfuscation<\/h3>\n<p>The flow of the obfuscated program will make use of series of push-call pairs of instructions, where the pushed values will indicate the actions that the program will take. An image can better explain that:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/untitled13.png\" data-rel=\"lightbox-image-7\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"53690\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/01\/konni-evolves-into-stealthier-rat\/attachment\/untitled13\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/untitled13.png\" data-orig-size=\"774,337\" data-comments-opened=\"1\" 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=\"untitled13\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/untitled13-300x131.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/untitled13-600x261.png\" loading=\"lazy\" width=\"774\" height=\"337\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/untitled13.png\" alt=\"\" class=\"wp-image-53690\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/untitled13.png 774w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/untitled13-300x131.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/untitled13-600x261.png 600w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/untitled13-195x85.png 195w\" sizes=\"auto, (max-width: 774px) 100vw, 774px\" \/><\/a><figcaption>Push &#8211; Call series<\/figcaption><\/figure>\n<\/div>\n<p>In particular, we find it interesting that the attackers have placed random bytes between these pairs. This silly trick causes wrong code interpretation for decompilers that will assume that bytes after the push instruction are part of the next instruction. The image below shows how IDA fails in analyzing the code:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled11.png\" data-rel=\"lightbox-image-8\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"53691\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/01\/konni-evolves-into-stealthier-rat\/attachment\/untitled11\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled11.png\" data-orig-size=\"774,337\" data-comments-opened=\"1\" 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=\"Untitled11\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled11-300x131.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled11-600x261.png\" loading=\"lazy\" width=\"774\" height=\"337\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled11.png\" alt=\"\" class=\"wp-image-53691\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled11.png 774w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled11-300x131.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled11-600x261.png 600w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled11-195x85.png 195w\" sizes=\"auto, (max-width: 774px) 100vw, 774px\" \/><\/a><figcaption>Same code as before, showing how IDA won&#8217;t represent the real code<\/figcaption><\/figure>\n<\/div>\n<h3>Obfuscated program flow<\/h3>\n<p>The used packer will obfuscate the original program flow. This is accomplished in various steps. The first required step is to find the Image Base value, placed in a fixed location and the RIP (Instruction Pointer) value.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-44.png\" data-rel=\"lightbox-image-9\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"53692\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/01\/konni-evolves-into-stealthier-rat\/attachment\/untitled-44\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-44.png\" data-orig-size=\"920,112\" data-comments-opened=\"1\" 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=\"Untitled-44\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-44-300x37.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-44-600x73.png\" loading=\"lazy\" width=\"920\" height=\"112\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-44.png\" alt=\"\" class=\"wp-image-53692\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-44.png 920w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-44-300x37.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-44-600x73.png 600w\" sizes=\"auto, (max-width: 920px) 100vw, 920px\" \/><\/a><figcaption>EBX will save the RIP value<\/figcaption><\/figure>\n<\/div>\n<p>Once the packer knows these two values, it will start jumping from one place to another, making analysis harder. For that, it will store in some register value of the next address to jump in registers. The value of these registers is calculated right after the jmp instruction, using structures like POP [reg] &#8211; JMP [reg] or ADD [reg1, reg2] &#8211; JMP [reg1]. Note that decompilers will fail in displaying the real flow, as the jumping address is determined by a somehow undefined register.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-55.png\" data-rel=\"lightbox-image-10\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"53693\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/01\/konni-evolves-into-stealthier-rat\/attachment\/untitled-55\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-55.png\" data-orig-size=\"333,483\" data-comments-opened=\"1\" 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=\"Untitled-55\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-55-207x300.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-55.png\" loading=\"lazy\" width=\"333\" height=\"483\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-55.png\" alt=\"\" class=\"wp-image-53693\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-55.png 333w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-55-207x300.png 207w\" sizes=\"auto, (max-width: 333px) 100vw, 333px\" \/><\/a><figcaption>Obfuscated code showing a final jmp to RBX<\/figcaption><\/figure>\n<\/div>\n<p>The combination of these simple techniques ends in the packer being now in control of the flow, but statically the decompiler cannot represent the path that the code will follow. Finally, the packer will execute a big amount of junk instructions and eventually will execute the real interesting code. For instance, the original code will take no more than 20 instructions between GetProcAddress calls in IAT building tasks. but the packed code executes more than 30,000 instructions.<\/p>\n<p>According to our threat intel data, most recent attacks are not making use of that packer anymore.<\/p>\n<h2>Conclusion<\/h2>\n<p>As we have seen, KONNI Rat is far from being abandoned. The authors are constantly making code improvements. In our point of view, their efforts are aimed at breaking the typical flow recorded by sandboxes and making detection harder, especially via regular signatures as critical parts of the executable are now encrypted.<\/p>\n<p>Malwarebytes users are protected against this attack.<\/p>\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-14-1.png\" data-rel=\"lightbox-image-11\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" data-attachment-id=\"53913\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/01\/konni-evolves-into-stealthier-rat\/attachment\/untitled-14-1\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-14-1.png\" data-orig-size=\"357,255\" data-comments-opened=\"1\" 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=\"Untitled-14-1\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-14-1-300x214.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-14-1.png\" loading=\"lazy\" width=\"357\" height=\"255\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-14-1.png\" alt=\"\" class=\"wp-image-53913\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-14-1.png 357w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2022\/01\/Untitled-14-1-300x214.png 300w\" sizes=\"auto, (max-width: 357px) 100vw, 357px\" \/><\/a><\/figure>\n<h2>IOCs<\/h2>\n<p>A3CD08AFD7317D1619FBA83C109F268B4B60429B4EB7C97FC274F92FF4FE17A2<br \/>F702DFDDBC5B4F1D5A5A9DB0A2C013900D30515E69A09420A7C3F6EAAC901B12<\/p>\n<p>The post <a rel=\"nofollow\" href=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/01\/konni-evolves-into-stealthier-rat\/\">KONNI evolves into stealthier RAT<\/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\/01\/konni-evolves-into-stealthier-rat\/\" target=\"bwo\" >https:\/\/blog.malwarebytes.com\/feed\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><strong>Credit to Author: Threat Intelligence Team| Date: Wed, 26 Jan 2022 18:47:58 +0000<\/strong><\/p>\n<table cellpadding='10'>\n<tr>\n<td valign='top' align='center'><a href='https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/01\/konni-evolves-into-stealthier-rat\/' title='KONNI evolves into stealthier RAT'><img src='https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2014\/05\/photodune-2835222-computer-mouse-m.jpg' border='0'  width='300px'  \/><\/a><\/td>\n<\/tr>\n<tr>\n<td valign='top' align='left'>While Kimsuky is very active, the KONNI RAT has also been upgraded to a more evasive piece of malware.<\/p>\n<p>Categories: <a href=\"https:\/\/blog.malwarebytes.com\/category\/threat-intelligence\/\" rel=\"category tag\">Threat Intelligence<\/a><\/p>\n<p>Tags: <a href=\"https:\/\/blog.malwarebytes.com\/tag\/kimsuky\/\" rel=\"tag\">Kimsuky<\/a><a href=\"https:\/\/blog.malwarebytes.com\/tag\/konni\/\" rel=\"tag\">konni<\/a><a href=\"https:\/\/blog.malwarebytes.com\/tag\/rat\/\" rel=\"tag\">rat<\/a><\/p>\n<table width='100%'>\n<tr>\n<td align=right>\n<p><b>(<a href='https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/01\/konni-evolves-into-stealthier-rat\/' title='KONNI evolves into stealthier RAT'>Read more&#8230;<\/a>)<\/b><\/p>\n<\/td>\n<\/tr>\n<\/table>\n<\/td>\n<\/tr>\n<\/table>\n<p>The post <a rel=\"nofollow\" href=\"https:\/\/blog.malwarebytes.com\/threat-intelligence\/2022\/01\/konni-evolves-into-stealthier-rat\/\">KONNI evolves into stealthier RAT<\/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":[24741,24742,1810,12040],"class_list":["post-18133","post","type-post","status-publish","format-standard","hentry","category-malwarebytes","category-security","tag-kimsuky","tag-konni","tag-rat","tag-threat-intelligence"],"_links":{"self":[{"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/18133","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/comments?post=18133"}],"version-history":[{"count":0,"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/18133\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/media?parent=18133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/categories?post=18133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/tags?post=18133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}