PowerShell Loader Uses In-Memory Execution to Deliver Cobalt Strike Beacon

· Original article ↗

Summary

Researchers traced a PowerShell shellcode loader found on an open directory to a Cobalt Strike Beacon. The loader used in-memory execution, API hashing, and a Baidu Cloud endpoint before connecting to a Russian C2 server.

Key points

  • The y1.ps1 loader was found in an open directory on a server in China and was first observed on June 1, 2025.
  • It decodes and XOR-decrypts embedded shellcode, then executes it in memory using dynamically resolved Windows APIs.
  • The shellcode uses API hashing, a forged browser User-Agent, and reflective DLL loading to hinder detection.
  • It contacts a second-stage server hosted on Baidu Cloud Function Compute and downloads a payload into executable memory.
  • The extracted Cobalt Strike Beacon configuration points to 46.173.27.142 on port 50050; SSL certificate metadata also indicated Cobalt Strike.
  • The researchers reported additional Cobalt Strike-related infrastructure across China, Russia, Singapore, Hong Kong, and the United States; attribution remains unclear.
  • Recommended defenses include PowerShell logging and restrictions, monitoring for in-memory execution and suspicious outbound traffic, and deploying the listed indicators.

Article Details

Attack Vectors
  • A malicious PowerShell script hosted in an open directory decodes and XOR-decrypts embedded shellcode, then executes it in memory.
  • The shellcode downloads a second-stage payload from a Baidu Cloud Function Compute endpoint and executes it from allocated memory.
  • The loader uses API hashing, reflective DLL loading, and a forged browser User-Agent string to hinder detection.
Defensive Notes
  • Restrict unsigned PowerShell scripts and enable PowerShell logging; monitor for suspicious commands and custom memory allocation.
  • Block the reported malicious IP addresses and Baidu Cloud endpoint, and monitor outbound traffic for forged browser User-Agent strings.
  • Use EDR capable of detecting in-memory execution and reflective DLL loading; enable Windows Defender Exploit Guard and ASR rules.
  • Monitor for SSL certificates with names such as "cobaltstrike," limit internet access from sensitive machines, and avoid running unknown scripts.

Indicators of compromise

TypeIndicatorContext
DOMAINy2n273y10j[.]cfc-execute[.]bj[.]baidubce[.]comReported second-stage C2 endpoint used by the shellcode to download a payload.
IPV4111[.]229[.]158[.]40Listed as a Cobalt Strike open-directory host.
IPV4114[.]116[.]50[.]214Listed as a Cobalt Strike open-directory host.
IPV4116[.]114[.]20[.]180Listed as a Cobalt Strike open-directory host.
IPV4121[.]37[.]66[.]33Listed as a Cobalt Strike open-directory host.
IPV4123[.]207[.]215[.]76Host of the malicious PowerShell script y1.ps1 in an open directory.
IPV4124[.]223[.]12[.]165Listed as a Cobalt Strike open-directory host.
IPV4124[.]71[.]137[.]28Listed as a Cobalt Strike open-directory host.
IPV4137[.]184[.]103[.]54Listed as a Cobalt Strike open-directory host.
IPV4146[.]190[.]72[.]88Listed as a Cobalt Strike open-directory host.
IPV4150[.]158[.]214[.]98Listed as a Cobalt Strike open-directory host.
IPV4167[.]71[.]215[.]63Listed as a Cobalt Strike open-directory host.
IPV4175[.]178[.]33[.]154Listed as a Cobalt Strike open-directory host.
IPV4182[.]92[.]76[.]239Listed as a Cobalt Strike open-directory host.
IPV4217[.]114[.]8[.]138Listed as a Cobalt Strike open-directory host.
IPV435[.]240[.]168[.]8Listed as a Cobalt Strike open-directory host.
IPV443[.]202[.]62[.]102Listed as a Cobalt Strike open-directory host.
IPV445[.]147[.]201[.]165Listed as a Cobalt Strike open-directory host.
IPV446[.]173[.]27[.]142Cobalt Strike Beacon C2 address extracted from the payload configuration.
IPV48[.]134[.]148[.]103Listed as a Cobalt Strike open-directory host.
IPV48[.]135[.]237[.]16Listed as a Cobalt Strike open-directory host.
IPV48[.]137[.]147[.]254Listed as a Cobalt Strike open-directory host.
IPV48[.]210[.]77[.]1Listed as a Cobalt Strike open-directory host.
IPV482[.]157[.]78[.]234Listed as a Cobalt Strike open-directory host.
SHA2561d4f814d06a3893545f51f1158d6677b1b083a90ab57ba03c58f8d26c29e5a10SHA-256 of a PowerShell script listed in the article's Cobalt Strike IOCs.
SHA2561f0f4415b738198cc82359212f3ead281b7eb38070163a7782584f77346e619fSHA-256 of a PowerShell script listed in the article's Cobalt Strike IOCs.
SHA25623a04d2ae94998b26c42c327f9344b784eb00d0a42c0ade353275bdedff9824fSHA-256 of a PowerShell script listed in the article's Cobalt Strike IOCs.
SHA25627f88c7005f33bfc67731cb732c7c72e0cea7f97db1f15bcf5880d3e7f7f85ebSHA-256 of a PowerShell script listed in the article's Cobalt Strike IOCs.
SHA25660652f62ec7772b611f3a62fd93d690e677b616e972a0444650f0a2ea597f77fSHA-256 of a PowerShell script listed in the article's Cobalt Strike IOCs.
SHA2566954005ab1b1d2deec940181674000e394f860fe4f626d6b0abf63453d5fff48SHA-256 of a PowerShell script listed in the article's Cobalt Strike IOCs.
SHA25669b1261eac205aefb6a5237ff3d87ef515e838184c1616ec935a4f7f4aa04ac1SHA-256 of a PowerShell script listed in the article's Cobalt Strike IOCs.
SHA256cdd757e92092b9a72dec0a7529219dd790226b82c69925c90e5d832955351b52SHA-256 of a PowerShell script listed in the article's Cobalt Strike IOCs.
SHA256ed2b7d55781414cdb3e0f64de6d9fea9bf282ee49e12b112f9e0748d5266fd60SHA-256 of a PowerShell script listed in the article's Cobalt Strike IOCs.

MITRE ATT&CK

Products

Tools

Countries

Related Articles