{"id":4772,"date":"2025-06-20T10:02:06","date_gmt":"2025-06-20T10:02:06","guid":{"rendered":"https:\/\/serisec.com\/index.php\/2025\/06\/20\/powershell-loaders-with-in-memory-execution-techniques-to-evade-disk-based-detection\/"},"modified":"2025-06-20T10:02:06","modified_gmt":"2025-06-20T10:02:06","slug":"powershell-loaders-with-in-memory-execution-techniques-to-evade-disk-based-detection","status":"publish","type":"post","link":"https:\/\/serisec.com\/index.php\/2025\/06\/20\/powershell-loaders-with-in-memory-execution-techniques-to-evade-disk-based-detection\/","title":{"rendered":"PowerShell Loaders With In-Memory Execution Techniques To Evade Disk-Based Detection"},"content":{"rendered":"<p>    PowerShell Loaders With In-Memory Execution Techniques To Evade Disk-Based Detection<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>Cybersecurity researchers have uncovered a sophisticated PowerShell-based attack campaign that leverages advanced in-memory execution techniques to bypass traditional disk-based security controls.<\/p>\n<p>The malicious infrastructure spans across Chinese, Russian, and global hosting providers, demonstrating the international scope of modern cyber threats.<\/p>\n<p>At the center of this campaign lies a deceptively simple 4KB PowerShell script designated as y1.ps1, which serves as a shellcode loader capable of executing malicious payloads entirely within system memory, leaving minimal forensic traces for investigators.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEino-Rf9q7Jljd-3NttWkpoJ29ola9jxaTDj_-AicwtWUUVYHoJ471KPzU_2ThVw4uS5YjfLOfvYk6QaPPghfM1XX8PQ4SP-0i8zXDfkq9GQ2KKhyphenhyphenNIRbjzoLLCHB0b2GqpsoSlhkfTDFLUP81hQRJk_b4WdXQgjCcs-_l8kROpWyJkTOt5eZfhuc5c-xU\/s16000\/PowerShell%2520shellcode%2520loader%2520%28Source%2520-%2520Hunt.io%29.webp?ssl=1\" alt=\"\"><figcaption class=\"wp-element-caption\">PowerShell shellcode loader (Source \u2013 Hunt.io)<\/figcaption><\/figure>\n<\/div>\n<p>The attack begins with the PowerShell script being hosted in an open directory on a Chinese server with IP address 123.207.215.76, operated by Shenzhen Tencent Computer Systems Company Ltd. Hunt.io analysts identified this suspicious script during routine threat hunting operations on June 1, 2025, when it was discovered in an accessible web directory.<\/p>\n<p>The script\u2019s placement in an open directory suggests either poor operational security by the threat actors or a deliberate attempt to blend malicious content within seemingly legitimate file repositories.<\/p>\n<p>Hunt.io researchers <a href=\"https:\/\/hunt.io\/blog\/cobaltstrike-powershell-loader-chinese-russian-infrastructure\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">noted<\/a> that the PowerShell loader represents an active post-exploitation setup that combines multiple evasion techniques with established Cobalt Strike infrastructure.<\/p>\n<p>The script functions as a multi-stage delivery mechanism, first executing embedded <a href=\"https:\/\/cybersecuritynews.com\/new-sophisticated-malware-coffeeloader-bypasses-endpoint-security\/\" target=\"_blank\" rel=\"noreferrer noopener\">shellcode<\/a> that acts as a downloader, then establishing communication with a second-stage command-and-control server hosted on Baidu Cloud Function Compute platform.<\/p>\n<p>This cloud-based approach provides the attackers with both legitimacy and resilience, as traffic to major cloud providers typically generates less suspicion than connections to suspicious IP addresses.<\/p>\n<p>The final stage of the attack involves communication with a known <a href=\"https:\/\/cybersecuritynews.com\/linux-version-of-cobalt-strike-malware-targets-organization-worldwide\/\" target=\"_blank\" rel=\"noreferrer noopener\">Cobalt Strike<\/a> server located at IP address 46.173.27.142, associated with Beget LLC in Russia.<\/p>\n<p>Analysis of SSL certificate metadata reveals telling indicators, with the certificate subject listed as \u201cMajor Cobalt Strike\u201d and the issuer organization identified as \u201ccobaltstrike,\u201d providing clear attribution to the popular post-exploitation framework.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEgKrrQCVb8yKP2UjMqWDFCj9LvZazpZRBtDfBxarHgB7dImCn05Lw3GHyS8RyzGPTFtATLBrRg2I4zBksEOAhsWxIaVhcPCkQFj_RUnoZRcJgJWy2kKJb15P_rRAYAzS4pBuiEqTeXrJ-c4pgGqgEyzZAgx2lWO21rF4TQq-PPPxmTpylkrr2T0I194ihA\/s16000\/PowerShell%2520script%2520that%2520decrypted%2520the%2520Cobalt%2520Strike%2520loader%2520%28Source%2520-%2520Hunt.io%29.webp?ssl=1\" alt=\"\"><figcaption class=\"wp-element-caption\">PowerShell script that decrypted the Cobalt Strike loader (Source \u2013 Hunt.io)<\/figcaption><\/figure>\n<\/div>\n<p>This infrastructure pattern suggests the involvement of threat actors leveraging either legitimate or cracked versions of Cobalt Strike for their operations.<\/p>\n<p>The global reach of this <a href=\"https:\/\/cybersecuritynews.com\/new-phishing-campaign-attacking-investors\/\" target=\"_blank\" rel=\"noreferrer noopener\">campaign<\/a> extends beyond Chinese and Russian infrastructure, with researchers identifying supporting servers in the United States, Singapore, and Hong Kong.<\/p>\n<p>This distributed approach indicates sophisticated planning and resource allocation, allowing the threat actors to maintain operational continuity even if portions of their infrastructure are disrupted or blocked by security controls.<\/p>\n<h2 class=\"wp-block-heading\"><strong>Technical Mechanism: In-Memory Execution and Evasion Techniques<\/strong><\/h2>\n<p>The technical sophistication of this PowerShell loader lies in its seamless integration of multiple evasion techniques designed to circumvent modern security controls.<\/p>\n<p>The script begins by enabling PowerShell\u2019s strict mode to ensure clean execution, then defines two critical functions: func_get_proc_address and func_get_delegate_type.<\/p>\n<p>These functions work in tandem to retrieve memory addresses of <a href=\"https:\/\/cybersecuritynews.com\/ako-ransomware-abusing-windows-api-calls\/\" target=\"_blank\" rel=\"noreferrer noopener\">Windows API<\/a> functions from loaded DLLs using reflection techniques, then dynamically create delegates to call these functions directly in memory without traditional API calls that security tools typically monitor.<\/p>\n<p>The embedded payload undergoes a two-stage decryption process that further complicates detection efforts.<\/p>\n<p>Initially stored as a Base64-encoded byte array within the script, the payload is decoded and then decrypted using XOR operations with a hardcoded key value of 35.<\/p>\n<p>This decrypted shellcode is subsequently loaded into executable memory allocated via VirtualAlloc API calls, allowing the malicious code to run without ever touching the disk in its final form.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEh2kNsSQ9EbJ3aSLVCb32DvObO5AbzuhCzm8raZLtUUHRbMPRMxnPTLNd1GJafzRv1smvo6kZH3bpMAuBxQE9ZlO4Wxvmtw24AQlBQmVykv_IKCci71PIxVi6ZaWzAJ-VMrTRNad4-afWeiE7yHP0hZCtgFdMSY-uM0NpkHOy_eOp3yFn6oP14qyIq2lGs\/s16000\/API%2520hashing%2520technique%2520used%2520by%2520shellcode%2520%28Source%2520-%2520Hunt.io%29.webp?ssl=1\" alt=\"\"><figcaption class=\"wp-element-caption\">API hashing technique used by shellcode (Source \u2013 Hunt.io)<\/figcaption><\/figure>\n<\/div>\n<p>Perhaps most notably, the shellcode implements an advanced API hashing technique to <a href=\"https:\/\/cybersecuritynews.com\/highly-obfuscated-net-sectoprat\/\" target=\"_blank\" rel=\"noreferrer noopener\">obfuscate<\/a> its function calls and evade signature-based detection systems.<\/p>\n<p>Rather than directly referencing Windows API function names, the malware calculates unique hash values for each required function by processing each character of the function name, converting it to uppercase for case-insensitivity, rotating the accumulated hash value 13 bits to the right, and adding the character\u2019s ASCII value.<\/p>\n<p>This continues until the entire function name is processed, producing a unique hash that completely obscures the original API call from static analysis tools.<\/p>\n<p class=\"has-text-align-center has-background\" style=\"background:linear-gradient(180deg,rgb(238,238,238) 90%,rgb(169,184,195) 100%)\"><strong><strong><strong><code>Are you from SOC\/DFIR Teams! - Interact with malware in the sandbox and find related IOCs. -\u00a0<a href=\"https:\/\/any.run\/demo\/?utm_source=csn_jun&amp;utm_medium=article&amp;utm_campaign=threat_hunting_tips&amp;utm_term=190625&amp;utm_content=linktodemo\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Request 14-day free trial<\/a><\/code><\/strong><\/strong><\/strong><\/p>\n<p>The post <a href=\"https:\/\/cybersecuritynews.com\/powershell-loaders-with-in-memory-execution-techniques\/\">PowerShell Loaders With In-Memory Execution Techniques To Evade Disk-Based Detection<\/a> appeared first on <a href=\"https:\/\/cybersecuritynews.com\/\">Cyber Security News<\/a>.<\/p>\n<\/div>\n<p> \t<BR><br \/>\n <BR><\/BR><br \/>\n    Tushar Subhra Dutta<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n<a href=\"https:\/\/cybersecuritynews.com\/powershell-loaders-with-in-memory-execution-techniques\/\">Go to cyber-security-news<\/a><br \/>\n \t<BR><br \/>\n <BR><\/BR><\/p>\n","protected":false},"excerpt":{"rendered":"<p>PowerShell Loaders With In-Memory Execution Techniques To Evade Disk-Based Detection Cybersecurity researchers have uncovered a sophisticated PowerShell-based attack campaign that leverages advanced in-memory execution techniques to bypass traditional disk-based security controls. The malicious infrastructure spans across Chinese, Russian, and global hosting providers, demonstrating the international scope of modern cyber threats. At the center of this [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[129,63,649],"tags":[130],"class_list":["post-4772","post","type-post","status-publish","format-standard","hentry","category-cyber-security","category-cyber-security-news","category-threats","tag-cyber-security-news"],"_links":{"self":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts\/4772"}],"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=4772"}],"version-history":[{"count":0,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts\/4772\/revisions"}],"wp:attachment":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/media?parent=4772"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/categories?post=4772"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/tags?post=4772"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}