2022-10-18 12:52:05 +00:00
|
|
|
-- Surface ISO/DMG disk images that were downloaded from unexpected places
|
|
|
|
--
|
|
|
|
-- references:
|
2022-10-19 20:56:32 +00:00
|
|
|
-- * https://attack.mitre.org/techniques/T1566/001/ (Phishing: Spearphishing Attachment)
|
|
|
|
-- * https://attack.mitre.org/techniques/T1204/002/ (User Execution: Malicious File)
|
2022-10-18 12:52:05 +00:00
|
|
|
-- * https://unit42.paloaltonetworks.com/chromeloader-malware/
|
|
|
|
--
|
|
|
|
-- false positives:
|
|
|
|
-- * disk images downloaded from a location not in the exception list
|
|
|
|
--
|
|
|
|
-- platform: darwin
|
|
|
|
-- tags: persistent filesystem spotlight
|
2022-10-19 20:19:53 +00:00
|
|
|
SELECT
|
|
|
|
file.path,
|
|
|
|
file.size,
|
|
|
|
datetime(file.btime, 'unixepoch') AS file_created,
|
|
|
|
magic.data,
|
2023-01-18 14:49:56 +00:00
|
|
|
hash.sha256,
|
|
|
|
signature.identifier,
|
|
|
|
signature.authority,
|
2022-10-19 20:19:53 +00:00
|
|
|
ea.value AS url,
|
|
|
|
REGEX_MATCH (ea.value, '/[\w_-]+\.([\w\._-]+)[:/]', 1) AS domain,
|
|
|
|
REGEX_MATCH (ea.value, '/([\w_-]+\.[\w\._-]+)[:/]', 1) AS host
|
|
|
|
FROM
|
|
|
|
mdfind
|
|
|
|
LEFT JOIN file ON mdfind.path = file.path
|
2023-01-18 14:49:56 +00:00
|
|
|
LEFT JOIN hash ON mdfind.path = hash.path
|
2022-10-19 20:19:53 +00:00
|
|
|
LEFT JOIN extended_attributes ea ON mdfind.path = ea.path
|
2023-01-18 14:49:56 +00:00
|
|
|
LEFT JOIN magic ON mdfind.path = magic.path
|
|
|
|
LEFT JOIN signature ON mdfind.path = signature.path
|
2022-10-19 20:19:53 +00:00
|
|
|
WHERE
|
|
|
|
(
|
|
|
|
mdfind.query = "kMDItemWhereFroms != '' && kMDItemFSName == '*.iso'"
|
|
|
|
OR mdfind.query = "kMDItemWhereFroms != '' && kMDItemFSName == '*.dmg'"
|
2023-01-13 18:47:02 +00:00
|
|
|
OR mdfind.query = "kMDItemWhereFroms != '' && kMDItemFSName == '*.pkg'"
|
2022-10-19 20:19:53 +00:00
|
|
|
)
|
|
|
|
AND ea.key = 'where_from'
|
|
|
|
AND file.btime > (strftime('%s', 'now') -86400)
|
|
|
|
AND domain NOT IN (
|
|
|
|
'adobe.com',
|
2023-06-02 23:08:08 +00:00
|
|
|
'vmware.com',
|
2023-01-24 01:33:52 +00:00
|
|
|
'akmedia.digidesign.com',
|
2022-10-19 20:19:53 +00:00
|
|
|
'alfredapp.com',
|
|
|
|
'android.com',
|
|
|
|
'apple.com',
|
|
|
|
'arc.net',
|
2023-01-24 01:33:52 +00:00
|
|
|
'balena.io',
|
2022-10-19 20:19:53 +00:00
|
|
|
'balsamiq.com',
|
|
|
|
'brave.com',
|
|
|
|
'canon.co.uk',
|
|
|
|
'cdn.mozilla.net',
|
|
|
|
'charlesproxy.com',
|
2023-02-09 01:06:26 +00:00
|
|
|
'cloudfront.net',
|
|
|
|
'cron.com',
|
2022-10-19 20:19:53 +00:00
|
|
|
'csclub.uwaterloo.ca',
|
2023-01-24 01:33:52 +00:00
|
|
|
'c-wss.com',
|
|
|
|
'digidesign.com',
|
|
|
|
'discordapp.net',
|
|
|
|
'discord.com',
|
2022-10-19 20:19:53 +00:00
|
|
|
'docker.com',
|
2023-01-24 01:33:52 +00:00
|
|
|
'dogado.de',
|
|
|
|
'download.prss.microsoft.com',
|
2022-10-19 20:19:53 +00:00
|
|
|
'duckduckgo.com',
|
|
|
|
'eclipse.org',
|
2023-01-24 01:33:52 +00:00
|
|
|
'epson.com',
|
|
|
|
'fcix.net',
|
|
|
|
'gaomon.net',
|
|
|
|
'getutm.app',
|
2022-10-19 20:19:53 +00:00
|
|
|
'gimp.org',
|
|
|
|
'github.io',
|
|
|
|
'githubusercontent.com',
|
2023-01-24 01:33:52 +00:00
|
|
|
'google.ca',
|
2022-10-19 20:19:53 +00:00
|
|
|
'grammarly.com',
|
|
|
|
'integodownload.com',
|
2023-01-24 01:33:52 +00:00
|
|
|
'irccloud.com',
|
2022-10-19 20:19:53 +00:00
|
|
|
'jetbrains.com',
|
2023-03-14 23:00:44 +00:00
|
|
|
'kagi.com',
|
2022-10-19 20:19:53 +00:00
|
|
|
'libreoffice.org',
|
2023-01-24 01:33:52 +00:00
|
|
|
'logitech.com',
|
2022-10-19 20:19:53 +00:00
|
|
|
'loom.com',
|
2023-02-09 01:06:26 +00:00
|
|
|
'macbartender.com',
|
2022-10-19 20:19:53 +00:00
|
|
|
'microsoft.com',
|
|
|
|
'minecraft.net',
|
|
|
|
'mirrorservice.org',
|
|
|
|
'mojang.com',
|
|
|
|
'mozilla.org',
|
2023-03-14 23:00:44 +00:00
|
|
|
'mutedeck.com',
|
2022-10-19 20:19:53 +00:00
|
|
|
'mysql.com',
|
2023-01-24 01:33:52 +00:00
|
|
|
'notion.so',
|
|
|
|
'notion-static.com',
|
2022-10-19 20:19:53 +00:00
|
|
|
'ocf.berkeley.edu',
|
|
|
|
'oobesaas.adobe.com',
|
2023-01-24 01:33:52 +00:00
|
|
|
'oracle.com',
|
2022-10-19 20:19:53 +00:00
|
|
|
'osuosl.org',
|
|
|
|
'pqrs.org',
|
2023-01-24 01:33:52 +00:00
|
|
|
'prusa3d.com',
|
2022-10-19 20:19:53 +00:00
|
|
|
'remarkable.com',
|
2023-02-09 01:06:26 +00:00
|
|
|
'securew2.com',
|
2022-10-19 20:19:53 +00:00
|
|
|
'signal.org',
|
2023-01-24 01:33:52 +00:00
|
|
|
'skype.com',
|
2022-10-19 20:19:53 +00:00
|
|
|
'slack-edge.com',
|
2023-02-09 01:06:26 +00:00
|
|
|
'stclairsoft.com',
|
2023-01-24 01:33:52 +00:00
|
|
|
'steampowered.com',
|
2022-10-19 20:19:53 +00:00
|
|
|
'tableplus.com',
|
2023-01-24 01:33:52 +00:00
|
|
|
'teams.cdn.office.net',
|
2023-02-09 01:06:26 +00:00
|
|
|
'techsmith.com',
|
2022-10-19 20:19:53 +00:00
|
|
|
'ubuntu.com',
|
|
|
|
'umd.edu',
|
2023-03-14 23:00:44 +00:00
|
|
|
'usa.canon.com',
|
2023-05-11 15:29:55 +00:00
|
|
|
'uubyte.com',
|
2023-01-24 01:33:52 +00:00
|
|
|
'vc.logitech.com',
|
2022-10-19 20:19:53 +00:00
|
|
|
'virtualbox.org',
|
|
|
|
'warp.dev',
|
2023-01-13 20:24:18 +00:00
|
|
|
'webex.com',
|
2023-01-24 01:33:52 +00:00
|
|
|
'whatsapp.com',
|
|
|
|
'xtom.com',
|
|
|
|
'zoomgov.com',
|
|
|
|
'zoom.us',
|
|
|
|
'zsa.io'
|
2022-10-19 20:19:53 +00:00
|
|
|
)
|
2023-04-17 20:20:35 +00:00
|
|
|
-- NOTE: Do not put all of storage.googleapis.com or similarly generic hosts here
|
2022-10-19 20:19:53 +00:00
|
|
|
AND host NOT IN (
|
2023-03-28 20:25:26 +00:00
|
|
|
'arc.net',
|
2023-04-21 00:45:35 +00:00
|
|
|
'adoptium.net',
|
2022-10-19 20:19:53 +00:00
|
|
|
'balsamiq.com',
|
2023-02-09 01:06:26 +00:00
|
|
|
'brave.com',
|
2023-05-23 15:31:37 +00:00
|
|
|
'cron.com',
|
2022-10-19 20:19:53 +00:00
|
|
|
'discord.com',
|
|
|
|
'dl.discordapp.net',
|
2023-02-09 01:06:26 +00:00
|
|
|
'dl.google.com',
|
|
|
|
'duckduckgo.com',
|
|
|
|
'dygma.com',
|
2022-10-19 20:19:53 +00:00
|
|
|
'emacsformacosx.com',
|
2023-02-09 01:06:26 +00:00
|
|
|
'getkap.co',
|
|
|
|
'github.com',
|
|
|
|
'krisp.ai',
|
|
|
|
'mail.google.com',
|
|
|
|
'manual.canon',
|
2023-03-21 18:07:06 +00:00
|
|
|
'mutedeck.com',
|
2023-02-09 01:06:26 +00:00
|
|
|
'obdev.at',
|
|
|
|
'obsidian.md',
|
|
|
|
'obsproject.com',
|
2023-02-24 21:30:17 +00:00
|
|
|
'posit.co',
|
2023-03-21 18:07:06 +00:00
|
|
|
'proton.me',
|
2023-06-01 15:52:20 +00:00
|
|
|
'mnvoip.mm.fcix.net',
|
2023-03-21 18:07:06 +00:00
|
|
|
'rancherdesktop.io',
|
2023-02-24 21:30:17 +00:00
|
|
|
'rectangleapp.com',
|
2023-02-09 01:06:26 +00:00
|
|
|
'stclairsoft.s3.amazonaws.com',
|
2022-10-19 20:19:53 +00:00
|
|
|
'store.steampowered.com',
|
2023-02-09 01:06:26 +00:00
|
|
|
'tableplus.com',
|
|
|
|
'textexpander.com',
|
|
|
|
'ubuntu.com',
|
|
|
|
'warp-releases.storage.googleapis.com',
|
2022-10-19 20:19:53 +00:00
|
|
|
'wavebox.io',
|
2023-02-09 01:06:26 +00:00
|
|
|
'www.google.com',
|
2023-02-24 21:30:17 +00:00
|
|
|
'www.messenger.com',
|
|
|
|
'zoom.us'
|
2022-10-19 20:19:53 +00:00
|
|
|
)
|
|
|
|
-- Yes, these are meant to be fairly broad.
|
|
|
|
AND host NOT LIKE 'download%'
|
|
|
|
AND host NOT LIKE 'cdn%'
|
|
|
|
AND host NOT LIKE '%.edu'
|
|
|
|
AND host NOT LIKE 'github-production-release-asset-%.s3.amazonaws.com'
|
|
|
|
AND host NOT LIKE '%.org'
|
|
|
|
AND host NOT LIKE 'dl.%'
|
|
|
|
AND host NOT LIKE 'dl-%'
|
|
|
|
AND host NOT LIKE 'mirror%'
|
|
|
|
AND host NOT LIKE 'driver.%'
|
|
|
|
AND host NOT LIKE 'support%'
|
|
|
|
AND host NOT LIKE 'software%'
|
|
|
|
AND host NOT LIKE 'www.google.%'
|
|
|
|
AND host NOT LIKE '%release%.storage.googleapis.com'
|
|
|
|
AND NOT (
|
|
|
|
host LIKE '%.fbcdn.net'
|
2023-01-18 14:49:56 +00:00
|
|
|
AND (
|
|
|
|
file.filename LIKE 'Messenger.%.dmg'
|
|
|
|
OR file.filename LIKE '%WhatsApp.dmg'
|
|
|
|
)
|
2022-10-19 20:19:53 +00:00
|
|
|
)
|
2023-04-17 20:20:35 +00:00
|
|
|
AND ea.value NOT LIKE 'https://storage.googleapis.com/copilot-mac-releases/%'
|
2022-10-19 20:19:53 +00:00
|
|
|
GROUP BY
|
|
|
|
ea.value
|