Skip to main content
Mallory
← Back to News
credential-stealer-activityransomware-tooling-evolutiondefense-evasion-methodloader-delivery-mechanism

PyInstaller-Packed Python Malware Unpacked to Reveal Ransomware and Stealer Payloads

Malware Intelligence · 3 sources · Updated 4mo ago · First seen Aug 10, 2024

PyInstaller-Packed Python Malware Unpacked to Reveal Ransomware and Stealer Payloads

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
Hunt this familyPull IOCs and campaign context straight into your stack.
Get the IOCs
Event timeline

How this story unfolded

Events from the most recent confirmed update back to the earliest known activity.

3 events · Sep 10, 2021 – Aug 10, 2024
  1. Aug 10, 20242y ago

    Analyst unpacks and traces multi-stage Python stealer to mgststudio.shop

    A researcher analyzed a PyInstaller-packed Python malware sample obtained via a Discord community, recovered multiple staged payloads, and identified the final code posting data to the attacker-controlled domain mgststudio.shop. The write-up linked the sample to Creal Stealer and described layered obfuscation including Base64, XOR, AES-CBC, and compression.

    [QuickNote] Retrieve unknown python stealer from PyInstaller | 0day in {REA_TEAM}
  2. May 3, 20225y ago

    Fortinet publishes PyInstaller unpacking and ransomware analysis

    Fortinet published research showing how to unpack PyInstaller-built executables on Windows and Linux, including analysis of a real Linux ELF malware sample from VirusTotal. The unpacked sample contained RansomWare.pyc, was assessed as ransomware, and Fortinet provided detections and IOCs.

    Unpacking Python Executables on Windows and Linux | FortiGuard Labs
  3. Sep 10, 20215y ago

    Pyinstxtractor wiki documents extracting Linux ELF binaries

    A GitHub wiki page for pyinstxtractor documented a method for extracting Linux ELF binaries, providing background relevant to later PyInstaller malware analysis workflows.

    Extracting Linux ELF binaries · extremecoders-re/pyinstxtractor Wiki · GitHub
Linked entities

Related entities

Vulnerabilities, threat actors, malware, products, organizations, breaches, and observables Mallory has linked to this story. Indicator values are masked here and available in full in the app.

Open in app →

Affected products

1 linked
Pyinstaller

Observables

4 linked

Indicator values are masked on this page. See the values in Mallory Domains, IPs, hashes, and URLs are exportable to your SIEM.

Do you run this?Pull the IOCs, campaigns, and victimology behind this family, ready to push into your SIEM and EDR.
Hunt This Malware
Mallory platform

See the full picture, correlated to your attack surface.

This page covers what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which threat actors are using it right now, and what to deploy next.

Exposure mappingMap indicators from this story to your assets and identify affected systems in minutes.
Threat actor evidenceEvery observed campaign, victim, and pivot linked to actors named in this story.
Associated malwareMalware, exploits, and IOCs connected to the activity described here.
Detection signaturesYARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.
Scheduled alertsGet matching new stories delivered to your team as they break, not the next morning.
AI threadsAsk questions about this story and take action on the answers.