2022-09-30 21:55:46 +00:00
|
|
|
SELECT p.name,
|
2022-09-24 15:12:23 +00:00
|
|
|
TRIM(SUBSTR(SPLIT (p.name, ":./ ", 0), 0, 15)) AS short_name,
|
|
|
|
TRIM(SUBSTR(SPLIT (f.filename, ":./ ", 0), 0, 15)) AS short_filename,
|
|
|
|
f.filename,
|
|
|
|
p.path,
|
|
|
|
p.cwd,
|
|
|
|
p.cmdline AS cmd,
|
|
|
|
p.parent AS parent_pid,
|
|
|
|
pp.path AS parent_path,
|
|
|
|
pp.name AS parent_name,
|
|
|
|
pp.cmdline AS parent_cmd,
|
|
|
|
pp.cwd AS parent_cwd,
|
|
|
|
pp.euid AS parent_euid,
|
|
|
|
hash.sha256 AS child_sha256,
|
|
|
|
phash.sha256 AS parent_sha256,
|
|
|
|
CONCAT (
|
|
|
|
"name=",
|
|
|
|
TRIM(SUBSTR(SPLIT (p.name, ":./ ", 0), 0, 15)),
|
|
|
|
",file=",
|
|
|
|
TRIM(SUBSTR(SPLIT (f.filename, ":./ ", 0), 0, 15)),
|
|
|
|
",",
|
|
|
|
MIN(p.uid, 500)
|
|
|
|
) AS exception_key
|
2022-09-30 21:55:46 +00:00
|
|
|
FROM processes p
|
2022-09-24 15:12:23 +00:00
|
|
|
LEFT JOIN file f ON p.path = f.path
|
|
|
|
LEFT JOIN processes pp ON p.parent = pp.pid
|
|
|
|
LEFT JOIN hash ON p.path = hash.path
|
|
|
|
LEFT JOIN hash AS phash ON pp.path = phash.path
|
2022-09-30 21:55:46 +00:00
|
|
|
WHERE short_filename != short_name
|
2022-09-24 15:12:23 +00:00
|
|
|
AND NOT cmd LIKE "/nix/store/%/bin/bash%" -- Serial masqueraders
|
|
|
|
AND NOT short_filename IN ("bash", "ruby", "python", "python3")
|
|
|
|
AND exception_key NOT IN (
|
2022-09-26 22:11:36 +00:00
|
|
|
"name=blueman-applet,file=python3,500",
|
|
|
|
"name=blueman-tray,file=python3,500",
|
2022-09-30 21:55:46 +00:00
|
|
|
"name=cat,file=coreutils,500",
|
2022-09-24 15:12:23 +00:00
|
|
|
"name=chrome-gnome-s,file=python3,500",
|
2022-09-26 22:11:36 +00:00
|
|
|
"name=Chroot,file=firefox,500",
|
2022-09-24 15:12:23 +00:00
|
|
|
"name=code-oss,file=electron,500",
|
2022-09-26 22:11:36 +00:00
|
|
|
"name=exe,file=rootlessport,500",
|
|
|
|
"name=file,file=firefox,500",
|
2022-09-24 15:12:23 +00:00
|
|
|
"name=firefox-wrappe,file=firefox,500",
|
|
|
|
"name=firewalld,file=python3,0",
|
2022-10-03 20:27:56 +00:00
|
|
|
"name=gjs,file=gjs-console,120",
|
2022-09-24 15:12:23 +00:00
|
|
|
"name=gjs,file=gjs-console,500",
|
2022-09-27 15:54:17 +00:00
|
|
|
"name=gnome-characte,file=gjs-console,500",
|
2022-09-26 22:11:36 +00:00
|
|
|
"name=gnome-character,file=gjs-console,500",
|
2022-09-24 15:12:23 +00:00
|
|
|
"name=gnome-tweak-to,file=python3,500",
|
|
|
|
"name=gsettings-hel,file=gsettings-help,500",
|
|
|
|
"name=Isolated,file=firefox,500",
|
2022-09-26 22:11:36 +00:00
|
|
|
"name=MainThread,file=plugin-contain,500",
|
2022-09-24 15:12:23 +00:00
|
|
|
"name=mysqld,file=mariadbd,500",
|
|
|
|
"name=networkd-dispa,file=python3,0",
|
|
|
|
"name=nix-daemon,file=nix,0",
|
|
|
|
"name=npm,file=node,500",
|
2022-09-26 22:11:36 +00:00
|
|
|
"name=osqueryi,file=osqueryd,0",
|
|
|
|
"name=osqueryi,file=osqueryd,500",
|
2022-09-24 15:12:23 +00:00
|
|
|
"name=phpstorm,file=dash,500",
|
|
|
|
"name=Privileged,file=firefox,500",
|
|
|
|
"name=RDD,file=firefox,500",
|
2022-09-26 22:11:36 +00:00
|
|
|
"name=sd_espeak-ng-m,file=sd_espeak-ng,500",
|
2022-09-24 15:12:23 +00:00
|
|
|
"name=sh,file=dash,0",
|
|
|
|
"name=sh,file=dash,500",
|
2022-09-26 22:11:36 +00:00
|
|
|
"name=slic3r_main,file=prusa-slicer,500",
|
2022-09-24 15:12:23 +00:00
|
|
|
"name=Socket,file=firefox,500",
|
|
|
|
"name=streamdeck,file=python3,500",
|
|
|
|
"name=systemd-udevd,file=udevadm,0",
|
|
|
|
"name=terminator,file=python3,500",
|
2022-10-03 20:27:56 +00:00
|
|
|
"name=Thunar,file=thunar,500",
|
2022-09-24 15:12:23 +00:00
|
|
|
"name=unattended-upg,file=python3,0",
|
|
|
|
"name=Utility,file=firefox,500",
|
2022-09-30 21:55:46 +00:00
|
|
|
"name=vi,file=nvim,500",
|
|
|
|
"name=vi,file=vim,500",
|
2022-09-24 15:12:23 +00:00
|
|
|
"name=WebExtensions,file=firefox,500",
|
2022-09-30 21:55:46 +00:00
|
|
|
"name=Web,file=firefox,500",
|
2022-09-26 22:11:36 +00:00
|
|
|
"name=X,file=Xorg,0",
|
|
|
|
"name=zfs-auto-snaps,file=ruby,0",
|
|
|
|
"name=zoom,file=ZoomLauncher,500"
|
2022-09-24 15:12:23 +00:00
|
|
|
)
|
|
|
|
AND NOT (
|
|
|
|
short_filename = "systemd"
|
|
|
|
AND short_name LIKE "(sd%"
|
|
|
|
)
|
|
|
|
AND NOT (
|
|
|
|
short_filename LIKE "emacs%"
|
|
|
|
AND short_name = "emacs"
|
|
|
|
)
|
2022-09-30 21:55:46 +00:00
|
|
|
AND NOT (p.path LIKE "/nix/store/%/bin/coreutils")
|
|
|
|
GROUP by short_name,
|
|
|
|
short_filename
|