2022-09-29 19:42:27 +00:00
|
|
|
-- Find unexpected executables in /dev
|
2022-10-12 01:53:36 +00:00
|
|
|
SELECT
|
|
|
|
file.path,
|
2022-09-29 19:42:27 +00:00
|
|
|
file.directory,
|
|
|
|
uid,
|
|
|
|
gid,
|
|
|
|
mode,
|
|
|
|
file.mtime,
|
|
|
|
file.size,
|
|
|
|
hash.sha256,
|
|
|
|
magic.data
|
2022-10-12 01:53:36 +00:00
|
|
|
FROM
|
|
|
|
file
|
2022-09-29 19:42:27 +00:00
|
|
|
LEFT JOIN hash on file.path = hash.path
|
|
|
|
LEFT JOIN magic ON file.path = magic.path
|
2022-10-12 01:53:36 +00:00
|
|
|
-- For some reason /dev/%% is not recursive?
|
|
|
|
WHERE
|
|
|
|
(
|
|
|
|
file.path LIKE "/dev/%%"
|
|
|
|
OR file.path LIKE "/dev/%%/%%"
|
|
|
|
)
|
2022-09-29 19:42:27 +00:00
|
|
|
AND file.type = "regular"
|
|
|
|
AND (
|
|
|
|
file.mode LIKE "%7%"
|
|
|
|
or file.mode LIKE "%5%"
|
|
|
|
or file.mode LIKE "%1%"
|
|
|
|
)
|