Peeling Back the Layers of PowerShell Loader

Tracing a Multi-Stage Windows Payload Chain


Aryaka Threat Research Lab investigates a multi-stage Windows malware infection chain initiated by a PowerShell loader that retrieves and executes a concealed native payload. The analysis reveals how privilege escalation, deceptive Microsoft Activation Scripts (MAS) activity, randomized file execution, and delayed cleanup combine to obscure malicious activity.

The native payload performs extensive environment and anti-analysis checks before proceeding to persistence and runtime payload reconstruction. It establishes persistence through a Windows service running under the LocalSystem account and uses layered cryptographic transformations—including HKDF, RC4, ChaCha20-Poly1305, AES-256-GCM, and AES-256-CBC—to reconstruct approximately 4.19 MiB of runtime data.

Reverse engineering reveals private-memory staging, executable memory protection changes, and thread-based execution. An alternate module-stomping capability was also identified, although it was not observed during natural execution. Network analysis correlates the payload download from srv.conti.pk with the separate MAS-related connection to get.activated.win.

This report combines static analysis, dynamic debugging, process monitoring, and network evidence to explain the infection chain, distinguish observed behavior from inferred capabilities, and identify actionable detection opportunities. It also explores how Aryaka’s Unified SASE security capabilities can help correlate suspicious endpoint and network activity to detect memory-staged threats.

Key Insights You’ll Gain from This Report

  • PowerShell loader behavior: Privilege validation, elevation, and hidden execution.
  • Deceptive execution paths: How MAS activity runs alongside payload delivery.
  • Payload retrieval: HTTPS downloads, PE validation, and randomized filenames.
  • Anti-analysis techniques: Environment scoring, debugger detection, and virtualization checks.
  • Persistence mechanisms: Windows service installation and LocalSystem execution.
  • Layered cryptography: HKDF and four cryptographic transformation techniques.
  • Memory-based execution: VirtualAlloc, VirtualProtect, and CreateThread.
  • Module stomping: Understanding an alternative, unobserved staging capability.
  • Network forensics: Correlating domains, TLS traffic, HTTP responses, and payload artifacts.
  • Detection opportunities: Identifying suspicious PowerShell, service creation, executable memory transitions, and correlated network activity.