Huntress Traces Multi-Stage PowerShell Malware to a Cobalt Strike Beacon

· Original article ↗

Summary

Huntress analysts traced a phishing-delivered maldocx through PowerShell environment-variable persistence, encoded and encrypted scripts, and .NET/RunPE stages to a Cobalt Strike beacon running under Notepad.

Key points

  • The reported infection path begins with a phishing-delivered maldocx and an executable; some variants use JavaScript and WScript before PowerShell.
  • PowerShell establishes persistence in the user’s Run key and uses environment variables and registry values to retrieve further stages.
  • The scripts use Base64 encoding, AES encryption, and compression, with repeated decoding and decryption stages.
  • A payload downloaded from Discord was decoded into a .NET loader containing a further stage identified as RunPE.exe.
  • The investigation describes API unhooking and a Notepad.exe process; Huntress identified the process as a Cobalt Strike beacon.
  • The article reports C2 information at organitations[.]com/Preserve/stat/3E8YZFXJ and IP address 69.28.84.201.
  • Huntress advises removing the beacon process and identifies additional user registry keys for cleanup.

Article Details

Attack Vectors
  • A phishing email delivers a maldocx; the reported execution chain includes JavaScript via Wscript, PowerShell, and a Cobalt Strike beacon.
  • PowerShell uses environment-variable values and registry Run-key persistence to launch successive encoded and encrypted payload stages.
  • A payload is downloaded from Discord, decoded, and used to launch subsequent stages, including a RunPE.exe payload associated with a Notepad.exe process.
Defensive Notes
  • Huntress recommends checking for PowerShell autoruns that call GetEnvironmentVariable and for 12–18-character hexadecimal values in the command line.
  • Review HKU\SID\SOFTWARE\Microsoft\Windows\CurrentVersion\Run, HKU\SID\Environment, and the associated HKU\SID\Software\<value> registry location; the article says the additional registry keys should be included in the customer report for removal.
  • Investigate Notepad.exe spawned by PowerShell and remove the process identified in the article as a Cobalt Strike beacon.
  • The article provides searches for PowerShell GetEnvironmentVariable activity, Notepad.exe with a PowerShell parent, and process cleartext containing cdn.discordapp.com and attachments.

Indicators of compromise

TypeIndicatorContext
IPV469[.]28[.]84[.]201IP address reported alongside the malware's C2 address.
URLhxxps[:]//cdn[.]discordapp[.]com/attachments/1004902785772441697/1004915801771495495/pppDiscord-hosted payload URL listed in the article's Discord URLs section.
URLhxxps[:]//cdn[.]discordapp[.]com/attachments/1013559875034415135/1014369421629857882/sdwwcKkjnwsdw.mkvDiscord-hosted payload URL listed in the article's Discord URLs section.

MITRE ATT&CK

People

Products

Tools

Related Articles