Sigma rule: Python Image Load By Non-Python Process

A detection rule from the SigmaHQ repository, shown as its author published it. Dataset version ref-18776ab8ea02, updated 2025-08-18T00:00:00.000Z.

Rule

Title
Python Image Load By Non-Python Process
Status
test
Level
low
Author
Patrick St. John, OTR (Open Threat Research)
Date
2020-05-03
Modified
2025-08-18
File
rules/windows/image_load/image_load_susp_python_image_load.yml
Commit
ccbb0369507f796db0b0ae6854c8a2be471b9d84

Detects the image load of "Python Core" by a non-Python process. This might be indicative of a execution of executable that has been bundled from Python code.
Various tools like Py2Exe, PyInstaller, and cx_Freeze are used to bundle Python code into standalone executables.
Threat actors often use these tools to bundle malicious Python scripts into executables, sometimes to obfuscate the code or to bypass security measures.

Log source

product
windows
category
image_load

Detection

selection:
    Description: 'Python Core'
filter_main_generic:
    - Image|contains: 'Python'  # FPs with python38.dll, python.exe etc.
    - Image|startswith:
          - 'C:\Program Files\'
          - 'C:\Program Files (x86)\'
          - 'C:\ProgramData\Anaconda3\' # Comment out if you don't use Anaconda in your environment
filter_optional_null_image:
    Image: null
condition: selection and not 1 of filter_main_* and not 1 of filter_optional_*

False positives (as the rule lists them)

  • Legitimate Py2Exe Binaries
  • Known false positive caused with Python Anaconda
  • Various legitimate software is bundled from Python code into executables

Tags

  • attack.stealth
  • attack.t1027.002

MITRE ATT&CK ids this rule names

References

Read on 2026-11-03T00:58:21.399Z under licence sigma-drl-1.1@d5f4c36a from https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules/windows/image_load/image_load_susp_python_image_load.yml

Sources and licences

  • SigmaHQ

    "Python Image Load By Non-Python Process" by Patrick St. John, OTR (Open Threat Research) (SigmaHQ). Rule: https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules/windows/image_load/image_load_susp_python_image_load.yml.
    Licensed under the Detection Rule License (DRL) 1.1: https://github.com/SigmaHQ/Detection-Rule-License

    Detection Rule License (DRL) 1.1

Cite this page

Dragons Eye Ransomware Tracker, "Sigma rule: Python Image Load By Non-Python Process",
entity page, dataset version ref-18776ab8ea02, updated 2025-08-18T00:00:00.000Z,
https://ransomware-tracker.com/detections/sigma/cbb56d62-4060-40f7-9466-d8aaf3123f83 (accessed 2026-11-03).
Underlying source: SigmaHQ rule cbb56d62-4060-40f7-9466-d8aaf3123f83, commit ccbb0369507f796db0b0ae6854c8a2be471b9d84.

Pages change. The dataset version identifies the data, but no archive of old versions is kept, so this citation cannot be replayed later.