Potential Python DLL SideLoading

Detects potential DLL sideloading of Python DLL files.

Sigma rule (View on GitHub)

 1title: Potential Python DLL SideLoading
 2id: d36f7c12-14a3-4d48-b6b8-774b9c66f44d
 3status: test
 4description: Detects potential DLL sideloading of Python DLL files.
 5references:
 6    - https://www.securonix.com/blog/seolurker-attack-campaign-uses-seo-poisoning-fake-google-ads-to-install-malware/
 7    - https://thedfirreport.com/2024/09/30/nitrogen-campaign-drops-sliver-and-ends-with-blackcat-ransomware/
 8    - https://github.com/wietze/HijackLibs/tree/dc9c9f2f94e6872051dab58fbafb043fdd8b4176/yml/3rd_party/python
 9author: Swachchhanda Shrawan Poudel
10date: 2024-10-06
11modified: 2025-08-18
12tags:
13    - attack.privilege-escalation
14    - attack.persistence
15    - attack.execution
16    - attack.stealth
17    - attack.t1574.001
18logsource:
19    category: image_load
20    product: windows
21detection:
22    selection:
23        ImageLoaded|endswith:
24            - '\python39.dll'
25            - '\python310.dll'
26            - '\python311.dll'
27            - '\python312.dll'
28    filter_main_default_install_paths:
29        - ImageLoaded|startswith:
30              - 'C:\Program Files\Python3'
31              - 'C:\Program Files (x86)\Python3'
32        - ImageLoaded|contains: '\AppData\Local\Programs\Python\Python3'
33    filter_optional_visual_studio:
34        ImageLoaded|startswith: 'C:\Program Files\Microsoft Visual Studio\'
35    filter_optional_anaconda:
36        ImageLoaded|startswith: 'C:\ProgramData\Anaconda3\' # Comment out if you don't use Anaconda in your environment
37    filter_optional_cpython:
38        ImageLoaded|contains:
39            - '\cpython\externals\'
40            - '\cpython\PCbuild\'
41    filter_optional_pyinstaller:
42        # Triggered by programs bundled with PyInstaller
43        ImageLoaded|startswith: 'C:\Users'
44        ImageLoaded|contains: '\AppData\Local\Temp\_MEI'
45    filter_main_legit_signature_details:
46        Product: 'Python'
47        Signed: 'true'
48        Description: 'Python'
49        Company: 'Python Software Foundation'
50    condition: selection and not 1 of filter_main_* and not 1 of filter_optional_*
51falsepositives:
52    - Legitimate software using Python DLLs
53level: medium

References

Related rules

to-top