osquery-defense-kit/detection/persistence/fake-apple-launchd.sql

24 lines
597 B
MySQL
Raw Normal View History

-- Find launchd entries which purport to be by Apple, but are not signed by Apple.
--
2022-10-14 18:19:13 +00:00
-- references:
2022-10-19 20:56:32 +00:00
-- * https://attack.mitre.org/techniques/T1543/004/ (Create or Modify System Process: Launch Daemon)
2022-10-14 18:19:13 +00:00
-- * https://posts.specterops.io/hunting-for-bad-apples-part-1-22ef2b44c0aa
--
-- false positives:
-- * none have been observed
--
-- platform: darwin
2022-10-14 18:19:13 +00:00
-- tags: persistent launchd state
select
*
FROM
signature s
JOIN launchd d ON d.program_arguments = s.path
WHERE
d.name LIKE 'com.apple.%'
AND (
signed = 0
OR authority != 'Software Signing'
)
AND d.run_at_load = 1;