Work function – Ghidra
The malware allocates a 708-byte (0x2c4) memory region using GlobalAlloc [1] and subsequently alters its permissions to Read/Write/Execute (RWX) using VirtualProtect [2].
The sample then reconstructs an embedded payload within that buffer. The payload is decoded through a custom transformation [3] followed by a position-dependent XOR decryption stage.
Once reconstruction is complete, the buffer is cast to a function pointer [4] and executed directly, resulting in in-memory shellcode execution without writing the decoded payload to disk.
Threat intelligence indicated this might be a Meterpreter C2, though initial dynamic analysis attempts were staggered by various anti-analysis and defence evasion capabilities. Rather than burning time bypassing these protections in a debugger, it was much faster to pivot the analysis and extract the IOCs statically using the information already available within the binary.
This is a prime example of when the sample can do the work for us. Using a quick Python script to reconstruct the bytes: