Files Downloads
osquery
Returns a list of file information from Downloads directories
Description
ODK (osquery-defense-kit) is unique in that the queries are designed to be used as part of a production detection & response pipeline. The detection queries are formulated to return zero rows during normal expected behavior, so that they may be configured to generate alerts when rows are returned.
Query
-- Returns a list of file information from Downloads directories
--
-- tags: postmortem
-- platform: posix
-- interval: 3600
SELECT
file.*,
data,
magic.hash.sha256
FROM
file
LEFT JOIN magic ON file.path = magic.path
LEFT JOIN hash ON file.path = hash.path
WHERE
(file.path LIKE "/home/%/Downloads/%"
OR file.path LIKE "/Users/%/Downloads/%"
)AND (
> (strftime('%s', 'now') -3600)
mtime OR ctime > (strftime('%s', 'now') -3600)
OR btime > (strftime('%s', 'now') -3600)
)
tags: SStagSS