← Back to SOC feed Coverage →

Detect PE file produced by pyinstaller

yara LOW Yara-Rules
community
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at Yara-Rules →
Retrieved: 2026-06-28T23:00:00Z · Confidence: medium

Hunt Hypothesis

This hypothesis posits that adversaries are leveraging PyInstaller to package malicious Python scripts into standalone executables, thereby evading script-based detection mechanisms and simplifying lateral movement. Proactive hunting for these artifacts in Azure Sentinel is critical because while the rule severity is low, the presence of unexpected PyInstaller-generated PE files often signals early-stage reconnaissance or a sophisticated attempt to bypass traditional endpoint security controls.

YARA Rule

rule PE_File_pyinstaller
{
    meta:
        author = "Didier Stevens (https://DidierStevens.com)"
        description = "Detect PE file produced by pyinstaller"
        reference = "https://isc.sans.edu/diary/21057"
    strings:
        $a = "pyi-windows-manifest-filename"
    condition:
        pe.number_of_resources > 0 and $a
}

Deployment Notes

This YARA rule can be deployed in the following contexts:

This rule contains 1 string patterns in its detection logic.

References

False Positive Guidance

Here are 4 specific false positive scenarios for the “Detect PE file produced by PyInstaller” rule, including suggested filters and exclusions:

Original source: https://github.com/Yara-Rules/rules/blob/main/malware/MALW_Pyinstaller.yar