mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 00:49:03 +00:00
Discover Python Packages from Running Python Interpreters query (#7857)
* Discover Python Packages from Running Python Interpreters documentation * add hunting tag Co-authored-by: Guillaume Ross <guillaume@binaryfactory.ca> * Removed extra quote Co-authored-by: Guillaume Ross <guillaume@binaryfactory.ca> Co-authored-by: Guillaume Ross <guillaume@fleetdm.com>
This commit is contained in:
parent
34688f531a
commit
cbe2d252df
1 changed files with 11 additions and 0 deletions
|
|
@ -931,3 +931,14 @@ spec:
|
|||
purpose: Informational
|
||||
tags: network, tls
|
||||
contributors: nabilschear
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: query
|
||||
spec:
|
||||
name: Discover Python Packages from Running Python Interpreters
|
||||
platforms: Linux, macOS
|
||||
description: Attempt to discover Python environments (in cwd, path to the python binary, and process command line) from running python interpreters and collect Python packages from those environments.
|
||||
query: SELECT * FROM python_packages WHERE directory IN (SELECT DISTINCT directory FROM (SELECT SUBSTR(path,0,INSTR(path,'/bin/'))||'/lib' AS directory FROM processes WHERE path LIKE '%/bin/%' AND path LIKE '%python%' UNION SELECT SUBSTR(cmdline,0,INSTR(cmdline,'/bin/'))||'/lib' AS directory FROM processes WHERE cmdline LIKE '%python%' AND cmdline LIKE '%/bin/%' AND path LIKE '%python%' UNION SELECT cwd||'/lib' AS directory FROM processes WHERE path LIKE '%python%'));
|
||||
purpose: Informational
|
||||
tags: compliance, hunting
|
||||
contributors: nabilschear
|
||||
|
|
|
|||
Loading…
Reference in a new issue