osquery-defense-kit/detection/persistence/unexpected-cron-entries.sql

26 lines
680 B
MySQL
Raw Normal View History

2022-10-14 18:19:13 +00:00
-- Unexpected crontab entries
--
-- references:
2022-10-19 20:56:32 +00:00
-- * https://attack.mitre.org/techniques/T1053/003/ (Scheduled Task/Job: Cron)
2022-10-14 18:19:13 +00:00
--
-- false positives:
-- * crontab entries added by the user
--
-- tags: persistent filesystem state
2022-10-14 18:19:13 +00:00
-- platform: posix
SELECT
*
FROM
crontab
WHERE
command NOT LIKE 'root%run-parts%'
AND command NOT LIKE '%freshclam%'
AND command NOT LIKE '%clamscan%'
AND command NOT LIKE '%e2scrub%'
AND command NOT LIKE '%zfs-linux%'
AND command NOT LIKE '%anacron start%'
AND command NOT LIKE '%/usr/lib/php/sessionclean%'
AND command NOT LIKE 'root command -v debian-sa1%'
AND command NOT LIKE '%rsync%'
AND command NOT LIKE 'gsutil %'