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',
|
2023-03-14 23:00:44 +00:00
|
|
|
'/Applications/VMware Fusion.app/Contents/Library/vmware-vmx',
|
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',
|
2023-05-12 20:41:17 +00:00
|
|
|
'/opt/google/chrome/chrome-sandbox',
|
2023-03-14 23:00:44 +00:00
|
|
|
'/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/MacOS/ARDAgent',
|
2022-10-13 18:59:32 +00:00
|
|
|
'/usr/bin/doas',
|
|
|
|
'/usr/bin/fusermount',
|
|
|
|
'/usr/bin/fusermount3',
|
2023-03-14 23:00:44 +00:00
|
|
|
'/usr/bin/keybase-redirector',
|
2022-10-13 18:59:32 +00:00
|
|
|
'/usr/bin/login',
|
2022-11-04 13:57:41 +00:00
|
|
|
'/usr/bin/mount',
|
2023-03-14 23:00:44 +00:00
|
|
|
'/usr/bin/op',
|
2022-10-13 18:59:32 +00:00
|
|
|
'/usr/bin/ssh-agent',
|
|
|
|
'/usr/bin/su',
|
|
|
|
'/usr/bin/sudo',
|
|
|
|
'/usr/bin/top',
|
2023-05-12 20:41:17 +00:00
|
|
|
'/usr/lib/electron/chrome-sandbox',
|
2023-03-14 23:00:44 +00:00
|
|
|
'/usr/lib/polkit-1/polkit-agent-helper-1',
|
2023-05-12 20:41:17 +00:00
|
|
|
'/usr/lib/slack/chrome-sandbox',
|
2022-11-04 13:57:41 +00:00
|
|
|
'/usr/lib/xf86-video-intel-backlight-helper',
|
|
|
|
'/usr/lib/Xorg.wrap',
|
2023-03-14 23:00:44 +00:00
|
|
|
'/usr/sbin/traceroute'
|
2023-01-13 19:10:43 +00:00
|
|
|
)
|
|
|
|
AND f.path NOT LIKE '/Users/%/homebrew/Cellar/socket_vmnet/%/bin/socket_vmnet'
|
2023-02-09 01:06:26 +00:00
|
|
|
AND f.path NOT LIKE '/opt/homebrew/Cellar/dnsmasq/%/sbin/dnsmasq'
|
2023-01-14 13:19:26 +00:00
|
|
|
AND f.path NOT LIKE '/opt/homebrew/Cellar/socket_vmnet/%/bin/socket_vmnet'
|