Patchwork APT Using PowerShell to Create Scheduled Tasks and Retrieve the Final Payload

Patchwork APT, also known as Dropping Elephant, Monsoon, and Hangover Group, has sharpened its espionage toolkit with a sophisticated PowerShell–based loader that leverages scheduled tasks and multi-stage obfuscation to maintain persistence and stealth.

Active since at least 2015, this group continues to target political and military organizations across South and Southeast Asia, relying on social engineering and custom lures rather than novel zero-day exploits.

Powershell Script

Macro Drops Malicious LNK and PowerShell Loader

A spear-phishing document deploys a malicious macro that downloads an LNK file. When the victim launches this shortcut, the embedded PowerShell script executes a sequence of commands to:

  • Download an executable from a malicious URL and save it as C:\Windows\Tasks\vlc.exe, masquerading as the legitimate VLC media player.
  • Fetch a companion DLL named libvlc.dll into the same Tasks folder for side-loading, enabling the fake VLC executable to avoid suspicion.
  • Retrieve a Decoy PDF and store it in the Public folder to reassure users that nothing is amiss.
  • Create a Scheduled Task named “WindowsErrorReport” pointing to vlc.exe, ensuring the loader runs persistently.
  • Finally, pull down the MSIL-compiled final payload, which establishes the command-and-control (C2) connection.
fstage method
fstage method

Once the fake VLC executable runs, it invokes the fStage method to initiate encrypted communication with the attacker’s server (Program.muri).

The client ID (Cid) is first XOR-obfuscated with a hardcoded key (“eOvstoxSBbZGWsTtknc”), then base64-encoded, and further scrambled using the Protean obfuscator. This payload is sent as form data via HTTPS POST over TLS 1.2.

The server’s base64-encoded response is XOR-decrypted to yield acc.xkey, a session key stored for subsequent stages.

The SStage method collects system details, OS version, MAC address, username, working directory, admin status, process ID, unique client ID, and public IP, each encrypted with xop and base64 before Protean scrambling.

Simultaneously, bkj() uses WMI to enumerate installed applications (Win32_Product) and antivirus products (SecurityCenter2), packaging this information under the same obfuscation layers and dispatching it to the C2.

Dynamic Command Execution and Data Exfiltration

The _getCommand routine mimics legitimate web form traffic and requests commands via POST (sltrg=pap). Responses undergo multi-layer deobfuscation, including custom Charm decoding, base64 decoding, and XOR decryption with the session key. If extraction fails, the loader retries up to 20 times with delays.

Mimic the traffic
Mimic the traffic

For exfiltration, the loader uses Scourgify encoding to prepare command outputs, attaches a unique session ID, and posts the data to the C2. The CDM method spawns a hidden cmd.exe process to execute attacker-supplied commands, captures stdout and stderr, and relays results via the _sendResult function.

File transfers utilize dfile and ufile methods: dfile downloads and decodes files for execution or memory loading; ufile reads large files in 1 MB chunks, base64-encodes and Protean-obfuscates each block, and uploads them sequentially.

The v_alloc method allocates executable memory, copies shellcode, and spawns a thread to execute it without requiring disk access. The scrt screenshot routine captures all monitors, uploads images, then deletes local copies, retrying on failure.

This multi-layered architecture, combining scheduled tasks, DLL side-loading, encrypted POST communication, memory injection, and stealthy exfiltration, exemplifies Patchwork’s persistent and adaptive approach.

Organizations should ensure that endpoint security solutions, such as K7 Total Security, are up to date, enforce strict macro-execution policies, and monitor anomalous scheduled tasks to thwart advanced espionage campaigns.

Find this Story Interesting! Follow us on Google News , LinkedIn and X to Get More Instant Updates

Priya
Priya
Priya is a Security Reporter who tracks malware campaigns, exploit kits, and ransomware operations. Her reporting highlights technical indicators and attack patterns that matter to defenders

Trending News

Related Stories