PyInstaller-Packed Python Malware Unpacked to Reveal Ransomware and Stealer Payloads
Malware Intelligence · 3 sources · Updated 4mo ago · First seen Aug 10, 2024

Researchers detailed how PyInstaller-packed Python executables on both Windows and Linux can be reverse engineered to recover embedded bytecode and reconstruct malware logic. Fortinet showed that Windows samples built with Python 3.8 can be unpacked with pyinstxtractor and decompiled with uncompyle6, while Linux ELF samples may require dumping the pydata section before extraction and using Decompyle++ for Python 3.9 bytecode. In one Linux sample recovered from VirusTotal, the unpacked contents included RansomWare.pyc, indicating a ransomware payload, though some functions required bytecode disassembly or dynamic analysis because decompilation was incomplete.
Separate analysis of a PyInstaller-packed sample distributed through a Discord community recovered a multi-stage Python stealer that used Base64, junk code, XOR, AES-CBC, and compressed payloads to hide its final logic. The recovered stages ultimately decrypted and executed a Python payload associated with Creal Stealer and sent data to the attacker-controlled domain mgststudio.shop. Supporting documentation from the pyinstxtractor project also outlined the Linux ELF extraction process used to recover embedded Python files from packaged binaries.
Why it matters
Impact assessment
PyInstaller-packed Python malware affects Windows and Linux environments where users execute packaged Python binaries from untrusted sources, including community-shared ZIPs and executables. The observed payloads include both ransomware and an information stealer, creating risk of data theft, credential compromise, encryption-driven operational disruption, and follow-on financial and reputational damage.
The exposure is not a single software CVE but a malware delivery and analysis problem centered on PyInstaller-packed executables that can conceal malicious logic across multiple stages. The reporting includes a real stealer sample tied to attacker infrastructure and a separate Linux ELF sample containing ransomware components, indicating active malicious use in the wild rather than purely theoretical tradecraft.
Affected populations
- Windows users executing PyInstaller-packed executables
- Linux users executing PyInstaller-packed ELF binaries
- Organizations with developer, research, or community-facing users likely to download Python-based tools from Discord, GitHub, forums, or file-sharing channels
- Security teams that may miss malicious behavior if they rely only on static scanning of packed binaries
Severity and business risk
- Stealer activity can expose credentials, tokens, browser data, and other sensitive information to attacker-controlled infrastructure
- Ransomware payloads can cause file encryption, business interruption, recovery costs, and extortion pressure
- Multi-stage obfuscation increases dwell time by slowing triage and reverse engineering
- Cross-platform packaging broadens the potential victim set and complicates detection coverage
Scope and exploitation status
- Scope appears targeted/opportunistic rather than internet-wide exploitation of a product flaw
- Known malicious samples were recovered from VirusTotal and a Discord-distributed ZIP/executable chain
- The reporting identifies concrete attacker infrastructure and malware staging behavior, supporting real-world malicious use


