{"id":13687,"date":"2026-06-18T04:03:40","date_gmt":"2026-06-18T04:03:40","guid":{"rendered":"https:\/\/serisec.com\/index.php\/2026\/06\/18\/33080\/"},"modified":"2026-06-18T04:03:40","modified_gmt":"2026-06-18T04:03:40","slug":"33080","status":"publish","type":"post","link":"https:\/\/serisec.com\/index.php\/2026\/06\/18\/33080\/","title":{"rendered":"From a VHDX File to a Remcos RAT, (Tue, Jun 16th)"},"content":{"rendered":"<p>    From a VHDX File to a Remcos RAT, (Tue, Jun 16th)<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n    <!-- no image --><br \/>\n \t<BR><br \/>\n<BR><\/BR><\/p>\n<div>\n<p>Yesterday, a reader reported to us a malicious ZIP archive (SHA256: a0104921a2d37ab87482ac9a9f5c3713479c118846c3e999178e75b81620c094[<a href=\"https:\/\/www.virustotal.com\/gui\/file\/a0104921a2d37ab87482ac9a9f5c3713479c118846c3e999178e75b81620c094\">1<\/a>]). Once unzipped, it contains\u00a0a VHDX file that discloses\u00a0a malicious JavaScript after being mounted (which is automatic on modern Windows OSs):<\/p>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" alt=\"\" src=\"https:\/\/i0.wp.com\/isc.sans.edu\/diaryimages\/images\/isc-20260616-1.png?ssl=1\" style=\"width: 799px; height: 302px;\"><\/p>\n<p>Two different techniques to hide the payload help to bypass most first-line security controls. Using a disk image as a &#8220;malware container&#8221;\u00a0has been used multiple times in the past[<a href=\"https:\/\/isc.sans.edu\/diary\/obama224+distribution+Qakbot+tries+vhd+virtual+hard+disk+images\/29294\">2<\/a>] but seemed to be less used these days. That\u2019s why I decided to have a look at the JavaScript (SHA256:f65b1271deedcbcbcdd750047f8eb3a5548145546fc2b7847b263a5e52570b33[<a href=\"https:\/\/www.virustotal.com\/gui\/file\/f65b1271deedcbcbcdd750047f8eb3a5548145546fc2b7847b263a5e52570b33\">3<\/a>]) with a low VT score (only 5\/57). Called \u201cPartnerschaft_fur_neue_Angebotsanfrage.js\u201d (\u201cPartnership for new quotation request\u201d), it probably targets German speaking victims. It contains three stages to deliver the last piece of malware.<\/p>\n<p>In the first stage, the JavaScript (obfuscated and hidden in many comments) will launch a PowerShell script through WMI:<\/p>\n<pre style=\"background: rgb(238, 238, 238); border: 1px solid rgb(204, 204, 204); padding: 5px 10px;\">\nWbemScripting.SWbemLocator \u2192 ConnectServer() \u2192 Win32_Process.Create()<\/pre>\n<p>This technique helps to bypass EDR solutions as well as classic detection rules that monitor parent-child relationships in processes. JavaScript \u2192\u00a0WMI \u2192\u00a0PowerShell is less suspicious than a direct relation JavaScript \u2192\u00a0PowerShell.<\/p>\n<p>The PowerShell script is reconstructed from many strings concatenations and stored in &#8220;%LOCALAPPDATA%Tamale&#8221;:<\/p>\n<p>\u00a0<\/p>\n<pre style=\"background: rgb(238, 238, 238); border: 1px solid rgb(204, 204, 204); padding: 5px 10px;\">\nFdselsdatoen = Fdselsdatoen + \"bubbleFFBVM0lNDgMWDREb' 1;$filmproducbubblentbubblers=otidiform 'DQsSABgGBw0lCBgM';$flygtningbubblelandsbybubbler=otidiform 'bRcOBwcCHw0NC\";\nFdselsdatoen = Fdselsdatoen + \"BoOChwPCTpKQQgdBQsZEQ4QHAwLDxgsFhZAPQcQBggEXE0JAgUJIBcAAFhNFRwAAgEFCgAVADBN';$succulbubblently=$pritchbubblel;otidiform 'bQMJARYIClMTExEa\";\nFdselsdatoen = Fdselsdatoen + \"DRcVCTsNBAIYEFdYW1xcPQodFUEZBREGVE0VHAACAQUKABUAME0=' 1;whilbubble (!$prbubblesbytbubblerially118) {otidiform 'bQMJARYIClMwFREfCgoOHi\";\n...<\/pre>\n<p>The string \u201cbubble\u201d pollutes the code and is removed during execution..<\/p>\n<p>This second stage PowerShell reconstructs strings by picking every 4th character from garbage strings. There is a function \u201cotidiform\u201d that decrypts Base64-encoded strings with the XOR key \u201cIdentificational\u201d (always the same key across all the scripts). Example:<\/p>\n<pre style=\"background: rgb(238, 238, 238); border: 1px solid rgb(204, 204, 204); padding: 5px 10px;\">\notidiform 'bQMJARYIClMWDxIAHAYNBSIBWDU1ChIAFQAABh0zW1YKFgAPAAwvBxAVFQcMC0lILwsXAxEHA0A=' 1<\/pre>\n<p>Returns:<\/p>\n<pre style=\"background: rgb(238, 238, 238); border: 1px solid rgb(204, 204, 204); padding: 5px 10px;\">\n$global:unfishlike=[Activator]::CreateInstance($formene)<\/pre>\n<p>The script downloads the next stage from:<\/p>\n<pre style=\"background: rgb(238, 238, 238); border: 1px solid rgb(204, 204, 204); padding: 5px 10px;\">\nhxxps:\/\/cembusconfort[.]ro\/Exoticisms121.dsp<\/pre>\n<p>and saves it to %APPDATA%Endocoel.Pro.<\/p>\n<p>This file (SHA256:9de90481e57ed0bc0f13bb24747e18cc133f497abe05cfac67517f98098048a1[<a href=\"https:\/\/www.virustotal.com\/gui\/file\/9de90481e57ed0bc0f13bb24747e18cc133f497abe05cfac67517f98098048a1\/content\">4<\/a>]) looks interesting. When you have a first look at it, it seems to be encrypted. The classic behavior is to XOR and encode in Base64 the payload. Here it\u2019s a bit different, the next stage script has been appended at the end of the file. The payload is extracted by carving the interesting code with:<\/p>\n<pre style=\"background: rgb(238, 238, 238); border: 1px solid rgb(204, 204, 204); padding: 5px 10px;\">\n.substring(143578, 20305)<\/pre>\n<p>Once extracted the stage 3 is executed and use the first part of the file as payload (the first 143577 bytes). This stage is a PowerShell reflective .Net loader (classic behaviour) using\u00a0System.Reflection.Assembly.Load(). The shellcode will fetch the malware itself from:<\/p>\n<pre style=\"background: rgb(238, 238, 238); border: 1px solid rgb(204, 204, 204); padding: 5px 10px;\">\nhxxps:\/\/cembusconfort[.]ro\/YoHtJ27.bin<\/pre>\n<p>The malware will be injected in a process &#8220;backgroundTaskHost.exe&#8221; and communicates with the C2 server:<\/p>\n<pre style=\"background: rgb(238, 238, 238); border: 1px solid rgb(204, 204, 204); padding: 5px 10px;\">\nanimal342[.]duckdns[.]org:53552<\/pre>\n<p>The traffic has been identified by my sanbox as Remcos, a pretty common RAT.<\/p>\n<p>Or course, persistence is configured via a Run key that executes the PowerShell loader:<\/p>\n<pre style=\"background: rgb(238, 238, 238); border: 1px solid rgb(204, 204, 204); padding: 5px 10px;\">\nC:WindowsSystem32cmd.exe\" \/c REG ADD \"HKCUSoftwareMicrosoftWindowsCurrentVersionRun\" \/f \/v \"Startup key\" \/t REG_EXPAND_SZ \/d \"%Statskirken% -windowstyle 2 $Lnforhandlinger=(.'gp' 'HKCU:SoftwareWeaverbird').'Pardonnerer';%Statskirken% ($Lnforhandlinger)\"<\/pre>\n<p>Most of the files used in this infection path remain undetected by most AVs. Here is the complete infection path:<\/p>\n<p>Email \u2192 ZIP\u00a0\u2192 VHDX\u00a0\u2192 JavaScript\u00a0\u2192 PowerShell Decoder \u2192 PowerShell (.Net Loader) \u2192 Shellcode (Downloader) \u2192 Remcos<\/p>\n<p>[1]\u00a0<a href=\"https:\/\/www.virustotal.com\/gui\/file\/a0104921a2d37ab87482ac9a9f5c3713479c118846c3e999178e75b81620c094\">https:\/\/www.virustotal.com\/gui\/file\/a0104921a2d37ab87482ac9a9f5c3713479c118846c3e999178e75b81620c094<\/a><br \/>\n[2]\u00a0<a href=\"https:\/\/isc.sans.edu\/diary\/obama224+distribution+Qakbot+tries+vhd+virtual+hard+disk+images\/29294\">https:\/\/isc.sans.edu\/diary\/obama224+distribution+Qakbot+tries+vhd+virtual+hard+disk+images\/29294<\/a><br \/>\n[3]\u00a0<a href=\"https:\/\/www.virustotal.com\/gui\/file\/f65b1271deedcbcbcdd750047f8eb3a5548145546fc2b7847b263a5e52570b33\">https:\/\/www.virustotal.com\/gui\/file\/f65b1271deedcbcbcdd750047f8eb3a5548145546fc2b7847b263a5e52570b33<\/a><br \/>\n[4]\u00a0<a href=\"https:\/\/www.virustotal.com\/gui\/file\/9de90481e57ed0bc0f13bb24747e18cc133f497abe05cfac67517f98098048a1\/content\">https:\/\/www.virustotal.com\/gui\/file\/9de90481e57ed0bc0f13bb24747e18cc133f497abe05cfac67517f98098048a1\/content<\/a>???????<\/p>\n<p><b>Xavier Mertens (@xme)<\/b><br \/>\nXameco<br \/>\nSenior ISC Handler &#8211; Freelance Cyber Security Consultant<br \/>\n<a href=\"https:\/\/raw.githubusercontent.com\/xme\/pgp\/refs\/heads\/main\/public.key\">PGP Key<\/a><\/p>\n<p> (c) SANS Internet Storm Center. https:\/\/isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.<\/p><\/div>\n<p> \t<BR><br \/>\n <BR><\/BR><\/p>\n<p> \t<BR><br \/>\n<BR><\/BR><br \/>\n<a href=\"https:\/\/isc.sans.edu\/diary\/rss\/33080\">Go to isc.sans.edu<\/a><br \/>\n \t<BR><br \/>\n <BR><\/BR><\/p>\n","protected":false},"excerpt":{"rendered":"<p>From a VHDX File to a Remcos RAT, (Tue, Jun 16th) Yesterday, a reader reported to us a malicious ZIP archive (SHA256: a0104921a2d37ab87482ac9a9f5c3713479c118846c3e999178e75b81620c094[1]). Once unzipped, it contains\u00a0a VHDX file that discloses\u00a0a malicious JavaScript after being mounted (which is automatic on modern Windows OSs): Two different techniques to hide the payload help to bypass most first-line [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[56],"tags":[69],"class_list":["post-13687","post","type-post","status-publish","format-standard","hentry","category-isc-sans-edu","tag-isc-sans-edu"],"_links":{"self":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts\/13687"}],"collection":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/comments?post=13687"}],"version-history":[{"count":0,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts\/13687\/revisions"}],"wp:attachment":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/media?parent=13687"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/categories?post=13687"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/tags?post=13687"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}