Returns a list of files likely exported from Salesforce


Query · osquery

-- Returns a list of files likely exported from Salesforce
--
-- platform: posix
-- tags: persistent filesystem often
SELECT
  file.path,
  file.size,
  datetime(file.btime, 'unixepoch') AS file_created,
  datetime(file.atime, 'unixepoch') AS file_accessed,
  hash.sha256
FROM
  file
  LEFT JOIN hash ON file.path = hash.path
WHERE
  (
    file.path LIKE '/Users/%/Downloads/%-202%-%-%-%-%-%.xlsx'
    OR file.path LIKE '/home/%/Downloads/%-202%-%-%-%-%-%.xlsx'
    OR file.path LIKE '/Users/%/Downloads/WE_%.ZIP'
    OR file.path LIKE '/home/%/Downloads/WE_%.ZIP'
    OR file.path LIKE '/Users/%/Downloads/report17%.%'
    OR file.path LIKE '/home/%/Downloads/report17%.%'
    OR file.path LIKE '/Users/%/Downloads/%/Cont%act.csv'
    OR file.path LIKE '/home/%/Downloads/%/Cont%act.csv'
  )
  AND file.btime > (strftime('%s', 'now') -86400)
  AND file.size > 500000
GROUP BY
  file.path
Raw source Returns a list of files likely exported from Salesforce · osquery SQL
Esc
Published by chainguard-dev/osquery-defense-kit ↗, licensed under Apache 2.0 ↗. Reproduced here unmodified.
-- Returns a list of files likely exported from Salesforce
--
-- platform: posix
-- tags: persistent filesystem often
SELECT
  file.path,
  file.size,
  datetime(file.btime, 'unixepoch') AS file_created,
  datetime(file.atime, 'unixepoch') AS file_accessed,
  hash.sha256
FROM
  file
  LEFT JOIN hash ON file.path = hash.path
WHERE
  (
    file.path LIKE '/Users/%/Downloads/%-202%-%-%-%-%-%.xlsx'
    OR file.path LIKE '/home/%/Downloads/%-202%-%-%-%-%-%.xlsx'
    OR file.path LIKE '/Users/%/Downloads/WE_%.ZIP'
    OR file.path LIKE '/home/%/Downloads/WE_%.ZIP'
    OR file.path LIKE '/Users/%/Downloads/report17%.%'
    OR file.path LIKE '/home/%/Downloads/report17%.%'
    OR file.path LIKE '/Users/%/Downloads/%/Cont%act.csv'
    OR file.path LIKE '/home/%/Downloads/%/Cont%act.csv'
  )
  AND file.btime > (strftime('%s', 'now') -86400)
  AND file.size > 500000
GROUP BY
  file.path

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.