2024-03-15 23:06:16 +00:00
|
|
|
-- tags: volume filesystem seldom
|
2023-09-20 21:03:21 +00:00
|
|
|
SELECT
|
|
|
|
file.path,
|
|
|
|
file.size,
|
|
|
|
file.btime,
|
|
|
|
file.ctime,
|
|
|
|
file.mtime,
|
|
|
|
magic.data,
|
|
|
|
hash.sha256,
|
|
|
|
yara.*
|
|
|
|
FROM
|
|
|
|
file
|
|
|
|
JOIN yara ON file.path = yara.path
|
|
|
|
LEFT JOIN magic ON file.path = magic.path
|
|
|
|
LEFT JOIN hash ON file.path = hash.path
|
|
|
|
WHERE
|
2024-04-26 20:14:02 +00:00
|
|
|
file.path IN (
|
|
|
|
SELECT path
|
|
|
|
FROM file
|
|
|
|
WHERE (
|
|
|
|
file.path LIKE '/home/%/Downloads/%'
|
|
|
|
OR file.path LIKE '/home/%/Downloads/%/%'
|
|
|
|
OR file.path LIKE '/Users/%/Downloads/%'
|
|
|
|
OR file.path LIKE '/Users/%/Downloads/%/%'
|
|
|
|
OR file.path LIKE '/tmp/%'
|
|
|
|
OR file.path LIKE '/var/tmp/%'
|
|
|
|
)
|
|
|
|
AND file.type = "regular"
|
|
|
|
AND file.size > 2000
|
|
|
|
AND file.size < 400000
|
|
|
|
AND (
|
|
|
|
file.btime > (strftime('%s', 'now') -43200)
|
|
|
|
OR file.ctime > (strftime('%s', 'now') -43200)
|
|
|
|
OR file.mtime > (strftime('%s', 'now') -43200)
|
|
|
|
)
|
2023-09-20 21:03:21 +00:00
|
|
|
)
|
2024-04-26 20:14:02 +00:00
|
|
|
AND yara.sigrule = '
|
2023-09-20 21:03:21 +00:00
|
|
|
rule ransomware {
|
|
|
|
strings:
|
|
|
|
$unfortunately = "unfortunately" ascii
|
|
|
|
$crypted = "crypted" ascii
|
|
|
|
$leaked = "leaked" ascii
|
|
|
|
$recover = "recover your" ascii
|
|
|
|
$leaks = "of leaks" ascii
|
|
|
|
$decrypt = "will decrypt" ascii
|
2024-04-26 20:14:02 +00:00
|
|
|
|
|
|
|
$onion = ".onion/" ascii
|
2023-09-20 21:03:21 +00:00
|
|
|
$tor = "TOR Browser" ascii
|
|
|
|
|
|
|
|
$esxcli = "esxcli" ascii
|
|
|
|
condition:
|
2024-04-26 20:14:02 +00:00
|
|
|
filesize < 10MB and 3 of them
|
2023-09-20 21:03:21 +00:00
|
|
|
}'
|
2023-12-08 22:12:27 +00:00
|
|
|
AND yara.count > 0
|
2024-02-16 22:21:00 +00:00
|
|
|
AND file.path NOT LIKE "%.csv"
|
2024-04-26 20:14:02 +00:00
|
|
|
AND file.path NOT LIKE "%.txt"
|
|
|
|
AND file.path NOT LIKE "%.md"
|
|
|
|
AND file.path NOT LIKE "%.xls"
|