PyLocky
- Type
- Ransomware
- Capabilities
- ExfiltrationDefense evasionReconnaissance
- Delivery
- MalspamLure
- Platforms
- Windows
PyLocky is a Python-based ransomware family that masquerades as Locky in its ransom messaging but is unrelated to the Locky malware family. It was observed in 2018 in spam-driven campaigns, particularly affecting organizations and users in Europe, with notable concentration in France. Reported victims included small and medium-sized businesses, larger enterprises, associations, and home users.
PyLocky is commonly delivered through invoice-themed spam lures that direct recipients to download an archive containing a Windows executable. The malware has been packaged with PyInstaller and distributed with Inno Setup components, complicating static analysis and detection. After execution, it drops Python runtime components and supporting libraries, gathers host information through Windows Management Instrumentation, and performs anti-analysis checks based on system memory before proceeding.
The ransomware enumerates files across logical drives and encrypts a broad range of file types. Reported analyses indicate it uses the PyCrypto library and 3DES for file encryption, generates victim-specific values including a random user identifier, password, and initialization vector, and communicates with command-and-control infrastructure to transmit system information used in the encryption workflow. Encrypted files have been observed with extensions including lockedfile, lockymap, and locky depending on version. PyLocky then drops ransom notes, including multilingual variants, to instruct victims on payment and recovery.
PyLocky demonstrates defense-evasion characteristics through packaging and anti-sandbox delays, and it includes host reconnaissance prior to encryption. Public decryptors have been released for versions 1 and 2 through law-enforcement and researcher collaboration, enabling recovery in some cases without paying the ransom. Separate research also documented a decryptor workflow that depended on capturing the malware’s initial command-and-control traffic because data exchanged during early communications was incorporated into the encryption process.
Techniques & procedures
14 distinct techniques documented for this family, organized by ATT&CK tactic.
Resource Development
1 technique
Resource Development
The pyLocker Ransomware utilizes Command & Control servers on the Tor network.
Initial Access
2 techniques
Initial Access
In late July and throughout August, we observed waves of spam email delivering the PyLocky ransomware.
The email entices the user to click a link, which redirects users to a malicious URL containing PyLocky.
Execution
3 techniques
Execution
When PyLocky executes, it generates a random user ID and password and gathers information about the infected machine using WMI wrappers.
PyLocky is written in Python, a popular scripting language; and packaged with PyInstaller
The malicious URL leads to a ZIP file ( Facture_23100.31.07.2018.zip ) that contains a signed executable ( Facture_23100.31.07.2018.exe ). When successfully run, the Facture_23100.31.07.2018.exe will drop malware components
Stealth
2 techniques
Stealth
Although it tries to pass off as Locky in its ransom note, PyLocky is unrelated to Locky.
For its anti-sandbox capability, PyLocky will sleep for 999,999 seconds — or just over 11.5 days — if the affected system’s total visible memory size is less than 4GB.
Discovery
3 techniques
Discovery
When PyLocky executes, it generates a random user ID and password and gathers information about the infected machine using WMI wrappers.
After obtaining the absolute path of every file on the system, the malware then calls the encryption algorithm, passing it the IV and password.
For its anti-sandbox capability, PyLocky will sleep for 999,999 seconds — or just over 11.5 days — if the affected system’s total visible memory size is less than 4GB.
Collection
1 technique
Collection
The malicious URL leads to a ZIP file ( Facture_23100.31.07.2018.zip ) that contains a signed executable
Command and Control
2 techniques
Command and Control
The pyLocker Ransomware utilizes Command & Control servers on the Tor network. These Tor servers are provided in the ransom notes created on a victim's computer...
When successfully run, the Facture_23100.31.07.2018.exe will drop malware components — several C++ and Python libraries and the Python 2.7 Core dynamic-link library (DLL) — along with the main ransomware executable
Impact
1 technique
Impact
PyLocky is a family of ransomware written in Python that attempts to masquerade as a Locky variant. This ransomware will encrypt all files on a victim machine before demanding that the user pay a ransom to gain access to their decrypted files.
Observables
11 indicators attributed across vendor reports, sandbox runs, and researcher write-ups. Values are masked here and available in full in Mallory.
Recent activity
4 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.