osquery-defense-kit/process/hidden-cwd.sql

24 lines
616 B
MySQL
Raw Normal View History

2022-09-09 14:16:28 +00:00
SELECT p.pid,
p.path,
p.name,
p.cmdline,
p.cwd,
p.euid,
p.parent,
pp.path AS parent_path,
pp.name AS parent_name,
pp.cmdline AS parent_cmdline,
pp.euid AS parent_euid
FROM processes p
JOIN processes pp ON p.parent = pp.pid
WHERE
p.cwd LIKE "%/.%" AND NOT (
p.cwd LIKE "%/.local/share%" OR
p.cwd LIKE "%/.vscode/extensions%" OR
2022-09-10 11:24:17 +00:00
p.cwd LIKE "/Users/%/.%" OR
p.cwd LIKE "/home/%/.%" OR
2022-09-16 15:22:50 +00:00
p.cwd LIKE "/Library/Apple/System/Library/InstallerSandboxes/.PKInstallSandboxManager-SystemSoftware/%" OR
2022-09-10 11:24:17 +00:00
p.name = 'bindfs' OR
p.path="/usr/libexec/dirhelper"
2022-09-09 14:16:28 +00:00
)