osquery-defense-kit/process/unexpected-privilege-escala...

22 lines
516 B
MySQL
Raw Normal View History

2022-09-08 21:58:56 +00:00
SELECT p.pid,
p.path,
p.name,
p.cmdline,
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.euid < pp.euid
AND p.path NOT IN (
'/usr/bin/fusermount',
'/usr/bin/fusermount3',
'/usr/bin/login',
'/usr/bin/sudo'
)
AND path NOT LIKE "/nix/store/%/bin/sudo"
AND path NOT LIKE "/nix/store/%/bin/dhcpcd"