Add hidden-executable rule

This commit is contained in:
Thomas Stromberg 2022-11-16 20:55:49 -05:00
parent e844869be8
commit 288ec9e0f5
Failed to extract signature
1 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,31 @@
-- Programs running with a hidden file path or process name
--
-- references:
-- * https://attack.mitre.org/techniques/T1564/001/ (Hide Artifacts: Hidden Files and Directories)
--
-- tags: transient
-- platform: posix
SELECT
p.pid,
p.path,
p.name,
p.cmdline,
p.cwd,
p.euid,
p.parent,
pp.path AS parent_path,
pp.name AS parent_name,
pp.cmdline AS parent_cmdline,
pp.cwd AS parent_cwd,
pp.euid AS parent_euid,
hash.sha256
FROM
processes p
LEFT JOIN file f ON p.path = f.path
LEFT JOIN processes pp ON p.parent = pp.pid
LEFT JOIN users u ON p.uid = u.uid
LEFT JOIN hash ON p.path = hash.path
WHERE
(p.name LIKE '.%' OR f.filename LIKE '.%')
AND NOT f.path LIKE '/nix/store/%/%-wrapped'
AND NOT p.name = '.firefox-wrappe'