Huntress Analyzes a PowerShell Launcher That Executes Shellcode

· Original article ↗

Summary

Huntress dissects a hidden batch and PowerShell launcher that decodes a Base64-encoded, GZIP-compressed payload, allocates memory for shellcode, and runs it in a new thread. The shellcode itself was not analyzed.

Key points

  • A Windows batch script uses cmd.exe to start PowerShell with its window hidden, without a startup profile, and in non-interactive mode.
  • The launcher checks the system architecture to select a PowerShell path, then decodes and decompresses an embedded Base64 payload at runtime.
  • Obfuscated PowerShell uses reflection and delegates to locate and call Win32 API functions.
  • The script uses VirtualAlloc to create readable, writable, and executable memory, copies shellcode into it, and runs it with CreateThread.
  • The article does not analyze what the shellcode does; it recommends further behavioral monitoring or analysis in a contained sandbox.
  • AppLocker or PowerShell Constrained Language Mode may block execution of the initial launcher, according to the article.

Article Details

Attack Vectors
  • A Windows batch script launches PowerShell through cmd.exe, using arguments that suppress visible windows.
  • The launcher decodes a Base64-encoded, GZIP-compressed PowerShell payload and executes it.
  • The PowerShell payload uses Win32 API calls to allocate executable memory, copy shellcode into it, and execute it in a new thread.
Defensive Notes
  • The article recommends enabling AppLocker or PowerShell Constrained Language Mode to block execution of the initial launcher.

MITRE ATT&CK

Products

Related Articles