2023-02-01 18:55:55 +00:00
|
|
|
-- Find a process which has a parent that is not listed in the process table
|
|
|
|
--
|
2022-09-11 19:07:54 +00:00
|
|
|
-- Works well for revealing boopkit, so long as boopkit has a child process.
|
2022-10-13 18:59:32 +00:00
|
|
|
--
|
2022-10-14 18:19:13 +00:00
|
|
|
-- references:
|
|
|
|
-- * https://github.com/krisnova/boopkit
|
2022-10-19 20:56:32 +00:00
|
|
|
-- * https://attack.mitre.org/techniques/T1014/ (Rootkit)
|
2022-10-14 18:19:13 +00:00
|
|
|
--
|
|
|
|
-- false positives:
|
|
|
|
-- * None observed
|
|
|
|
--
|
2022-10-14 18:26:49 +00:00
|
|
|
-- tags: persistent daemon
|
2023-02-02 22:58:19 +00:00
|
|
|
SELECT
|
|
|
|
p.*,
|
2023-02-01 18:55:55 +00:00
|
|
|
hash.sha256,
|
|
|
|
GROUP_CONCAT(DISTINCT pof.path) AS open_files
|
2023-02-02 22:58:19 +00:00
|
|
|
FROM
|
|
|
|
processes p
|
2023-02-01 18:55:55 +00:00
|
|
|
LEFT JOIN hash ON p.path = hash.path
|
|
|
|
LEFT JOIN process_open_files pof ON p.pid = pof.pid
|
2023-02-02 22:58:19 +00:00
|
|
|
WHERE
|
|
|
|
p.parent NOT IN (
|
|
|
|
SELECT
|
|
|
|
pid
|
|
|
|
FROM
|
|
|
|
processes
|
2022-09-24 15:12:23 +00:00
|
|
|
)
|
2023-02-01 18:55:55 +00:00
|
|
|
AND p.parent != 0
|
|
|
|
AND p.parent IS NOT NULL
|
2023-02-02 22:58:19 +00:00
|
|
|
GROUP BY
|
|
|
|
p.pid
|