2022-11-04 12:51:17 +00:00
|
|
|
-- Find unexpected hidden files in a users Library directory
|
|
|
|
--
|
|
|
|
-- references:
|
|
|
|
-- * https://www.sentinelone.com/blog/xcsset-malware-update-macos-threat-actors-prepare-for-life-without-python/
|
|
|
|
--
|
|
|
|
-- false positives:
|
|
|
|
-- * programs which create new Library directories
|
|
|
|
--
|
|
|
|
-- tags: persistent state filesystem
|
|
|
|
-- platform: darwin
|
|
|
|
SELECT
|
|
|
|
file.path,
|
|
|
|
file.type,
|
|
|
|
file.size,
|
|
|
|
file.mtime,
|
|
|
|
file.uid,
|
|
|
|
file.ctime,
|
2022-11-04 15:52:24 +00:00
|
|
|
REPLACE(file.directory, u.directory, '~') AS homedir,
|
2022-11-04 12:51:17 +00:00
|
|
|
file.gid,
|
|
|
|
hash.sha256,
|
2022-11-04 15:52:24 +00:00
|
|
|
magic.data,
|
|
|
|
signature.identifier,
|
|
|
|
signature.authority
|
2022-11-04 12:51:17 +00:00
|
|
|
FROM
|
|
|
|
file
|
|
|
|
LEFT JOIN hash ON file.path = hash.path
|
2022-11-04 15:52:24 +00:00
|
|
|
LEFT JOIN users u ON file.uid = u.uid
|
2022-11-04 12:51:17 +00:00
|
|
|
LEFT JOIN magic ON file.path = magic.path
|
2022-11-04 15:52:24 +00:00
|
|
|
LEFT JOIN signature ON file.path = signature.path
|
2022-11-04 12:51:17 +00:00
|
|
|
WHERE
|
|
|
|
(
|
2022-11-04 15:52:24 +00:00
|
|
|
file.path LIKE '/Users/%/Library/%%/.%/%%'
|
|
|
|
OR file.path LIKE '/Users/%/Library/.%/%%'
|
|
|
|
OR file.path LIKE '/Users/%/Library/%%/.%/.%'
|
2022-11-04 12:51:17 +00:00
|
|
|
)
|
|
|
|
AND file.path NOT LIKE '%/../%'
|
|
|
|
AND file.path NOT LIKE '%/./%'
|
2022-11-16 16:02:29 +00:00
|
|
|
AND NOT homedir IN (
|
|
|
|
'~/Library/Accessibility/.com.apple.RTTTranscripts_SUPPORT/_EXTERNAL_DATA',
|
|
|
|
'~/Library/Finance/.finance_cloud_SUPPORT/_EXTERNAL_DATA',
|
|
|
|
'~/Library/Finance/.finance_local_SUPPORT/_EXTERNAL_DATA',
|
2023-09-01 21:27:27 +00:00
|
|
|
'~/Library/com.apple.groupkitd/.syncedGroupStore_SUPPORT/_EXTERNAL_DATA',
|
|
|
|
'~/Library/Finance/.finance_dropbox_SUPPORT/_EXTERNAL_DATA',
|
|
|
|
'~/Library/com.apple.groupkitd/.syncedGroupStore_SUPPORT/_EXTERNAL_DATA/',
|
2023-09-01 21:09:47 +00:00
|
|
|
'~/Library/Preferences/.wrangler',
|
2022-11-16 16:02:29 +00:00
|
|
|
'~/Library/Group Containers/.SiriTodayViewExtension/Library',
|
|
|
|
'~/Library/Group Containers/.SiriTodayViewExtension',
|
2023-04-17 20:20:35 +00:00
|
|
|
'~/Library/Saved Searches/.DockTags',
|
2023-08-15 22:13:06 +00:00
|
|
|
'~/Library/Preferences/.wrangler/config',
|
2023-01-18 15:57:43 +00:00
|
|
|
'~/Library/HomeKit/.core-cloudkit_SUPPORT/_EXTERNAL_DATA',
|
|
|
|
'~/Library/HomeKit/.core-cloudkit-shared_SUPPORT/_EXTERNAL_DATA',
|
2022-11-16 16:02:29 +00:00
|
|
|
'~/Library/Caches/.sigstore/gitsign',
|
|
|
|
'~/Library/GroupContainersAlias/.SiriTodayViewExtension/Library',
|
|
|
|
'~/Library/GroupContainersAlias/.SiriTodayViewExtension'
|
|
|
|
)
|
|
|
|
AND NOT homedir LIKE '~/Library/.icedove/%'
|