Detection logic
Original SigmaHQ detection and related fields from the pinned file. The source file includes its full metadata.
logsource:
product: windows
category: file_event
detection:
selection:
TargetFilename|re: '(?i)\\(venv|python(.+)?)\\lib\\site-packages\\' # Covers both Virtual envs and default paths
TargetFilename|endswith: '.pth'
filter_main_python:
Image|endswith: '\python.exe'
TargetFilename|endswith:
- '\pywin32.pth' # VS Studio Python extension
- '\distutils-precedence.pth'
condition: selection and not 1 of filter_main_*
falsepositives:
- Although .pth files are discouraged due to potential security implications, these are legitimate files by specification.