Skip to main content
Mallory
← Back to News
defense-evasion-methodremote-access-implantstate-sponsored-espionageoffensive-tooling-release

Malware Analysis Evasion via Custom Packing and Modified PyInstaller Stubs

Attack Tradecraft · 2 sources · Updated 5mo ago · First seen Feb 5, 2026

Malware Analysis Evasion via Custom Packing and Modified PyInstaller Stubs

Researchers reported a new PDFly malware variant that uses a custom-modified PyInstaller executable to break common unpacking workflows and force manual reverse engineering. The sample alters PyInstaller identifiers (including a non-standard “magic cookie”) and corrupts strings so tools like PyInstxtractor fail to recognize the archive structure; even after adapting extraction scripts to accept the custom cookie and bypass validation checks, the recovered Python components remained multi-layer encrypted, with decryption logic implemented in separate bootstrap files that handle runtime extraction.

Separately, an educational malware-analysis write-up detailed how to unpack SnappyBee (Deed RAT), a modular backdoor previously reported in China-linked espionage activity and associated in public reporting with Salt Typhoon / Earth Estries. The post describes SnappyBee’s custom packing routine used to obscure its payload and evade static analysis, and positions the unpacking methodology as a repeatable approach for triaging similarly packed malware (including post-compromise tooling used for persistence and follow-on deployment such as Cobalt Strike and the Demodex rootkit).

Why it matters

Impact assessment

PDFly and SnappyBee primarily affect defenders’ ability to analyze and detect malware quickly, with direct risk to enterprises that face targeted post-compromise activity and malware delivered through packed Python or DLL side-loading chains. The impact is operationally significant because these techniques delay triage, reduce static-detection efficacy, and support persistence and follow-on payload deployment including Cobalt Strike and rootkit tooling.

Summary

PDFly represents an anti-analysis and evasion development that can slow malware reverse engineering and weaken automated unpacking workflows across security teams and sandboxes that rely on standard PyInstaller tooling. SnappyBee is more directly tied to targeted espionage operations, where compromised organizations may face long-term persistence, additional malware deployment, and stealthy post-compromise activity.

Affected populations

  • Security teams, malware analysts, and SOCs that rely on automated unpacking of PyInstaller-based malware.
  • Windows enterprises exposed to DLL side-loading abuse and post-compromise loader chains.
  • Organizations previously targeted by China-linked espionage activity, including governments and multiple industries referenced in prior public reporting on SnappyBee.

Severity and business impact

  • Operational disruption: analysis delays due to broken extraction workflows and multi-layer runtime decryption.
  • Detection degradation: static signatures and hash-based detections are less reliable against custom-packed variants.
  • Persistence and follow-on risk: SnappyBee has been used after initial compromise to maintain access and deploy Cobalt Strike and Demodex.
  • Reputational and financial impact: prolonged dwell time and secondary payload deployment can increase incident scope and recovery cost.

Scope and exploitation

  • PDFly/PDFClick activity suggests active malware development and a broader evasion campaign, but the story does not quantify victim scale.
  • SnappyBee is associated with targeted espionage rather than indiscriminate mass exploitation.
  • Known in-the-wild use is indicated for SnappyBee through prior campaign reporting; PDFly is presented as an observed malware variant with active evolution rather than a disclosed software vulnerability.
Who uses this technique?Get the actors, campaigns, and ATT&CK mapping behind it.
Get the tradecraft
Event timeline

How this story unfolded

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

5 events · Feb 3, 2026
  1. Feb 3, 202610mo ago

    Darktrace publishes SnappyBee unpacking and analysis details

    Darktrace released a technical analysis of SnappyBee (Deed RAT), describing its DLL side-loading execution chain, ARC4-based decryption, in-memory staging, and debugger-based unpacking workflow for recovering later-stage payloads.

  2. Feb 3, 202610mo ago

    Samplepedia develops a generic extractor for future PDFly variants

    After reverse-engineering the scheme, Samplepedia produced a more generic extractor capable of locating custom cookie structures and automatically recovering XOR keys from pyimod01_archive.pyc to decrypt future variants.

  3. Feb 3, 202610mo ago

    Samplepedia reverse-engineers PDFly's custom decryption chain

    Samplepedia analysts determined the malware's decryption logic resided in separate bootstrap components and documented a multi-stage process involving XOR, zlib decompression, a second XOR, byte reversal, and unmarshaling into Python code objects.

  4. Feb 3, 202610mo ago

    Researchers discover related PDFClick sample suggesting broader activity

    Analysts found a related sample named PDFClick that used the same custom PyInstaller-based evasion approach, indicating active development and a wider malware evasion campaign.

  5. Feb 3, 202610mo ago

    Luke Acha publicly notes a new PDFly evasion technique

    Security researcher Luke Acha first publicly identified a PDFly malware variant using a modified PyInstaller executable designed to break standard extraction and analysis workflows.

Do you run this?Get the adversaries, campaigns, and ATT&CK mapping behind this technique, with detections ready to deploy.
See Who Uses This Technique
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.