The VVS Stealer malware-as-a-service (MaaS), which targets Discord users and leverages the legitimate Pyarmor tool for obfuscation, was recently decoded for a technical analysis by Palo Alto Networks’ Unit 42.The analysis, published Friday, revealed new details about the stealer’s stealth methods and described how the malware targets Discord and browser data, including by injecting a script to intercept active Discord sessions.Pyarmor is a legitimate tool for obfuscating Python scripts, which the VVS Stealer developers used to prevent static and signature-based analysis of the malware.Files contained within the PyInstaller package the malware sample was distributed as revealed that the attackers used the Pro version of Pyarmor and also exposed their unique license number.Pyarmor uses AES-128-CTR encryption to obfuscate the Python bytecode; it also includes a mode called ByteCode-to-Compilation (BCC) that provides further obfuscation by converting most Python functions into their equivalent C functions, which are compiled into machine instructions and then called at runtime. These C functions are stored in a separate ELF file alongside the Pyarmor-protected bytecode, Palo Alto found.The researchers leveraged methods from the open-source Pyarmor Static Unpack One-Shot Tool, which is a fork of the pycdc Python bytecode decompiler, to help extract the necessary AES key and AES nonce to decrypt the obfuscated bytecode.The AES key is extracted from the Pyarmor runtime dynamic-link library included in the PyInstaller package and tied to each unique Pyarmor license number. The AES nonce, by contrast, is tied to each specific payload, and is XORed using 12 bytes at the end marker of the obfuscated bytecode.The researchers also used open-source Pyarmor v8+ tooling to map Python constants to BCC functions, helping them recover the original Python methods from the contents of the ELF file.Strings longer than eight characters were also found to be AES-128-CTR encrypted, using the same AES key, but a separate nonce retrieved from the Pyarmor runtime DLL using the Pyarmor Static Unpack One-Shot Tool. This nonce was specific to the unique license number, rather than the individual payload.
Threat Management, Identity, Ransomware, Data Security, Malware, Threat Intelligence, Encryption

Pyarmor-obfuscated VVS Stealer targets Discord, browser data

(Credit: ink drop – stock.adobe.com)

Related Events
Get daily email updates
SC Media's daily must-read of the most current and pressing daily news
You can skip this ad in 5 seconds



