2022-09-24 15:12:23 +00:00
|
|
|
SELECT
|
|
|
|
p.name,
|
|
|
|
p.path AS path,
|
|
|
|
p.cmdline AS cmd,
|
2022-09-29 19:42:27 +00:00
|
|
|
p.pid,
|
|
|
|
p.parent,
|
2022-09-24 15:12:23 +00:00
|
|
|
pp.name AS parent_name,
|
|
|
|
pp.path AS parent_path,
|
|
|
|
pp.cmdline AS parent_cmd,
|
|
|
|
hash.sha256 AS parent_sha256
|
|
|
|
FROM
|
|
|
|
processes p
|
|
|
|
LEFT JOIN processes pp ON pp.pid = p.parent
|
|
|
|
LEFT JOIN hash ON pp.path = hash.path
|
|
|
|
WHERE
|
2022-10-12 01:53:36 +00:00
|
|
|
p.name IN ("sh", "fish", "zsh", "bash", "dash", "osascript")
|
2022-09-29 19:42:27 +00:00
|
|
|
-- Ignore partial table joins
|
|
|
|
AND parent_path != ""
|
2022-09-24 15:12:23 +00:00
|
|
|
-- Editors & terminals mostly
|
|
|
|
AND pp.name NOT IN (
|
2022-09-29 19:42:27 +00:00
|
|
|
"abrt-handle-eve",
|
|
|
|
"alacritty",
|
|
|
|
"bash",
|
|
|
|
"build-script-build",
|
|
|
|
"clang-11",
|
|
|
|
"Code - Insiders Helper (Renderer)",
|
|
|
|
"Code Helper (Renderer)",
|
|
|
|
"collect2",
|
|
|
|
"conmon",
|
|
|
|
"containerd-shim",
|
|
|
|
"dash",
|
|
|
|
"demoit",
|
|
|
|
"direnv",
|
|
|
|
"chezmoi",
|
|
|
|
"find",
|
|
|
|
"FinderSyncExtension",
|
|
|
|
"fish",
|
|
|
|
"go",
|
|
|
|
"goland",
|
|
|
|
"java",
|
|
|
|
"ko",
|
|
|
|
"kubectl",
|
2022-10-07 20:19:18 +00:00
|
|
|
"doas",
|
2022-09-29 19:42:27 +00:00
|
|
|
"make",
|
|
|
|
"monorail",
|
|
|
|
"nix-daemon",
|
|
|
|
"nix",
|
2022-10-03 20:27:56 +00:00
|
|
|
"nix-build",
|
2022-09-30 16:10:18 +00:00
|
|
|
"package_script_service",
|
2022-09-29 19:42:27 +00:00
|
|
|
"node",
|
|
|
|
"nvim",
|
|
|
|
"perl",
|
|
|
|
"PK-Backend",
|
|
|
|
"python",
|
|
|
|
"roxterm",
|
|
|
|
"sdzoomplugin",
|
2022-10-07 20:19:18 +00:00
|
|
|
"sh",
|
2022-09-29 19:42:27 +00:00
|
|
|
"skhd",
|
|
|
|
"swift",
|
|
|
|
"systemd",
|
|
|
|
"helm",
|
|
|
|
"terminator",
|
|
|
|
"test2json",
|
|
|
|
"tmux:server",
|
|
|
|
"tmux",
|
|
|
|
"vi",
|
|
|
|
"vim",
|
|
|
|
"watch",
|
|
|
|
"wezterm-gui",
|
2022-10-03 20:27:56 +00:00
|
|
|
"sshd",
|
2022-09-29 19:42:27 +00:00
|
|
|
"xargs",
|
|
|
|
"xcrun",
|
|
|
|
"xfce4-terminal",
|
|
|
|
"yum",
|
|
|
|
"zsh"
|
2022-09-24 15:12:23 +00:00
|
|
|
)
|
|
|
|
AND parent_path NOT IN (
|
2022-09-29 19:42:27 +00:00
|
|
|
"/Applications/Docker.app/Contents/MacOS/Docker",
|
|
|
|
"/bin/dash",
|
|
|
|
"/bin/sh",
|
|
|
|
"/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Contents/Helpers/GoogleSoftwareUpdateDaemon",
|
|
|
|
"/opt/X11/libexec/launchd_startx",
|
|
|
|
"/sbin/launchd",
|
2022-10-07 20:19:18 +00:00
|
|
|
"/usr/lib/xorg/Xorg",
|
2022-09-29 19:42:27 +00:00
|
|
|
"/usr/bin/alacritty",
|
|
|
|
"/usr/bin/apt-get",
|
|
|
|
"/usr/bin/bash",
|
|
|
|
"/usr/bin/bwrap",
|
2022-10-04 13:37:18 +00:00
|
|
|
"/usr/bin/sysdiagnose",
|
2022-09-29 19:42:27 +00:00
|
|
|
"/usr/bin/crond",
|
|
|
|
"/usr/bin/login",
|
2022-10-12 01:53:36 +00:00
|
|
|
"/Applications/IntelliJ IDEA.app/Contents/MacOS/idea",
|
2022-09-29 19:42:27 +00:00
|
|
|
"/Applications/Docker.app/Contents/Resources/bin/com.docker.cli",
|
|
|
|
"/usr/bin/man",
|
|
|
|
"/usr/bin/sudo",
|
|
|
|
"/usr/bin/xargs",
|
|
|
|
"/usr/bin/zsh",
|
|
|
|
"/usr/libexec/gnome-terminal-server",
|
|
|
|
"/usr/libexec/periodic-wrapper",
|
2022-09-24 15:12:23 +00:00
|
|
|
"/usr/bin/su"
|
|
|
|
)
|
|
|
|
-- npm run server
|
|
|
|
AND NOT p.cmdline IN (
|
2022-09-29 19:42:27 +00:00
|
|
|
"sh -c -- exec-bin node_modules/.bin/hugo/hugo server",
|
|
|
|
"sh -c xcode-select --print-path >/dev/null 2>&1 && xcrun --sdk macosx --show-sdk-path 2>/dev/null"
|
2022-09-24 15:12:23 +00:00
|
|
|
)
|
|
|
|
AND NOT (
|
2022-09-29 19:42:27 +00:00
|
|
|
pp.name = "sshd"
|
2022-09-24 15:12:23 +00:00
|
|
|
AND p.cmdline LIKE "%askpass%"
|
|
|
|
)
|
2022-09-27 15:54:17 +00:00
|
|
|
AND NOT (
|
2022-09-29 19:42:27 +00:00
|
|
|
pp.name = "bash"
|
2022-09-27 15:54:17 +00:00
|
|
|
AND p.cmdline LIKE "sh -s _hostname %"
|
|
|
|
)
|
2022-10-03 20:27:56 +00:00
|
|
|
AND NOT (
|
|
|
|
pp.cmdline LIKE "perl%/help2man%"
|
|
|
|
AND p.cmdline LIKE "sh -c man/%"
|
|
|
|
)
|
2022-09-24 15:12:23 +00:00
|
|
|
AND NOT p.cmdline LIKE "%/Library/Apple/System/Library/InstallerSandboxes%"
|
|
|
|
AND NOT p.cmdline LIKE "%gcloud config config-helper%"
|
|
|
|
AND NOT pp.cmdline LIKE "/Applications/Warp.app/%"
|
|
|
|
AND NOT pp.cmdline LIKE "%brew.rb%"
|
2022-09-29 19:42:27 +00:00
|
|
|
AND NOT pp.cmdline LIKE "%/Homebrew/build.rb%"
|
2022-09-24 15:12:23 +00:00
|
|
|
AND NOT pp.cmdline LIKE "%Code Helper%"
|
|
|
|
AND NOT pp.cmdline LIKE "%gcloud.py config config-helper%"
|
|
|
|
AND NOT pp.name LIKE "%term%"
|
|
|
|
AND NOT pp.name LIKE "%Term%"
|
|
|
|
AND NOT pp.name LIKE "Emacs%"
|
|
|
|
AND NOT pp.name LIKE "terraform-provider-%"
|
|
|
|
AND NOT pp.path LIKE "/Users/%/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Contents/Helpers/GoogleSoftwareUpdateAgent.app/Contents/MacOS/GoogleSoftwareUpdateAgent"
|
|
|
|
-- Oh, NixOS.
|
|
|
|
AND NOT pp.name LIKE "%/bin/bash"
|
|
|
|
AND NOT pp.name LIKE "%/bin/direnv"
|
|
|
|
AND NOT parent_path LIKE "/nix/store/%sh"
|
2022-09-27 15:54:17 +00:00
|
|
|
AND NOT parent_path LIKE "/opt/homebrew/%"
|