2022-09-30 16:10:18 +00:00
|
|
|
-- Processes running that originate from setuid/setgid programs
|
2022-10-14 18:19:13 +00:00
|
|
|
--
|
2022-10-19 20:56:32 +00:00
|
|
|
-- false-positives:
|
|
|
|
-- * an unlisted setuid binary
|
|
|
|
--
|
|
|
|
-- references:
|
|
|
|
-- * https://attack.mitre.org/techniques/T1548/001/ (Setuid and Setgid)
|
|
|
|
--
|
2022-10-14 18:26:49 +00:00
|
|
|
-- tags: persistent state process escalation
|
2022-10-19 20:56:32 +00:00
|
|
|
-- platform: posix
|
2022-09-30 16:10:18 +00:00
|
|
|
SELECT
|
|
|
|
p.pid,
|
|
|
|
p.name,
|
|
|
|
p.path,
|
|
|
|
p.cmdline,
|
|
|
|
f.ctime,
|
|
|
|
p.cwd,
|
|
|
|
p.uid,
|
|
|
|
f.mode,
|
|
|
|
hash.sha256
|
|
|
|
FROM
|
|
|
|
processes p
|
|
|
|
JOIN file f ON p.path = f.path
|
|
|
|
JOIN hash ON p.path = hash.path
|
|
|
|
WHERE
|
2022-10-13 18:59:32 +00:00
|
|
|
f.mode NOT LIKE '0%'
|
2022-09-30 16:10:18 +00:00
|
|
|
AND f.path NOT IN (
|
2022-11-04 13:57:41 +00:00
|
|
|
'/Applications/Parallels Desktop.app/Contents/MacOS/Parallels Service',
|
2022-10-13 18:59:32 +00:00
|
|
|
'/bin/ps',
|
2022-11-04 13:57:41 +00:00
|
|
|
'/Library/Application Support/org.pqrs/Karabiner-Elements/bin/karabiner_session_monitor',
|
2022-10-13 18:59:32 +00:00
|
|
|
'/Library/DropboxHelperTools/Dropbox_u501/dbkextd',
|
|
|
|
'/opt/1Password/1Password-BrowserSupport',
|
|
|
|
'/opt/1Password/1Password-KeyringHelper',
|
2022-11-16 19:49:36 +00:00
|
|
|
'/usr/bin/keybase-redirector',
|
2022-10-13 18:59:32 +00:00
|
|
|
'/usr/bin/doas',
|
|
|
|
'/usr/bin/fusermount',
|
|
|
|
'/usr/bin/fusermount3',
|
|
|
|
'/usr/bin/login',
|
2022-11-04 13:57:41 +00:00
|
|
|
'/usr/bin/mount',
|
2022-10-13 18:59:32 +00:00
|
|
|
'/usr/bin/ssh-agent',
|
|
|
|
'/usr/bin/su',
|
|
|
|
'/usr/bin/sudo',
|
|
|
|
'/usr/bin/top',
|
2022-11-04 13:57:41 +00:00
|
|
|
'/usr/lib/xf86-video-intel-backlight-helper',
|
|
|
|
'/usr/lib/Xorg.wrap',
|
|
|
|
'/usr/sbin/traceroute'
|
2022-09-30 16:10:18 +00:00
|
|
|
);
|