Detection rules › Sigma

Potential Python DLL SideLoading

Severity
medium
Author
Swachchhanda Shrawan Poudel
Source
upstream

Detects potential DLL sideloading of Python DLL files.

MITRE ATT&CK coverage

TacticTechniques
PersistenceT1574.001 Hijack Execution Flow: DLL
Privilege EscalationT1574.001 Hijack Execution Flow: DLL
Defense EvasionT1574.001 Hijack Execution Flow: DLL

Event coverage

ProviderEvent IDTitle
Sysmon7Image loaded

Stages and Predicates

Stage 1: selection

or:
ImageLoaded|endswith: '\python310.dll'
ImageLoaded|endswith: '\python311.dll'
ImageLoaded|endswith: '\python312.dll'
ImageLoaded|endswith: '\python39.dll'

Stage 2: not 1 of filter_main_*

or:
Company: 'Python Software Foundation'
Description: Python
Product: Python
Signed: true
ImageLoaded|contains: '\AppData\Local\Programs\Python\Python3'
ImageLoaded|startswith: 'C:\Program Files (x86)\Python3'
ImageLoaded|startswith: 'C:\Program Files\Python3'

Stage 3: not 1 of filter_optional_*

or:
ImageLoaded|contains: '\AppData\Local\Temp\_MEI'
ImageLoaded|startswith: 'C:\Users'
ImageLoaded|contains: '\cpython\PCbuild\'
ImageLoaded|contains: '\cpython\externals\'
ImageLoaded|startswith: 'C:\Program Files\Microsoft Visual Studio\'
ImageLoaded|startswith: 'C:\ProgramData\Anaconda3\'

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
Companyeq
  • Python Software Foundation
Descriptioneq
  • Python
ImageLoadedends_with
  • \python310.dll
  • \python311.dll
  • \python312.dll
  • \python39.dll
ImageLoadedmatch
  • \AppData\Local\Programs\Python\Python3
  • \AppData\Local\Temp\_MEI
  • \cpython\PCbuild\
  • \cpython\externals\
ImageLoadedstarts_with
  • C:\Program Files (x86)\Python3
  • C:\Program Files\Microsoft Visual Studio\
  • C:\Program Files\Python3
  • C:\ProgramData\Anaconda3\
  • C:\Users
Producteq
  • Python
Signedeq
  • true corpus 8 (sigma 8)